Displaying 2 results from an estimated 2 matches for "active_merchant_gateway".
2007 Jun 21
2
expects with returns that returns the return value of the actual method
...Billing::Base.mode = :test
member = Member.new
member.credit_card_number = "1"
member.expiration_date = "9/19/2007"
member.payment_method = "bogus"
member.first_name = "Steve"
member.last_name = "Eichert"
member.expects(:active_merchant_gateway).returns(gateway)
# gateway.expects(:purchase).returns(:non_mocked_return)
member.charge
assert member.paid
end
2007 Jun 21
3
only checking certain parameters for a method
...gateway = test_gateway
member = Member.new
member.credit_card_number = "1"
member.expiration_date = "9/19/2007"
member.payment_method = "bogus"
member.first_name = "Steve"
member.last_name = "Eichert"
member.expects(:active_merchant_gateway).returns(gateway)
member.expects(:purchase).with(1000, :any).returns(TestResponse.new)
member.charge
end
On a slightly unrelated note, I was trying to find a way to search the
mailing list archives here:
http://rubyforge.org/pipermail/mocha-developer/but wasn''t able to
figure anyt...