diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-05-26 11:36:01 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-05-26 11:36:01 +0300 |
commit | 0f9fbae78a51f7bf4df50d96060087e1cf903b05 (patch) | |
tree | 0563abb70a86704aa29c2ddfc5abf87de94684f4 /spec/spec_helper.rb | |
parent | f7aba153164618522232c912eb833bd7596f5f53 (diff) |
Add migrations helpers to simplify writing migration specs
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9ed705a5267..2c1c252be37 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -52,6 +52,7 @@ RSpec.configure do |config| config.include StubGitlabCalls config.include StubGitlabData config.include ApiHelpers, :api + config.include MigrationsHelpers, :migration config.infer_spec_type_from_file_location! @@ -94,9 +95,8 @@ RSpec.configure do |config| end config.around(:example, migration: true) do |example| - schema_version = example.metadata[:schema] - migrations_paths = ActiveRecord::Migrator.migrations_paths - ActiveRecord::Migrator.migrate(migrations_paths, schema_version) + ActiveRecord::Migrator + .migrate(migrations_paths, example.metadata.fetch(:schema)) example.run |