diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-08-31 22:11:50 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-08-31 22:11:50 +0100 |
commit | bae00bb1cc392e1cf408369809b9cf85468bef42 (patch) | |
tree | 17103af6eeb5de96c72beda1debce28950cc7fea /actionpack/test/controller/base_test.rb | |
parent | 93c76b2fb08668bc4b8364cc8051476e6d1d15ba (diff) | |
parent | ffd2cf167040b60c26d97c01598560c87bd4b2d3 (diff) | |
download | rails-bae00bb1cc392e1cf408369809b9cf85468bef42.tar.gz rails-bae00bb1cc392e1cf408369809b9cf85468bef42.tar.bz2 rails-bae00bb1cc392e1cf408369809b9cf85468bef42.zip |
Merge commit 'mainstream/master'
Diffstat (limited to 'actionpack/test/controller/base_test.rb')
-rw-r--r-- | actionpack/test/controller/base_test.rb | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb index 8877057070..b97ceb4594 100644 --- a/actionpack/test/controller/base_test.rb +++ b/actionpack/test/controller/base_test.rb @@ -177,17 +177,17 @@ class DefaultUrlOptionsTest < ActionController::TestCase end def test_default_url_options_are_used_if_set - ActionController::Routing::Routes.draw do |map| - map.default_url_options 'default_url_options', :controller => 'default_url_options' - map.connect ':controller/:action/:id' - end + with_routing do |set| + set.draw do |map| + map.default_url_options 'default_url_options', :controller => 'default_url_options' + map.connect ':controller/:action/:id' + end - get :default_url_options_action # Make a dummy request so that the controller is initialized properly. + get :default_url_options_action # Make a dummy request so that the controller is initialized properly. - assert_equal 'http://www.override.com/default_url_options/new?bacon=chunky', @controller.url_for(:controller => 'default_url_options') - assert_equal 'http://www.override.com/default_url_options?bacon=chunky', @controller.send(:default_url_options_url) - ensure - ActionController::Routing::Routes.load! + assert_equal 'http://www.override.com/default_url_options/new?bacon=chunky', @controller.url_for(:controller => 'default_url_options') + assert_equal 'http://www.override.com/default_url_options?bacon=chunky', @controller.send(:default_url_options_url) + end end end @@ -206,15 +206,15 @@ class EmptyUrlOptionsTest < ActionController::TestCase end end -class EnsureNamedRoutesWorksTicket22BugTest < Test::Unit::TestCase +class EnsureNamedRoutesWorksTicket22BugTest < ActionController::TestCase def test_named_routes_still_work - ActionController::Routing::Routes.draw do |map| - map.resources :things - end - EmptyController.send :include, ActionController::UrlWriter + with_routing do |set| + set.draw do |map| + map.resources :things + end + EmptyController.send :include, ActionController::UrlWriter - assert_equal '/things', EmptyController.new.send(:things_path) - ensure - ActionController::Routing::Routes.load! + assert_equal '/things', EmptyController.new.send(:things_path) + end end end |