>      order.stub_chain(:line_items, :paid).and_return([mock_line_item])
>
> Is more likely to work
>
> Malc

As you mentioned it still feels a bit wrong as you end up testing the
implementation of the method instead of the behaviour.

It seems to be a choice between hitting the database and having slow
tests or stubbing out the method chain and having brittle tests.

Either way I'm not completely happy with the resulting test suite.

I would have thought this situation would be fairly common in a rails
application, how are people handling this currently?

Scott

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to