This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

make sure the first named route added wins

  • Loading branch information...
1 parent 98a9802 commit 19defa6acfe8318ee029495d8bcacbeed1094ca3 @tenderlove tenderlove committed Dec 12, 2011
Showing with 13 additions and 0 deletions.
  1. +13 −0 test/test_routes.rb
View
@@ -34,5 +34,18 @@ def test_simulator_changes
routes.add_route nil, path, {}, {}, {}
refute_equal sim, routes.simulator
end
+
+ def test_first_name_wins
+ #def add_route app, path, conditions, defaults, name = nil
+ routes = Routes.new
+
+ one = Path::Pattern.new '/hello'
+ two = Path::Pattern.new '/aaron'
+
+ routes.add_route nil, one, {}, {}, 'aaron'
+ routes.add_route nil, two, {}, {}, 'aaron'
+
+ assert_equal '/hello', routes.named_routes['aaron'].path.spec.to_s
+ end
end
end

0 comments on commit 19defa6

Please sign in to comment.