diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-04 18:20:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-04 18:20:28 +0300 |
commit | 7de116050af7a190085c01bbf819e48e708e8eb2 (patch) | |
tree | 5b4e18ac4c1bc801f530324c99676f5d286aadfa /spec/support | |
parent | ac72b79188a14a28eafe55d32641f9939cf5d9c4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/shared_examples/migrations/add_work_item_widget_shared_examples.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/support/shared_examples/migrations/add_work_item_widget_shared_examples.rb b/spec/support/shared_examples/migrations/add_work_item_widget_shared_examples.rb index 37c338a7712..aa5c7ffe7be 100644 --- a/spec/support/shared_examples/migrations/add_work_item_widget_shared_examples.rb +++ b/spec/support/shared_examples/migrations/add_work_item_widget_shared_examples.rb @@ -3,7 +3,7 @@ RSpec.shared_examples 'migration that adds widget to work items definitions' do |widget_name:| let(:migration) { described_class.new } let(:work_item_definitions) { table(:work_item_widget_definitions) } - let(:work_item_type_count) { 7 } + let(:work_item_type_count) { described_class::WORK_ITEM_TYPES.size } describe '#up' do it "creates widget definition in all types" do @@ -14,11 +14,13 @@ RSpec.shared_examples 'migration that adds widget to work items definitions' do end it 'logs a warning if the type is missing' do + type_name = described_class::WORK_ITEM_TYPES.first + allow(described_class::WorkItemType).to receive(:find_by_name_and_namespace_id).and_call_original allow(described_class::WorkItemType).to receive(:find_by_name_and_namespace_id) - .with('Issue', nil).and_return(nil) + .with(type_name, nil).and_return(nil) - expect(Gitlab::AppLogger).to receive(:warn).with('type Issue is missing, not adding widget') + expect(Gitlab::AppLogger).to receive(:warn).with("type #{type_name} is missing, not adding widget") migrate! end end |