[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
Mon Nov 19 03:44:56 EST 2007


Bugs item #12963, was opened at 2007-08-10 14: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: Closed
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. 

----------------------------------------------------------------------

Comment By: Chad Humphries (spicycode)
Date: 2007-11-19 04:01

Message:
Moved to http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/58-12963-restfully-generated-polymorphic-helpers-require-arguments-in-rspec-but-not-in-rails

----------------------------------------------------------------------

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