Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

routing assertions do not support constraints

#5260
# in config/routes.rb
match 'profile', :to => 'users#profile', :constraints => {:subdomain => /.+/ }
# in test/functional/profile_routing_test.rb
assert_generates "/profile", :controller => :users, :action => :profile
# result of running test
undefined method `subdomain' for #<Rack::Request:0x102ed9268>

It appears that routing assertions have not been updated along with changes to the router, and do not support constraints that interact with the request. Note that the error states Rack::Request, and not ActionDispatch::Request, which handles constraints like subdomain.

Reported by David Chelimsky · July 31st, 2010 @ 01:37 PM

State: duplicate
Milestone: none
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. David Chelimsky
    David Chelimsky
    • Tag set to routing assert_generates

    July 31st, 2010 @ 01:38 PM

  2. Andrew White
    Andrew White
    • State changed from new to duplicate
    • Importance changed from to Low

    August 20th, 2010 @ 08:01 AM