Permalink
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...
1 parent e6dac03 commit 96d3e75916b7b1ed872368193c15537ec7ba53ef @JonRowe JonRowe committed Dec 5, 2013
Showing with 3 additions and 0 deletions.
  1. +3 −0 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 =~ /^_/

0 comments on commit 96d3e75

Please sign in to comment.