diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-09-01 19:17:47 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-09-03 22:59:15 +0200 |
commit | b8d6dc3c84321c751ab2ca8232e1e3fb332a844c (patch) | |
tree | 0e6dee18bab820dcbdfd37518a81eb81447b45e6 /actionpack/test/dispatch | |
parent | b43b686b022c4253a4a6f6f1b663b99d7a9adf4f (diff) | |
download | rails-b8d6dc3c84321c751ab2ca8232e1e3fb332a844c.tar.gz rails-b8d6dc3c84321c751ab2ca8232e1e3fb332a844c.tar.bz2 rails-b8d6dc3c84321c751ab2ca8232e1e3fb332a844c.zip |
Implemented RouteSet#default_scope, which allows to set the scope for the entire routes object
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index c90c1041ed..b642adc06b 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -2151,3 +2151,32 @@ private %(<html><body>You are being <a href="#{ERB::Util.h(url)}">redirected</a>.</body></html>) end end + + +class TestDefaultScope < ActionController::IntegrationTest + module ::Blog + class PostsController < ActionController::Base + def index + render :text => "blog/posts#index" + end + end + end + + DefaultScopeRoutes = ActionDispatch::Routing::RouteSet.new + DefaultScopeRoutes.default_scope = {:module => :blog} + DefaultScopeRoutes.draw do + resources :posts + end + + def app + DefaultScopeRoutes + end + + include DefaultScopeRoutes.url_helpers + + def test_default_scope + get '/posts' + assert_equal "blog/posts#index", @response.body + end +end + |