-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix empty template rendering for Rails 4.2.5.1 #1535
Fix empty template rendering for Rails 4.2.5.1 #1535
Conversation
550f1b3
to
b498a38
Compare
controller.extend(EmptyTemplates) | ||
end | ||
end | ||
|
||
after do | ||
unless render_views? | ||
controller.class.view_paths = @_empty_view_path_set_delegator.original_path_set | ||
controller.class.view_paths = @_original_path_set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rubocop on Travis wants:
controller.class.view_paths = @_original_path_set unless render_views?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! We've actually merged a travis passing-fix in 3.4.1, this fix is a forward-port of that. And I'll fix that tomorrow.
Closes rspec#1532. Refactor the template rendering overrides in controller specs to be more compatible with the Action View public api. Previously `EmptyTemplatePathSetDecorator` overrode the `find_all` method to wrap a path set. However `ActionView::PathSet` is not public api so instead create a subclass of `ActionView::FileSystemResolver` to return an empty template and treat `view_paths` as an array of string-like objects.
b498a38
to
80637fc
Compare
Fix empty template rendering for Rails 4.2.5.1
Thank you @pixeltrix @samphippen @fcheung etc. for fixing this issue. Much appreciated. |
Closes #1532.
Refactor the template rendering overrides in controller specs to be more compatible with the Action View public api. Previously
EmptyTemplatePathSetDecorator
overrode thefind_all
method to wrap a path set. HoweverActionView::PathSet
is not public api so instead create a subclass ofActionView::FileSystemResolver
to return an empty template and treatview_paths
as an array of string-like objects.