aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorPiotr Jakubowski <piotrj@gmail.com>2016-06-27 21:02:19 +0200
committerPiotr Jakubowski <piotrj@gmail.com>2016-06-28 20:05:51 +0200
commita0b1912fb077d47e1977cf1b38b884651756d853 (patch)
tree1cdbf5b88c3bb3767e559571d5152a3a7af1c9a9 /actionpack/test
parent754e5bdf8713b95c2bb9d2ab4656fd240da12181 (diff)
downloadrails-a0b1912fb077d47e1977cf1b38b884651756d853.tar.gz
rails-a0b1912fb077d47e1977cf1b38b884651756d853.tar.bz2
rails-a0b1912fb077d47e1977cf1b38b884651756d853.zip
Fix setting route's to in a scope
Fixes #25488 97d7dc4 introduced a regression that resulted in ArgumentError when to was in options of the scope and not of particular route.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/mapper_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/mapper_test.rb b/actionpack/test/dispatch/mapper_test.rb
index 69098326b9..f6dd9272a6 100644
--- a/actionpack/test/dispatch/mapper_test.rb
+++ b/actionpack/test/dispatch/mapper_test.rb
@@ -102,6 +102,18 @@ module ActionDispatch
assert_equal("PUT", fakeset.routes.first.verb)
end
+ def test_to_scope
+ fakeset = FakeSet.new
+ mapper = Mapper.new fakeset
+ mapper.scope(to: "posts#index") do
+ mapper.get :all
+ mapper.post :most
+ end
+
+ assert_equal "posts#index", fakeset.routes.to_a[0].defaults[:to]
+ assert_equal "posts#index", fakeset.routes.to_a[1].defaults[:to]
+ end
+
def test_map_slash
fakeset = FakeSet.new
mapper = Mapper.new fakeset