From d61e3c79dc85a5ae86ed00fc9352a5d1d84c0f3f Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 12 Aug 2015 16:24:26 -0700 Subject: add a regression test for scoped `format` params This just ensures that `format` is applied to things inside the scope --- actionpack/test/dispatch/mapper_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'actionpack') 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 -- cgit v1.2.3