diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-27 09:13:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-27 09:13:06 +0300 |
commit | 3fbe43541ef99c27a9e4ab9c545ec0eb9bb50a9e (patch) | |
tree | df71ce391f93b65a4f44fa719c8def2b9e45d40f /spec/tooling/danger | |
parent | 0e1350d51ca2135e37743dfb7af98eae43c72892 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/tooling/danger')
-rw-r--r-- | spec/tooling/danger/product_intelligence_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/tooling/danger/product_intelligence_spec.rb b/spec/tooling/danger/product_intelligence_spec.rb index c4cd0e5bfb6..bc6b9debfe0 100644 --- a/spec/tooling/danger/product_intelligence_spec.rb +++ b/spec/tooling/danger/product_intelligence_spec.rb @@ -32,10 +32,12 @@ RSpec.describe Tooling::Danger::ProductIntelligence do let(:approved_label) { 'product intelligence::approved' } let(:changed_files) { ['metrics/counts_7d/test_metric.yml'] } let(:changed_lines) { ['+tier: ee'] } + let(:fake_changes) { instance_double(Gitlab::Dangerfiles::Changes, files: changed_files) } before do + allow(fake_changes).to receive(:by_category).with(:product_intelligence).and_return(fake_changes) + allow(fake_helper).to receive(:changes).and_return(fake_changes) allow(fake_helper).to receive(:all_changed_files).and_return(changed_files) - allow(fake_helper).to receive(:changes_by_category).and_return(product_intelligence: changed_files, database: ['other_files.yml']) allow(fake_helper).to receive(:markdown_list).with(changed_files).and_return(markdown_formatted_list) end @@ -61,6 +63,15 @@ RSpec.describe Tooling::Danger::ProductIntelligence do expect(labels_to_add).to match_array [previous_label_to_add, review_pending_label] end + + it 'receives all the changed files by calling the correct helper method', :aggregate_failures do + expect(fake_helper).not_to receive(:changes_by_category) + expect(fake_helper).to receive(:changes) + expect(fake_changes).to receive(:by_category).with(:product_intelligence) + expect(fake_changes).to receive(:files) + + subject + end end context 'with growth experiment label' do |