aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2013-03-24 23:26:11 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2013-03-24 23:30:44 -0700
commit32ec8eb91dbd797357e0d1672618e0b1a3ad8854 (patch)
tree71b97a19dd7f3c3b220fa54ff2ffd8487c26287e
parentb3e08f25efd21a627e8e341cd8afc4a5664bb1cb (diff)
downloadrails-32ec8eb91dbd797357e0d1672618e0b1a3ad8854.tar.gz
rails-32ec8eb91dbd797357e0d1672618e0b1a3ad8854.tar.bz2
rails-32ec8eb91dbd797357e0d1672618e0b1a3ad8854.zip
Update tests for #9704, named route collisions
* Fix named route collision in mount test fixture * Update controller named route precedence test
-rw-r--r--actionpack/test/controller/routing_test.rb11
-rw-r--r--actionpack/test/dispatch/mount_test.rb2
2 files changed, 7 insertions, 6 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index 93e94f0f48..978c5aa7ac 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -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
diff --git a/actionpack/test/dispatch/mount_test.rb b/actionpack/test/dispatch/mount_test.rb
index 3b008fdff0..e5e28c28be 100644
--- a/actionpack/test/dispatch/mount_test.rb
+++ b/actionpack/test/dispatch/mount_test.rb
@@ -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