提交 32ec8eb9 编写于 作者: J Jeremy Kemper

Update tests for #9704, named route collisions

* Fix named route collision in mount test fixture
* Update controller named route precedence test
上级 b3e08f25
......@@ -908,12 +908,13 @@ def test_named_draw
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 @@ def self.call(env)
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册