Skip to content
Browse files

Update tests for #9704, named route collisions

* Fix named route collision in mount test fixture
* Update controller named route precedence test
  • Loading branch information...
1 parent b3e08f2 commit 32ec8eb91dbd797357e0d1672618e0b1a3ad8854 @jeremy jeremy committed Mar 24, 2013
Showing with 7 additions and 6 deletions.
  1. +6 −5 actionpack/test/controller/routing_test.rb
  2. +1 −1 actionpack/test/dispatch/mount_test.rb
View
11 actionpack/test/controller/routing_test.rb
@@ -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
View
2 actionpack/test/dispatch/mount_test.rb
@@ -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

0 comments on commit 32ec8eb

Please sign in to comment.
Something went wrong with that request. Please try again.