Skip to content

Commit

Permalink
Merge pull request #2733 from eugeneius/setup_fixtures
Browse files Browse the repository at this point in the history
Fix failing fixture support test on Rails main
  • Loading branch information
JonRowe committed Feb 23, 2024
1 parent 453e948 commit 38aef20
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions spec/rspec/rails/fixture_support_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,21 @@ module RSpec::Rails
end
end

it "will allow #setup_fixture to run successfully" do
group = RSpec::Core::ExampleGroup.describe do
include FixtureSupport
context "with use_transactional_tests set to false" do
it "does not wrap the test in a transaction" do
allow(RSpec.configuration).to receive(:use_transactional_fixtures) { true }
group = RSpec::Core::ExampleGroup.describe do
include FixtureSupport

self.use_transactional_tests = false
end
self.use_transactional_tests = false

it "doesn't run in transaction" do
expect(ActiveRecord::Base.connection.transaction_open?).to eq(false)
end
end

expect { group.new.setup_fixtures }.to_not raise_error
expect_to_pass(group)
end
end

it "handles namespaced fixtures" do
Expand Down

0 comments on commit 38aef20

Please sign in to comment.