diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 22:10:04 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 22:10:04 +0000 |
commit | 8bdbf220176b3c4df35dbf01da3dc8b2d507f351 (patch) | |
tree | aaabfc8906f31a1f62d1b5adbcf65dad5cd13aa0 /spec | |
parent | 81bf49d9ea87a9dae5f0fd46a2bde8243459a7b1 (diff) | |
download | gitlab-ce-8bdbf220176b3c4df35dbf01da3dc8b2d507f351.tar.gz |
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'spec')
-rw-r--r-- | spec/migrations/schedule_backfill_push_rules_id_in_projects_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/migrations/schedule_backfill_push_rules_id_in_projects_spec.rb b/spec/migrations/schedule_backfill_push_rules_id_in_projects_spec.rb index 77648f5c64a..77721eab77d 100644 --- a/spec/migrations/schedule_backfill_push_rules_id_in_projects_spec.rb +++ b/spec/migrations/schedule_backfill_push_rules_id_in_projects_spec.rb @@ -20,6 +20,20 @@ describe ScheduleBackfillPushRulesIdInProjects do expect(setting.push_rule_id).to eq(sample_rule.id) end + it 'adds global rule association to last application settings when there is more than one record without failing' do + application_settings = table(:application_settings) + setting_old = application_settings.create! + setting = application_settings.create! + sample_rule = push_rules.create!(is_sample: true) + + Sidekiq::Testing.fake! do + disable_migrations_output { migrate! } + end + + expect(setting_old.reload.push_rule_id).to be_nil + expect(setting.reload.push_rule_id).to eq(sample_rule.id) + end + it 'schedules worker to migrate project push rules' do rule_1 = push_rules.create! rule_2 = push_rules.create! |