From 7c847fc9676cc207c68599e4dcbda42f3a6e5295 Mon Sep 17 00:00:00 2001 From: Jonathan Rochkind Date: Tue, 21 Nov 2023 10:38:57 -0500 Subject: [PATCH] use rspec-rails 6.1 for official Rails 7.1 support, no need for our local patch anymore --- blacklight.gemspec | 2 +- spec/spec_helper.rb | 28 ---------------------------- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/blacklight.gemspec b/blacklight.gemspec index 0b12b5ba6f..80b2e30d09 100644 --- a/blacklight.gemspec +++ b/blacklight.gemspec @@ -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' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5ca96f9afe..ba566119b0 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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