summaryrefslogtreecommitdiff
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-06-05 11:07:10 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-06-05 11:07:10 +0200
commit028423c2f51ff738d151df32254913664ac8e898 (patch)
treedf1a1e0b801d201e7ebfe64186663c7a591eb897 /spec/spec_helper.rb
parent1a438e9f710edfa50408d93a363a240bdcd532c1 (diff)
downloadgitlab-ce-028423c2f51ff738d151df32254913664ac8e898.tar.gz
Calculate previous migration version in specs support
This makes it possible to test migration on the schema this migration was written for, without a need to specify a previous schema version manually.
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 6a0e29f2edb..5cbb3dafcdf 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -94,10 +94,10 @@ RSpec.configure do |config|
Sidekiq.redis(&:flushall)
end
- config.around(:example, migration: true) do |example|
+ config.around(:example, :migration) do |example|
begin
- schema_version = example.metadata.fetch(:schema)
- ActiveRecord::Migrator.migrate(migrations_paths, schema_version)
+ ActiveRecord::Migrator
+ .migrate(migrations_paths, previous_migration.version)
example.run
ensure