Skip to content

Commit ba11500

Browse files
committed
Handle render :plain in test case controller
1 parent 83243ce commit ba11500

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/caching_test.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def with_symbol_format
8282
end
8383

8484
def not_url_cache_path
85-
render text: 'cache_this'
85+
render plain: 'cache_this'
8686
end
8787

8888
def record_not_found
@@ -137,6 +137,16 @@ def invalid
137137
def cache_path_protected_method
138138
['controller', params[:id]].compact.join('-')
139139
end
140+
141+
if ActionPack::VERSION::STRING < "4.1"
142+
def render(options)
143+
if options.key?(:plain)
144+
super({ text: options.delete(:plain) }.merge(options))
145+
else
146+
super
147+
end
148+
end
149+
end
140150
end
141151

142152
class MockTime < Time

0 commit comments

Comments
 (0)