We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8edb660 commit 4aa5e0bCopy full SHA for 4aa5e0b
lib/rspec/rails/fixture_support.rb
@@ -9,11 +9,11 @@ module FixtureSupport
9
include RSpec::Rails::MinitestAssertionAdapter
10
include ActiveRecord::TestFixtures
11
12
- if ::Rails.version.to_f >= 6.1
13
- # @private return the example name for TestFixtures
14
- def name
15
- @example
16
- end
+ # @private prevent ActiveSupport::TestFixtures to start a DB transaction.
+ # 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?(@example)
17
end
18
19
included do
0 commit comments