aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-08-12 14:12:17 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-08-12 14:30:53 -0700
commit4c641c6e362238afbe76b9a1c9d06339f2a805c4 (patch)
treeb289755b5114b82bc6ae137bc190ca0ff437a859 /actionpack
parentb59ff24207c39ec69ab2d792c5ebb4e77c871f51 (diff)
downloadrails-4c641c6e362238afbe76b9a1c9d06339f2a805c4.tar.gz
rails-4c641c6e362238afbe76b9a1c9d06339f2a805c4.tar.bz2
rails-4c641c6e362238afbe76b9a1c9d06339f2a805c4.zip
add a test for adding "via" using `scope`
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/dispatch/mapper_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/mapper_test.rb b/actionpack/test/dispatch/mapper_test.rb
index 5376ed70dd..bd9786899f 100644
--- a/actionpack/test/dispatch/mapper_test.rb
+++ b/actionpack/test/dispatch/mapper_test.rb
@@ -47,6 +47,15 @@ module ActionDispatch
assert_equal(/.+?/, requirements[:rest])
end
+ def test_via_scope
+ fakeset = FakeSet.new
+ mapper = Mapper.new fakeset
+ mapper.scope(via: :put) do
+ mapper.match '/', :to => 'posts#index', :as => :main
+ end
+ assert_equal ["PUT"], fakeset.conditions.first[:request_method]
+ end
+
def test_map_slash
fakeset = FakeSet.new
mapper = Mapper.new fakeset