diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-12 14:12:17 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-12 14:30:53 -0700 |
commit | 4c641c6e362238afbe76b9a1c9d06339f2a805c4 (patch) | |
tree | b289755b5114b82bc6ae137bc190ca0ff437a859 /actionpack/test/dispatch | |
parent | b59ff24207c39ec69ab2d792c5ebb4e77c871f51 (diff) | |
download | rails-4c641c6e362238afbe76b9a1c9d06339f2a805c4.tar.gz rails-4c641c6e362238afbe76b9a1c9d06339f2a805c4.tar.bz2 rails-4c641c6e362238afbe76b9a1c9d06339f2a805c4.zip |
add a test for adding "via" using `scope`
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/mapper_test.rb | 9 |
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 |