diff options
author | Andreas Brandl <abrandl@gitlab.com> | 2019-07-12 13:30:42 +0000 |
---|---|---|
committer | Andreas Brandl <abrandl@gitlab.com> | 2019-07-12 13:30:42 +0000 |
commit | e13f07f1954f9f4d1cffed0f4c6d63c8ee7aa2a6 (patch) | |
tree | 147f8c4911f5efa9a4157103aa394f0a4bca4e4d /spec/spec_helper.rb | |
parent | 5ea899d34f6332733bb5aee225c5f3ced340cb24 (diff) | |
parent | d4a919679a1eb5d3e2aaed4b920e6027d2482971 (diff) | |
download | gitlab-ce-e13f07f1954f9f4d1cffed0f4c6d63c8ee7aa2a6.tar.gz |
Merge branch 'js-specs-transactions' into 'master'
Use transactions in JS feature specs
Closes #60207
See merge request gitlab-org/gitlab-ce!27496
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 21c36001a1b..95e0d8858b9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -47,7 +47,7 @@ Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } quality_level = Quality::TestLevel.new RSpec.configure do |config| - config.use_transactional_fixtures = false + config.use_transactional_fixtures = true config.use_instantiated_fixtures = false config.fixture_path = Rails.root @@ -290,6 +290,16 @@ RSpec.configure do |config| config.before(:each, :https_pages_disabled) do |_| allow(Gitlab.config.pages).to receive(:external_https).and_return(false) end + + # We can't use an `around` hook here because the wrapping transaction + # is not yet opened at the time that is triggered + config.prepend_before do + Gitlab::Database.set_open_transactions_baseline + end + + config.append_after do + Gitlab::Database.reset_open_transactions_baseline + end end # add simpler way to match asset paths containing digest strings |