Skip to content

Commit 96d3e75

Browse files
committed
blow away the view cache between specs
One of our cukes was failing because Rails caches templates and the differing format seems not to be enough to invalidate it automatically, I'm going to open a Rails patch for this but in the mean time this fixes that cuke.
1 parent e6dac03 commit 96d3e75

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/rspec/rails/example/view_example_group.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ def _include_controller_helpers
152152
view.lookup_context.prefixes << _controller_path
153153
end
154154

155+
# fixes bug with differing formats
156+
view.lookup_context.view_paths.each(&:clear_cache)
157+
155158
controller.controller_path = _controller_path
156159
controller.request.path_parameters[:controller] = _controller_path
157160
controller.request.path_parameters[:action] = _inferred_action unless _inferred_action =~ /^_/

0 commit comments

Comments
 (0)