Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle ActionView::PathSet immutability and strict type casting in Rails 7.1 #2631

Merged
merged 2 commits into from Oct 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 11 additions & 3 deletions lib/rspec/rails/view_rendering.rb
Expand Up @@ -71,7 +71,15 @@ def self.template_format(template)
# templates with modified source
#
# @private
class ResolverDecorator
class ResolverDecorator < ::ActionView::Resolver
(::ActionView::Resolver.instance_methods - Object.instance_methods).each do |method|
undef_method method
end

(::ActionView::Resolver.methods - Object.methods).each do |method|
singleton_class.undef_method method
end

def initialize(resolver)
@resolver = resolver
end
Expand Down Expand Up @@ -119,11 +127,11 @@ def self.call(_template, _source = nil)
# @private
module EmptyTemplates
def prepend_view_path(new_path)
lookup_context.view_paths.unshift(*_path_decorator(*new_path))
super(_path_decorator(*new_path))
end

def append_view_path(new_path)
lookup_context.view_paths.push(*_path_decorator(*new_path))
super(_path_decorator(*new_path))
end

private
Expand Down