aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-12-06 04:11:59 -0800
committerJosé Valim <jose.valim@gmail.com>2011-12-06 04:11:59 -0800
commitd722eb3b049b18da602a36b6dfd1c69945b9fb0d (patch)
tree7e846eeaadadb3b28d5d724de8ae8bf7f10d2b0e /actionpack/test
parent81fec5dfc4adb06072aa7059f5c6554171eafb68 (diff)
parent0da31a1839d03e597f8ce0ae853b3a75519f325a (diff)
downloadrails-d722eb3b049b18da602a36b6dfd1c69945b9fb0d.tar.gz
rails-d722eb3b049b18da602a36b6dfd1c69945b9fb0d.tar.bz2
rails-d722eb3b049b18da602a36b6dfd1c69945b9fb0d.zip
Merge pull request #3876 from tvdeyen/string_as_url_for_expire_action
Allow string as url for expire_action
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/caching_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb
index 2364bbf3a3..015e6b9955 100644
--- a/actionpack/test/controller/caching_test.rb
+++ b/actionpack/test/controller/caching_test.rb
@@ -251,6 +251,11 @@ class ActionCachingTestController < CachingController
expire_action :controller => 'action_caching_test', :action => 'index', :format => 'xml'
render :nothing => true
end
+
+ def expire_with_url_string
+ expire_action url_for(:controller => 'action_caching_test', :action => 'index')
+ render :nothing => true
+ end
end
class MockTime < Time
@@ -445,6 +450,21 @@ class ActionCacheTest < ActionController::TestCase
assert_not_equal cached_time, @response.body
end
+ def test_cache_expiration_with_url_string
+ get :index
+ cached_time = content_to_cache
+ reset!
+
+ @request.request_uri = "/action_caching_test/expire_with_url_string"
+ get :expire_with_url_string
+ assert_response :success
+ reset!
+
+ get :index
+ assert_response :success
+ assert_not_equal cached_time, @response.body
+ end
+
def test_cache_is_scoped_by_subdomain
@request.host = 'jamis.hostname.com'
get :index