On Wed, Nov 5, 2008 at 2:08 PM, Fernando Perez <[EMAIL PROTECTED]> wrote: >> @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)?
Fernando - I'm happy to help, as are we all, but you make it difficult to understand the context if we have to look at other email in the thread to see the code. Please make sure, when you ask a question, that you quote enough of the thread so that the readers can understand what you're asking. _______________________________________________ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users
