search for: any_instance_with_id

Displaying 1 result from an estimated 1 matches for "any_instance_with_id".

2007 Mar 04
4
Rails functional testing and Mocha
...ctional test: [snip boiler plate] require ''eight_two_ask_customer'' class EightTwoAskCustomer include Mocha::ExpectationLoader end [snip more boiler plate] # Replace this with your real tests. def test_bill_customer c = customers(:customer1) EightTwoAskCustomer.any_instance_with_id( c.id).expects(:bill) post :bill, :id => c.id end This does mostly what I want, the test passes. If I comment out c.bill I get a failure: #<Mock:0x11e54b6>.bill - expected calls: 1, actual calls: 0 If I try to increase gross margins by billing the customer twice I get a failu...