aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/routing_test.rb
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2010-11-16 21:46:15 -0800
committerCarl Lerche <me@carllerche.com>2010-11-16 21:46:15 -0800
commit401c1835afb5af1a6f429061ac8484227c34909d (patch)
treead2ea9a395e78fd5fa09fb4725aeee340768cf4d /actionpack/test/controller/routing_test.rb
parent1deeaf5495036dd7541e2085e8311c57e7130f0a (diff)
downloadrails-401c1835afb5af1a6f429061ac8484227c34909d.tar.gz
rails-401c1835afb5af1a6f429061ac8484227c34909d.tar.bz2
rails-401c1835afb5af1a6f429061ac8484227c34909d.zip
Anchors should be allowed on constraints that are not on path segments
Diffstat (limited to 'actionpack/test/controller/routing_test.rb')
-rw-r--r--actionpack/test/controller/routing_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index ecfa13d4ba..ce5c899a19 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -834,6 +834,14 @@ class RouteSetTest < ActiveSupport::TestCase
assert_equal({:controller => 'pages', :action => 'show', :id => '10'}, set.recognize_path('/page/10'))
end
+ def test_route_constraints_on_request_object_with_anchors_are_valid
+ assert_nothing_raised do
+ set.draw do
+ match 'page/:id' => 'pages#show', :constraints => { :host => /^foo$/ }
+ end
+ end
+ end
+
def test_route_constraints_with_anchor_chars_are_invalid
assert_raise ArgumentError do
set.draw do