diff options
author | Rubén Dávila <ruben@gitlab.com> | 2018-10-17 23:47:18 +0300 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2018-11-28 01:23:14 +0300 |
commit | 55f6eadc1d75c7c6d2c3413d43feea36f198dfcb (patch) | |
tree | f5348d004f312d20b028665ec0042177678260ac /spec/migrations | |
parent | eceb873c7e4beb353634504d9f77b777db9f4ffd (diff) |
Backport from gitlab-org/gitlab-ee!6878
Diffstat (limited to 'spec/migrations')
-rw-r--r-- | spec/migrations/delete_inconsistent_internal_id_records_spec.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/spec/migrations/delete_inconsistent_internal_id_records_spec.rb b/spec/migrations/delete_inconsistent_internal_id_records_spec.rb index 4af51217031..8c55daf0d37 100644 --- a/spec/migrations/delete_inconsistent_internal_id_records_spec.rb +++ b/spec/migrations/delete_inconsistent_internal_id_records_spec.rb @@ -94,17 +94,18 @@ describe DeleteInconsistentInternalIdRecords, :migration do end context 'for milestones (by group)' do - # milestones (by group) is a little different than all of the other models - let!(:group1) { create(:group) } - let!(:group2) { create(:group) } - let!(:group3) { create(:group) } + # milestones (by group) is a little different than most of the other models + let(:groups) { table(:namespaces) } + let(:group1) { groups.create(name: 'Group 1', type: 'Group', path: 'group_1') } + let(:group2) { groups.create(name: 'Group 2', type: 'Group', path: 'group_2') } + let(:group3) { groups.create(name: 'Group 2', type: 'Group', path: 'group_3') } let(:internal_id_query) { ->(group) { InternalId.where(usage: InternalId.usages['milestones'], namespace: group) } } before do - 3.times { create(:milestone, group: group1) } - 3.times { create(:milestone, group: group2) } - 3.times { create(:milestone, group: group3) } + 3.times { create(:milestone, group_id: group1.id) } + 3.times { create(:milestone, group_id: group2.id) } + 3.times { create(:milestone, group_id: group3.id) } internal_id_query.call(group1).first.tap do |iid| iid.last_value = iid.last_value - 2 |