diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /spec/lib/gitlab/background_migration/migrate_pages_metadata_spec.rb | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'spec/lib/gitlab/background_migration/migrate_pages_metadata_spec.rb')
-rw-r--r-- | spec/lib/gitlab/background_migration/migrate_pages_metadata_spec.rb | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/spec/lib/gitlab/background_migration/migrate_pages_metadata_spec.rb b/spec/lib/gitlab/background_migration/migrate_pages_metadata_spec.rb index 906a6a747c9..815dc2e73e5 100644 --- a/spec/lib/gitlab/background_migration/migrate_pages_metadata_spec.rb +++ b/spec/lib/gitlab/background_migration/migrate_pages_metadata_spec.rb @@ -7,7 +7,7 @@ RSpec.describe Gitlab::BackgroundMigration::MigratePagesMetadata, schema: 201909 subject(:migrate_pages_metadata) { described_class.new } - describe '#perform_on_relation' do + describe '#perform' do let(:namespaces) { table(:namespaces) } let(:builds) { table(:ci_builds) } let(:pages_metadata) { table(:project_pages_metadata) } @@ -23,9 +23,9 @@ RSpec.describe Gitlab::BackgroundMigration::MigratePagesMetadata, schema: 201909 not_migrated_no_pages = projects.create!(namespace_id: namespace.id, name: 'Not Migrated No Pages') project_not_in_relation_scope = projects.create!(namespace_id: namespace.id, name: 'Other') - projects_relation = projects.where(id: [not_migrated_with_pages, not_migrated_no_pages, migrated]) + ids = [not_migrated_no_pages.id, not_migrated_with_pages.id, migrated.id] - migrate_pages_metadata.perform_on_relation(projects_relation) + migrate_pages_metadata.perform(ids.min, ids.max) expect(pages_metadata.find_by_project_id(not_migrated_with_pages.id).deployed).to eq(true) expect(pages_metadata.find_by_project_id(not_migrated_no_pages.id).deployed).to eq(false) @@ -33,12 +33,4 @@ RSpec.describe Gitlab::BackgroundMigration::MigratePagesMetadata, schema: 201909 expect(pages_metadata.find_by_project_id(project_not_in_relation_scope.id)).to be_nil end end - - describe '#perform' do - it 'creates relation and delegates to #perform_on_relation' do - expect(migrate_pages_metadata).to receive(:perform_on_relation).with(projects.where(id: 3..5)) - - migrate_pages_metadata.perform(3, 5) - end - end end |