aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-08-12 16:29:33 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-08-12 16:54:35 -0700
commitec895189e4bed93f40ba96af7319a5fc046ad621 (patch)
tree8778893fafff46fb67c3cbbe7062e076fd78c2fa /actionpack/test/dispatch
parentd61e3c79dc85a5ae86ed00fc9352a5d1d84c0f3f (diff)
downloadrails-ec895189e4bed93f40ba96af7319a5fc046ad621.tar.gz
rails-ec895189e4bed93f40ba96af7319a5fc046ad621.tar.bz2
rails-ec895189e4bed93f40ba96af7319a5fc046ad621.zip
pull `formatted` up the stack
this reduces the number of times we have to mutate the options hash.
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/mapper_test.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/mapper_test.rb b/actionpack/test/dispatch/mapper_test.rb
index edc6987e97..6ce0e34ec3 100644
--- a/actionpack/test/dispatch/mapper_test.rb
+++ b/actionpack/test/dispatch/mapper_test.rb
@@ -52,6 +52,15 @@ module ActionDispatch
end
end
+ def test_unscoped_formatted
+ fakeset = FakeSet.new
+ mapper = Mapper.new fakeset
+ mapper.get '/foo', :to => 'posts#index', :as => :main, :format => true
+ assert_equal({:controller=>"posts", :action=>"index"},
+ fakeset.defaults.first)
+ assert_equal "/foo.:format", fakeset.conditions.first[:path_info]
+ end
+
def test_scoped_formatted
fakeset = FakeSet.new
mapper = Mapper.new fakeset
@@ -77,7 +86,7 @@ module ActionDispatch
def test_mapping_requirements
options = { }
scope = Mapper::Scope.new({})
- m = Mapper::Mapping.build(scope, FakeSet.new, '/store/:name(*rest)', nil, 'foo', 'bar', nil, [:get], options)
+ m = Mapper::Mapping.build(scope, FakeSet.new, '/store/:name(*rest)', nil, 'foo', 'bar', nil, [:get], nil, options)
_, _, requirements, _ = m.to_route
assert_equal(/.+?/, requirements[:rest])
end