diff --git a/lib/rspec/rails/fixture_support.rb b/lib/rspec/rails/fixture_support.rb index 12acfdfbd..22bc4c825 100644 --- a/lib/rspec/rails/fixture_support.rb +++ b/lib/rspec/rails/fixture_support.rb @@ -13,7 +13,11 @@ module FixtureSupport # Monkey patched to avoid collisions with 'let(:name)' in Rails 6.1 and after # and let(:method_name) before Rails 6.1. def run_in_transaction? - use_transactional_tests && !self.class.uses_transaction?(self) + if ::Rails::VERSION::STRING > '5' + use_transactional_tests && !self.class.uses_transaction?(self) + else + use_transactional_fixtures && !self.class.uses_transaction?(self) + end end included do