Skip to content

Commit

Permalink
clear view path cache between tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tenderlove committed Jan 28, 2016
1 parent 98a01c6 commit 683d4f7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions actionpack/test/controller/render_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ def accessing_logger_in_template
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'))
Expand Down

0 comments on commit 683d4f7

Please sign in to comment.