[rspec-devel] [ rspec-Bugs-12963 ] RESTfully generated (polymorphic) helpers require arguments in rspec but not in rails
noreply at rubyforge.org
noreply at rubyforge.org
Fri Aug 10 10:01:16 EDT 2007
Bugs item #12963, was opened at 2007-08-10 09:01
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=12963&group_id=797
Category: rails plugin
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Lance Carlson (lancelot)
Assigned to: Nobody (None)
Summary: RESTfully generated (polymorphic) helpers require arguments in rspec but not in rails
Initial Comment:
My view tests fail when I try to use the polymorphic helpers in rails and report back an error like this:
ActionView::TemplateError in 'Edit Artist Page should render the edit
artist form'
label_artist_url failed to generate from {:controller=>"artists",
:action=>"show"} - you may have ambiguous routes, or you may need to
supply additional parameters for this route. content_url has the
following required parameters: ["labels", :label_id, "artists", :id] -
are they all satisfied?
On line #3 of app/views/artists/edit.rhtml
1: <h1>Editing artist</h1>
2:
3: <% form_tag label_artist_path, :method => :put do %>
4: <%= render :partial => 'form' %>
5: <%= submit_tag 'Save' %>
6: <% end %>
I could stub out the method, but then I wouldn't be testing the view in its entirety. I could provide the arguments that it asks for and the tests passes. Forcing me to add the arguments adds unnecessary noise to the code and should not be a requirement to get tests to pass in rspec. I will try this without nested routes and see if the same problem arises and will also try to see if I can make a patch for this.
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=12963&group_id=797
More information about the rspec-devel
mailing list