Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing fixture support test on Rails main #2733

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -39,14 +39,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
Loading