From 4c641c6e362238afbe76b9a1c9d06339f2a805c4 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 12 Aug 2015 14:12:17 -0700 Subject: add a test for adding "via" using `scope` --- actionpack/test/dispatch/mapper_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'actionpack/test/dispatch') 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 -- cgit v1.2.3