Saturday, May 28, 2011

[Rails] how can I investigate when a rspec test fails?

For example:

it "re-renders the 'new' template" do
# Trigger the behavior that occurs when invalid params are submitted
Sector.any_instance.stub(:save).and_return(false)
post :create, :sector => {}
response.should render_template("new")
end

I have the new template under app/views/sectors but the test says:

SectorsController POST create with invalid params re-renders the 'new' template
Failure/Error: response.should render_template("new")
expecting <"new"> but rendering with <"">

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate