aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/routing
diff options
context:
space:
mode:
authorAndrew White <andrew.white@unboxed.co>2017-02-21 08:30:36 +0000
committerAndrew White <andrew.white@unboxed.co>2017-02-21 15:30:47 +0000
commit80dcfd014b27e560f5c4b07ee5ffa98894d8ff63 (patch)
treef59a8d525c484af4430839c0fb43b52c46ae4be2 /actionpack/test/dispatch/routing
parent960e73a96df55aecfaf196e35df80f8f0121f51d (diff)
downloadrails-80dcfd014b27e560f5c4b07ee5ffa98894d8ff63.tar.gz
rails-80dcfd014b27e560f5c4b07ee5ffa98894d8ff63.tar.bz2
rails-80dcfd014b27e560f5c4b07ee5ffa98894d8ff63.zip
Raise an error if `direct` is inside a scope block
Diffstat (limited to 'actionpack/test/dispatch/routing')
-rw-r--r--actionpack/test/dispatch/routing/direct_url_helpers_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing/direct_url_helpers_test.rb b/actionpack/test/dispatch/routing/direct_url_helpers_test.rb
index 56bb7f13b3..24e46758cc 100644
--- a/actionpack/test/dispatch/routing/direct_url_helpers_test.rb
+++ b/actionpack/test/dispatch/routing/direct_url_helpers_test.rb
@@ -212,4 +212,16 @@ class TestDirectUrlHelpers < ActionDispatch::IntegrationTest
end
end
end
+
+ def test_defining_inside_a_scope_raises_runtime_error
+ routes = ActionDispatch::Routing::RouteSet.new
+
+ assert_raises RuntimeError do
+ routes.draw do
+ namespace :admin do
+ direct(:rubyonrails) { "http://www.rubyonrails.org" }
+ end
+ end
+ end
+ end
end