Forum: Ruby on Rails assert_generates and catch-all routes

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
57a175cd9602613be71bff2912b2b3f8?d=identicon&s=25 Chris Roos (chrisjroos)
on 2005-12-14 13:24
I have a catch all route.

map.connect 'people/*args', :controller => 'people', :action =>
'default_action'

I can test this one way, with assert_recognizes.

expected_options = { :controller => 'people', :action =>
'default_action', :args => ['made_up'] }
assert_recognizes expected_options, 'people/made_up'

I'm wondering why I cannot test the other way, using assert_generates?

options_for_url = { :controller => 'people' }
assert_generates 'people/default_action', options_for_url

The above fails with "ActionController::RoutingError: No url can be
generated for the hash".

I assume I am missing something in my understanding of routing.  If
anyone can enlighten me that'd be grand.

Cheers,

Chris
This topic is locked and can not be replied to.