aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-08-12 16:24:26 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-08-12 16:54:35 -0700
commitd61e3c79dc85a5ae86ed00fc9352a5d1d84c0f3f (patch)
tree3d262f1cd76b845e448f398c41f5037a9dfe6d2a /actionpack
parent7d4ad74ce594b8092f5782f51361a1fb9f64b8ad (diff)
downloadrails-d61e3c79dc85a5ae86ed00fc9352a5d1d84c0f3f.tar.gz
rails-d61e3c79dc85a5ae86ed00fc9352a5d1d84c0f3f.tar.bz2
rails-d61e3c79dc85a5ae86ed00fc9352a5d1d84c0f3f.zip
add a regression test for scoped `format` params
This just ensures that `format` is applied to things inside the scope
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/dispatch/mapper_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/mapper_test.rb b/actionpack/test/dispatch/mapper_test.rb
index 3071890521..edc6987e97 100644
--- a/actionpack/test/dispatch/mapper_test.rb
+++ b/actionpack/test/dispatch/mapper_test.rb
@@ -52,6 +52,17 @@ module ActionDispatch
end
end
+ def test_scoped_formatted
+ fakeset = FakeSet.new
+ mapper = Mapper.new fakeset
+ mapper.scope(format: true) do
+ mapper.get '/foo', :to => 'posts#index', :as => :main
+ end
+ assert_equal({:controller=>"posts", :action=>"index"},
+ fakeset.defaults.first)
+ assert_equal "/foo.:format", fakeset.conditions.first[:path_info]
+ end
+
def test_random_keys
fakeset = FakeSet.new
mapper = Mapper.new fakeset