Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-10 15:08:59 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-10 15:08:59 +0300
commit7351a484d79236b7e9d47c86f2fcc970b7ae10b0 (patch)
tree651b5fca7ea0460e3ce7c687cfa9e3a3b37eefc8 /spec/lib/gitlab/background_migration
parentb4ded0ba7b4d2cdbed5b1f331cf2083a25ee4d7c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/background_migration')
-rw-r--r--spec/lib/gitlab/background_migration/backfill_project_settings_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/lib/gitlab/background_migration/backfill_project_settings_spec.rb b/spec/lib/gitlab/background_migration/backfill_project_settings_spec.rb
new file mode 100644
index 00000000000..718109bb720
--- /dev/null
+++ b/spec/lib/gitlab/background_migration/backfill_project_settings_spec.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe Gitlab::BackgroundMigration::BackfillProjectSettings, :migration, schema: 20200114113341 do
+ let(:projects) { table(:projects) }
+ let(:project_settings) { table(:project_settings) }
+ let(:namespace) { table(:namespaces).create(name: 'user', path: 'user') }
+ let(:project) { projects.create(namespace_id: namespace.id) }
+
+ subject { described_class.new }
+
+ describe '#perform' do
+ it 'creates settings for all projects in range' do
+ projects.create(id: 5, namespace_id: namespace.id)
+ projects.create(id: 7, namespace_id: namespace.id)
+ projects.create(id: 8, namespace_id: namespace.id)
+
+ subject.perform(5, 7)
+
+ expect(project_settings.all.pluck(:project_id)).to contain_exactly(5, 7)
+ end
+ end
+end