Skip to content

Commit

Permalink
Add failing spec
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 committed Apr 19, 2021
1 parent efdc7b5 commit 243fa87
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spec/rspec/rails/fixture_support_spec.rb
Expand Up @@ -12,6 +12,29 @@ module RSpec::Rails
end
end

context "with use_transactional_tests set to true" do
it "works with #uses_transaction helper" do
group = RSpec::Core::ExampleGroup.describe do
include FixtureSupport
self.use_transactional_tests = true

uses_transaction "doesn't run in transaction"

it "doesn't run in transaction" do
expect(run_in_transaction?).to eq(false)
end
end

expect_to_pass(group)
end

def expect_to_pass(group)
result = group.run(failure_reporter)
failure_reporter.exceptions.map { |e| raise e }
expect(result).to be true
end
end

it "will allow #setup_fixture to run successfully", skip: Rails.version.to_f <= 6.0 do
group = RSpec::Core::ExampleGroup.describe do
include FixtureSupport
Expand Down

0 comments on commit 243fa87

Please sign in to comment.