Commit ff61e2b7 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Reorder pipeline stages-related migrations

parent 23c93490
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170526190708) do ActiveRecord::Schema.define(version: 20170526190948) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
......
require 'spec_helper' require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20170526101042_migrate_pipeline_stages.rb') require Rails.root.join('db', 'post_migrate', '20170526185842_migrate_pipeline_stages.rb')
describe MigratePipelineStages, :migration, schema: 20170525132202 do describe MigratePipelineStages, :migration, schema: 20170526185602 do
## ##
# Create test data - pipeline and CI/CD jobs. # Create test data - pipeline and CI/CD jobs.
# #
......
...@@ -95,13 +95,15 @@ RSpec.configure do |config| ...@@ -95,13 +95,15 @@ RSpec.configure do |config|
end end
config.around(:example, migration: true) do |example| config.around(:example, migration: true) do |example|
begin
schema_version = example.metadata.fetch(:schema) schema_version = example.metadata.fetch(:schema)
ActiveRecord::Migrator.migrate(migrations_paths, schema_version) ActiveRecord::Migrator.migrate(migrations_paths, schema_version)
example.run example.run
ensure
ActiveRecord::Migrator.migrate(migrations_paths) ActiveRecord::Migrator.migrate(migrations_paths)
end end
end
end end
FactoryGirl::SyntaxRunner.class_eval do FactoryGirl::SyntaxRunner.class_eval do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment