Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-05-26 11:36:01 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-05-26 11:36:01 +0300
commit0f9fbae78a51f7bf4df50d96060087e1cf903b05 (patch)
tree0563abb70a86704aa29c2ddfc5abf87de94684f4 /spec/spec_helper.rb
parentf7aba153164618522232c912eb833bd7596f5f53 (diff)
Add migrations helpers to simplify writing migration specs
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 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