@@ -38,6 +38,7 @@ class ActionCachingTestController < CachingController
38
38
caches_action :with_layout
39
39
caches_action :with_format_and_http_param , cache_path : Proc . new { |c | { key : 'value' } }
40
40
caches_action :with_symbol_format , cache_path : 'http://test.host/action_caching_test/with_symbol_format'
41
+ caches_action :not_url_cache_path , cache_path : Proc . new { |c | "#{ c . params [ :action ] } _key" }
41
42
caches_action :layout_false , layout : false
42
43
caches_action :with_layout_proc_param , layout : Proc . new { |c | c . params [ :layout ] }
43
44
caches_action :record_not_found , :four_oh_four , :simple_runtime_error
@@ -76,6 +77,10 @@ def with_symbol_format
76
77
render json : { timestamp : @cache_this }
77
78
end
78
79
80
+ def not_url_cache_path
81
+ render text : 'cache_this'
82
+ end
83
+
79
84
def record_not_found
80
85
raise ActiveRecord ::RecordNotFound , 'oops!'
81
86
end
@@ -287,6 +292,13 @@ def test_action_cache_with_symbol_format
287
292
assert fragment_exist? ( 'test.host/action_caching_test/with_symbol_format.json' )
288
293
end
289
294
295
+ def test_action_cache_not_url_cache_path
296
+ get :not_url_cache_path
297
+ assert_response :success
298
+ assert !fragment_exist? ( 'test.host/action_caching_test/not_url_cache_path' )
299
+ assert fragment_exist? ( 'not_url_cache_path_key' )
300
+ end
301
+
290
302
def test_action_cache_with_store_options
291
303
MockTime . expects ( :now ) . returns ( 12345 ) . once
292
304
@controller . expects ( :read_fragment ) . with ( 'hostname.com/action_caching_test' , expires_in : 1 . hour ) . once
0 commit comments