mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Update tests for #9704, named route collisions
* Fix named route collision in mount test fixture * Update controller named route precedence test
This commit is contained in:
parent
b3e08f25ef
commit
32ec8eb91d
2 changed files with 7 additions and 6 deletions
|
@ -908,12 +908,13 @@ class RouteSetTest < ActiveSupport::TestCase
|
|||
assert_equal set.routes.first, set.named_routes[:hello]
|
||||
end
|
||||
|
||||
def test_earlier_named_routes_take_precedence
|
||||
set.draw do
|
||||
get '/hello/world' => 'a#b', :as => 'hello'
|
||||
get '/hello' => 'a#b', :as => 'hello'
|
||||
def test_duplicate_named_route_raises_rather_than_pick_precedence
|
||||
assert_raise ArgumentError do
|
||||
set.draw do
|
||||
get '/hello/world' => 'a#b', :as => 'hello'
|
||||
get '/hello' => 'a#b', :as => 'hello'
|
||||
end
|
||||
end
|
||||
assert_equal set.routes.first, set.named_routes[:hello]
|
||||
end
|
||||
|
||||
def setup_named_route_test
|
||||
|
|
|
@ -21,7 +21,7 @@ class TestRoutingMount < ActionDispatch::IntegrationTest
|
|||
mount SprocketsApp, :at => "/sprockets"
|
||||
mount SprocketsApp => "/shorthand"
|
||||
|
||||
mount FakeEngine, :at => "/fakeengine"
|
||||
mount FakeEngine, :at => "/fakeengine", :as => :fake
|
||||
mount FakeEngine, :at => "/getfake", :via => :get
|
||||
|
||||
scope "/its_a" do
|
||||
|
|
Loading…
Reference in a new issue