diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/lib/gitlab/background_migration | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/lib/gitlab/background_migration')
-rw-r--r-- | spec/lib/gitlab/background_migration/merge_request_assignees_migration_progress_check_spec.rb | 8 | ||||
-rw-r--r-- | spec/lib/gitlab/background_migration/reset_merge_status_spec.rb | 24 |
2 files changed, 18 insertions, 14 deletions
diff --git a/spec/lib/gitlab/background_migration/merge_request_assignees_migration_progress_check_spec.rb b/spec/lib/gitlab/background_migration/merge_request_assignees_migration_progress_check_spec.rb index eecd290e3ca..9dd97b58014 100644 --- a/spec/lib/gitlab/background_migration/merge_request_assignees_migration_progress_check_spec.rb +++ b/spec/lib/gitlab/background_migration/merge_request_assignees_migration_progress_check_spec.rb @@ -54,6 +54,10 @@ describe Gitlab::BackgroundMigration::MergeRequestAssigneesMigrationProgressChec end context 'when there are no scheduled, or retrying or dead' do + before do + stub_feature_flags(multiple_merge_request_assignees: false) + end + it 'enables feature' do allow(Gitlab::BackgroundMigration).to receive(:exists?) .with('PopulateMergeRequestAssigneesTable') @@ -67,9 +71,9 @@ describe Gitlab::BackgroundMigration::MergeRequestAssigneesMigrationProgressChec .with('PopulateMergeRequestAssigneesTable') .and_return(false) - expect(Feature).to receive(:enable).with(:multiple_merge_request_assignees) - described_class.new.perform + + expect(Feature.enabled?(:multiple_merge_request_assignees)).to eq(true) end end diff --git a/spec/lib/gitlab/background_migration/reset_merge_status_spec.rb b/spec/lib/gitlab/background_migration/reset_merge_status_spec.rb index 40340f89448..e057aea6bb3 100644 --- a/spec/lib/gitlab/background_migration/reset_merge_status_spec.rb +++ b/spec/lib/gitlab/background_migration/reset_merge_status_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::BackgroundMigration::ResetMergeStatus, schema: 20190528180441 do +describe Gitlab::BackgroundMigration::ResetMergeStatus do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:namespace) { namespaces.create(name: 'gitlab', path: 'gitlab-org') } @@ -23,24 +23,24 @@ describe Gitlab::BackgroundMigration::ResetMergeStatus, schema: 20190528180441 d end it 'correctly updates opened mergeable MRs to unchecked' do - create_merge_request(1, state: 'opened', merge_status: 'can_be_merged') - create_merge_request(2, state: 'opened', merge_status: 'can_be_merged') - create_merge_request(3, state: 'opened', merge_status: 'can_be_merged') - create_merge_request(4, state: 'merged', merge_status: 'can_be_merged') - create_merge_request(5, state: 'opened', merge_status: 'cannot_be_merged') + create_merge_request(1, state_id: MergeRequest.available_states[:opened], merge_status: 'can_be_merged') + create_merge_request(2, state_id: MergeRequest.available_states[:opened], merge_status: 'can_be_merged') + create_merge_request(3, state_id: MergeRequest.available_states[:opened], merge_status: 'can_be_merged') + create_merge_request(4, state_id: MergeRequest.available_states[:merged], merge_status: 'can_be_merged') + create_merge_request(5, state_id: MergeRequest.available_states[:opened], merge_status: 'cannot_be_merged') subject.perform(1, 5) expected_rows = [ - { id: 1, state: 'opened', merge_status: 'unchecked' }, - { id: 2, state: 'opened', merge_status: 'unchecked' }, - { id: 3, state: 'opened', merge_status: 'unchecked' }, - { id: 4, state: 'merged', merge_status: 'can_be_merged' }, - { id: 5, state: 'opened', merge_status: 'cannot_be_merged' } + { id: 1, state_id: MergeRequest.available_states[:opened], merge_status: 'unchecked' }, + { id: 2, state_id: MergeRequest.available_states[:opened], merge_status: 'unchecked' }, + { id: 3, state_id: MergeRequest.available_states[:opened], merge_status: 'unchecked' }, + { id: 4, state_id: MergeRequest.available_states[:merged], merge_status: 'can_be_merged' }, + { id: 5, state_id: MergeRequest.available_states[:opened], merge_status: 'cannot_be_merged' } ] rows = merge_requests.order(:id).map do |row| - row.attributes.slice('id', 'state', 'merge_status').symbolize_keys + row.attributes.slice('id', 'state_id', 'merge_status').symbolize_keys end expect(rows).to eq(expected_rows) |