Skip to content

Commit 243fa87

Browse files
committed
Add failing spec
1 parent efdc7b5 commit 243fa87

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

spec/rspec/rails/fixture_support_spec.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,29 @@ module RSpec::Rails
1212
end
1313
end
1414

15+
context "with use_transactional_tests set to true" do
16+
it "works with #uses_transaction helper" do
17+
group = RSpec::Core::ExampleGroup.describe do
18+
include FixtureSupport
19+
self.use_transactional_tests = true
20+
21+
uses_transaction "doesn't run in transaction"
22+
23+
it "doesn't run in transaction" do
24+
expect(run_in_transaction?).to eq(false)
25+
end
26+
end
27+
28+
expect_to_pass(group)
29+
end
30+
31+
def expect_to_pass(group)
32+
result = group.run(failure_reporter)
33+
failure_reporter.exceptions.map { |e| raise e }
34+
expect(result).to be true
35+
end
36+
end
37+
1538
it "will allow #setup_fixture to run successfully", skip: Rails.version.to_f <= 6.0 do
1639
group = RSpec::Core::ExampleGroup.describe do
1740
include FixtureSupport

0 commit comments

Comments
 (0)