summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/rails_helper.rb2
-rw-r--r--spec/support/legacy_record.rb9
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