Skip to content

Commit

Permalink
Fix support for Rails 4.2
Browse files Browse the repository at this point in the history
Rails 4.2 does not have `use_transactional_tests` defined

Fix rspec#2477
  • Loading branch information
tagliala committed Mar 10, 2021
1 parent c100cf1 commit b044d95
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/rspec/rails/fixture_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b044d95

Please sign in to comment.