diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 19:00:14 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 19:00:14 +0000 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /spec/migrations/remove_records_without_group_from_webhooks_table_spec.rb | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) | |
download | gitlab-ce-05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2.tar.gz |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'spec/migrations/remove_records_without_group_from_webhooks_table_spec.rb')
-rw-r--r-- | spec/migrations/remove_records_without_group_from_webhooks_table_spec.rb | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/spec/migrations/remove_records_without_group_from_webhooks_table_spec.rb b/spec/migrations/remove_records_without_group_from_webhooks_table_spec.rb deleted file mode 100644 index eabf6271ded..00000000000 --- a/spec/migrations/remove_records_without_group_from_webhooks_table_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -require_migration! -require_migration!('add_not_valid_foreign_key_to_group_hooks') - -RSpec.describe RemoveRecordsWithoutGroupFromWebhooksTable, schema: 20210330091751, feature_category: :integrations do - let(:web_hooks) { table(:web_hooks) } - let(:groups) { table(:namespaces) } - - before do - group = groups.create!(name: 'gitlab', path: 'gitlab-org') - web_hooks.create!(group_id: group.id, type: 'GroupHook') - web_hooks.create!(group_id: nil) - - AddNotValidForeignKeyToGroupHooks.new.down - web_hooks.create!(group_id: non_existing_record_id, type: 'GroupHook') - AddNotValidForeignKeyToGroupHooks.new.up - end - - it 'removes group hooks where the referenced group does not exist', :aggregate_failures do - expect { RemoveRecordsWithoutGroupFromWebhooksTable.new.up }.to change { web_hooks.count }.by(-1) - expect(web_hooks.where.not(group_id: groups.select(:id)).count).to eq(0) - expect(web_hooks.where.not(group_id: nil).count).to eq(1) - end -end |