[rspec-users] Problems with RESTfully generated helpers

Jay Levitt lists-rspec at shopwatch.org
Sun Aug 12 20:28:39 EDT 2007


Lance Carlson wrote:
> It was never resolved.. the only resolution was to mock out the
> methods at this point or provide the views with the instance
> variables.

Well, I didn't get anywhere tonight - but I did discover that 
script/console has the same problem.  Given routes.rb:

map.resources :users, :member =>
     {:edit_business_card => :get,
      :update_business_card => :put }

and:

 >> app.update_business_card_user_url

I get:

ActionController::RoutingError: update_business_card_user_url failed to 
generate from {:controller=>"users", :action=>"update_business_card"} - 
you may have ambiguous routes, or you may need to supply additional 
parameters for this route.  content_url has the following required 
parameters: ["users", :id, "update_business_card"] - are they all satisfied?

Yet using update_business_card_user_url from a view works fine.

Since I can duplicate it without rspec, I'll post a message to 
rubyonrails-talk and see if anyone has some ideas.

Jay



More information about the rspec-users mailing list