diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-24 10:34:09 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-24 10:34:09 -0800 |
commit | ad6f689bfff5148065a4d7eec1cf5d15da4e41c4 (patch) | |
tree | 57149665113cafcebc7b1a8b164c623f53c370ab /actionpack/test/controller | |
parent | d26a166cfbd5c7f67277256aa74e6cc1df7feb77 (diff) | |
parent | 9b654d47134ef06022861200c2f6e48f8459afb0 (diff) | |
download | rails-ad6f689bfff5148065a4d7eec1cf5d15da4e41c4.tar.gz rails-ad6f689bfff5148065a4d7eec1cf5d15da4e41c4.tar.bz2 rails-ad6f689bfff5148065a4d7eec1cf5d15da4e41c4.zip |
Merge pull request #3775 from karevn/master
Please pull my changes - they fix a rare problem with tests framework
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 9a0cfc8e8e..44a40e0665 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -1380,7 +1380,20 @@ class RouteSetTest < ActiveSupport::TestCase end end end - + + def test_route_with_subdomain_and_constraints_must_receive_params + name_param = nil + set.draw do + match 'page/:name' => 'pages#show', :constraints => lambda {|request| + name_param = request.params[:name] + return true + } + end + assert_equal({:controller => 'pages', :action => 'show', :name => 'mypage'}, + set.recognize_path('http://subdomain.example.org/page/mypage')) + assert_equal(name_param, 'mypage') + end + def test_route_requirement_recognize_with_ignore_case set.draw do match 'page/:name' => 'pages#show', |