Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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.
  • Loading branch information...
commit 96d3e75916b7b1ed872368193c15537ec7ba53ef 1 parent e6dac03
@JonRowe JonRowe authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  lib/rspec/rails/example/view_example_group.rb
View
3  lib/rspec/rails/example/view_example_group.rb
@@ -152,6 +152,9 @@ def _include_controller_helpers
view.lookup_context.prefixes << _controller_path
end
+ # fixes bug with differing formats
+ view.lookup_context.view_paths.each(&:clear_cache)
+
controller.controller_path = _controller_path
controller.request.path_parameters[:controller] = _controller_path
controller.request.path_parameters[:action] = _inferred_action unless _inferred_action =~ /^_/
Please sign in to comment.
Something went wrong with that request. Please try again.