Commit b24f5b61 authored by Thong Kuah's avatar Thong Kuah

Proper fix for order-dependent migration spec failure

It turned out that we have hooks for :migration specs to re-up the
migrations after the specs have run. It's just that in this case, the
schema: was set in-correctly so this migration was not downed in the
before hook.

Because this migration was not downed, that means the migration will not
be upped in the after hook. So we fix the schema: to a version number
slightly before this migration
parent 41994327
......@@ -3,7 +3,7 @@
require 'spec_helper'
require_migration!('replace_unique_index_on_cycle_analytics_stages')
RSpec.describe ReplaceUniqueIndexOnCycleAnalyticsStages, :migration, schema: 20200728080250 do
RSpec.describe ReplaceUniqueIndexOnCycleAnalyticsStages, :migration, schema: 20200727142337 do
let(:namespaces) { table(:namespaces) }
let(:group_value_streams) { table(:analytics_cycle_analytics_group_value_streams) }
let(:group_stages) { table(:analytics_cycle_analytics_group_stages) }
......@@ -29,10 +29,6 @@ RSpec.describe ReplaceUniqueIndexOnCycleAnalyticsStages, :migration, schema: 202
stage_record
end
after do
described_class.new.up
end
it 'removes duplicated stage records' do
subject
......
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