Forum: Ruby on Rails assert_generates and catch-all routes

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Chris R. (Guest)
on 2005-12-14 14:24
I have a catch all route.

map.connect 'people/*args', :controller => 'people', :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.


This topic is locked and can not be replied to.