Skip to content

Check if path is a Resolver before decorating it #1551

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions lib/rspec/rails/view_rendering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def render_views?
self.class.render_views? || !controller.class.respond_to?(:view_paths)
end

# Delegates find_all to the submitted path set and then returns templates
# with modified source
# Delegates find_templates to the submitted path set and then returns
# templates with modified source
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope it’s ok that I fixed the documentation here, too?

#
# @private
class EmptyTemplateResolver < ::ActionView::FileSystemResolver
Expand Down Expand Up @@ -81,7 +81,12 @@ def append_view_path(new_path)
private

def _path_decorator(path)
EmptyTemplateResolver.new(path)
case path
when Pathname, String
EmptyTemplateResolver.new(path.to_s)
else
path
end
end
end

Expand Down