aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2016-01-26 17:06:31 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2016-01-26 17:06:31 -0800
commit0361d8449ff1c18da041df4b7dfe648abf0f1887 (patch)
treed3b10eed8431f5ff46066e88a9fd5984075cb4d7 /actionpack
parent755f7b58953c25790eea0574ff8928033ded2d88 (diff)
downloadrails-0361d8449ff1c18da041df4b7dfe648abf0f1887.tar.gz
rails-0361d8449ff1c18da041df4b7dfe648abf0f1887.tar.bz2
rails-0361d8449ff1c18da041df4b7dfe648abf0f1887.zip
clear view path cache between tests
The cache for `render file:` seems to also be used in the case of `render(string)`. If one is supposed to be a hit and the other is supposed to be a miss, and they both reference the same file, then the cache could return incorrect values. This commit clears the cache between runs so that we get non-cached behavior.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/controller/render_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index 3f569230c2..db73de6010 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -253,6 +253,11 @@ end
class ExpiresInRenderTest < ActionController::TestCase
tests TestController
+ def setup
+ super
+ ActionController::Base.view_paths.paths.each(&:clear_cache)
+ end
+
def test_dynamic_render_with_file
# This is extremely bad, but should be possible to do.
assert File.exist?(File.join(File.dirname(__FILE__), '../../test/abstract_unit.rb'))