diff options
| author | mokha <mokha@cisco.com> | 2018-07-13 14:38:15 -0600 |
|---|---|---|
| committer | mokha <mokha@cisco.com> | 2018-07-13 14:38:15 -0600 |
| commit | 4a0e64d361491ec2bec995572b23e3f2e6920f15 (patch) | |
| tree | 602f614170d7f35b9341633728a3f6dd5d395548 | |
| parent | 4f24b872623f1a31587eb6c2a40f5d3d4c5121d4 (diff) | |
rollback legacy db transactions.main
| -rw-r--r-- | spec/rails_helper.rb | 2 | ||||
| -rw-r--r-- | spec/support/legacy_record.rb | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index bbe1ba5..ccfd92e 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -20,7 +20,7 @@ require 'rspec/rails' # directory. Alternatively, in the individual `*_spec.rb` files, manually # require only the support files necessary. # -# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } +Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } # Checks for pending migrations and applies them before tests are run. # If you are not using ActiveRecord, you can remove this line. diff --git a/spec/support/legacy_record.rb b/spec/support/legacy_record.rb new file mode 100644 index 0000000..bdbab33 --- /dev/null +++ b/spec/support/legacy_record.rb @@ -0,0 +1,9 @@ +RSpec.configure do |config| + config.before(:each) do + LegacyRecord.connection.begin_transaction joinable: false + end + + config.after(:each) do + LegacyRecord.connection.rollback_transaction + end +end |
