[rspec-users] How to spec error_messages_for
dchelimsky at gmail.com
Wed Mar 21 13:12:12 EDT 2007
On 3/21/07, Ashley Moran <work at ashleymoran.me.uk> wrote:
> I'm trying to spec a call to error_messages_for to avoid stubbing out
> whole models. Something like this:
> context "A rendered calculate_quote view" do
> setup do
> @form = mock("form")
> assigns[:form] = @form
> specify "should render the error messages" do
> ('form', :anything)
> render 'gap/calculate_quote'
> What can I put as <SOMETHING>?
"Danger, danger, Will Robinson!"
The fact that you have to ask this question is a sign that you
probably shouldn't be doing this. The answer lies in AR internals,
which is stuff you really shouldn't be mocking.
Imagine that you do this, and a new version of rails implements this
differently. You may start getting a bunch of failing integration
tests w/o failing isolation tests and they'll be very difficult to
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users