diff --git a/spec/rspec/rails/fixture_support_spec.rb b/spec/rspec/rails/fixture_support_spec.rb index 9d24b616d..236c8df28 100644 --- a/spec/rspec/rails/fixture_support_spec.rb +++ b/spec/rspec/rails/fixture_support_spec.rb @@ -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