Skip to content

Commit 31d50b8

Browse files
committed
Speed up view specs
The caching was turned off in [1] because different formats were being cached under the same key. I believe the need to do this was removed in the previous commit. This reduces the time it takes to run FutureLearn’s view specs by about 50%. I think it’s sensible to use the view cache during test because it’s normally on between requests in other environments, and it looks like it was only turned off to work around this caching issue. [1] rspec#864
1 parent ed97014 commit 31d50b8

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

lib/rspec/rails/example/view_example_group.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,6 @@ def _include_controller_helpers
155155
view.lookup_context.prefixes << _controller_path
156156
end
157157

158-
# fixes bug with differing formats
159-
view.lookup_context.view_paths.each(&:clear_cache)
160-
161158
controller.controller_path = _controller_path
162159
controller.request.path_parameters[:controller] = _controller_path
163160
controller.request.path_parameters[:action] = _inferred_action unless _inferred_action =~ /^_/

0 commit comments

Comments
 (0)