> @cart.should_receive(:amount=).with(50)
> 
> amount and amount= are two different methods :)

Thanks Dave!

So now if I test for: @cart.amount.should eql(50)

Why do I get this error: expected 50, got 0 (using .eql?)

I have to add that the @cart is not saved in DB after its amount 
attribute is set, it is only displayed in the view for the user to see 
what would be the total amount.

Does the @cart object need to be saved to be able to test it with should 
eql(50)?
-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to