Skip to content

Commit

Permalink
add a regression test for scoped format params
Browse files Browse the repository at this point in the history
This just ensures that `format` is applied to things inside the scope
  • Loading branch information
tenderlove committed Aug 12, 2015
1 parent 7d4ad74 commit d61e3c7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions actionpack/test/dispatch/mapper_test.rb
Expand Up @@ -52,6 +52,17 @@ def test_blows_up_without_via
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
Expand Down

0 comments on commit d61e3c7

Please sign in to comment.