diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-10-03 23:31:38 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-10-03 23:31:38 -0500 |
commit | 86ed58d9121844e2d881be67e2d845ae721f72e7 (patch) | |
tree | ea670adc7da8b04d21d8a644db2ce619ea771dbe /actionpack/test/controller/caching_test.rb | |
parent | 61411f2aeb29edba2d8cd2008020044799ea3d61 (diff) | |
download | rails-86ed58d9121844e2d881be67e2d845ae721f72e7.tar.gz rails-86ed58d9121844e2d881be67e2d845ae721f72e7.tar.bz2 rails-86ed58d9121844e2d881be67e2d845ae721f72e7.zip |
Use with_routing helper in tests instead of modifying global route set
Diffstat (limited to 'actionpack/test/controller/caching_test.rb')
-rw-r--r-- | actionpack/test/controller/caching_test.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index 1a9f95e5e9..69b0eb5e3e 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -46,14 +46,8 @@ end class PageCachingTest < ActionController::TestCase def setup super - ActionController::Base.perform_caching = true - ActionController::Routing::Routes.draw do |map| - map.main '', :controller => 'posts', :format => nil - map.formatted_posts 'posts.:format', :controller => 'posts' - map.resources :posts - map.connect ':controller/:action/:id' - end + ActionController::Base.perform_caching = true @request = ActionController::TestRequest.new @request.host = 'hostname.com' @@ -74,10 +68,16 @@ class PageCachingTest < ActionController::TestCase end def test_page_caching_resources_saves_to_correct_path_with_extension_even_if_default_route - @params[:format] = 'rss' - assert_equal '/posts.rss', @rewriter.rewrite(@params) - @params[:format] = nil - assert_equal '/', @rewriter.rewrite(@params) + with_routing do |set| + set.draw do |map| + map.main '', :controller => 'posts', :format => nil + map.formatted_posts 'posts.:format', :controller => 'posts' + end + @params[:format] = 'rss' + assert_equal '/posts.rss', @rewriter.rewrite(@params) + @params[:format] = nil + assert_equal '/', @rewriter.rewrite(@params) + end end def test_should_cache_get_with_ok_status |