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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use rspec-rails 6.1 for official Rails 7.1 support, no need for our local patch anymore #3109

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion blacklight.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Gem::Specification.new do |s|
s.add_dependency "view_component", '>= 2.66', '< 4'

s.add_development_dependency "rsolr", ">= 1.0.6", "< 3" # Library for interacting with rSolr.
s.add_development_dependency "rspec-rails", "~> 6.0"
s.add_development_dependency "rspec-rails", "~> 6.1"
s.add_development_dependency "rspec-collection_matchers", ">= 1.0"
s.add_development_dependency 'axe-core-rspec'
s.add_development_dependency "capybara", '~> 3'
Expand Down
28 changes: 0 additions & 28 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,31 +118,3 @@
# as the one that triggered the failure.
Kernel.srand config.seed
end

# RSpec's stub_template method needs a differnet implementation for Rails 7.1, that
# isn't yet in an rspec-rails release.
#
# First rspec-rails tried this:
# https://github.com/rspec/rspec-rails/commit/4d65bea0619955acb15023b9c3f57a3a53183da8
#
# But it was subject to this problem:
# https://github.com/rspec/rspec-rails/issues/2696
#
# Below implementation appears to work for our purposes here, so we will patch it in
# if we are on Rails 7.1+, and not yet rspec-rails 6.1 which we expect to have it.

if ::Rails.version.to_f >= 7.1 && Gem.loaded_specs["rspec-rails"].version.release < Gem::Version.new('6.1')

module RSpec
module Rails
module ViewExampleGroup
module ExampleMethods
def stub_template(hash)
controller.prepend_view_path(StubResolverCache.resolver_for(hash))
end
end
end
end
end

end