diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /spec/services/design_management/delete_designs_service_spec.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/services/design_management/delete_designs_service_spec.rb')
-rw-r--r-- | spec/services/design_management/delete_designs_service_spec.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/services/design_management/delete_designs_service_spec.rb b/spec/services/design_management/delete_designs_service_spec.rb index ace63b6e59c..ed161b4c8ff 100644 --- a/spec/services/design_management/delete_designs_service_spec.rb +++ b/spec/services/design_management/delete_designs_service_spec.rb @@ -80,6 +80,16 @@ RSpec.describe DesignManagement::DeleteDesignsService do expect { run_service rescue nil } .not_to change { [counter.totals, Event.count] } end + + it 'does not log any UsageData metrics' do + redis_hll = ::Gitlab::UsageDataCounters::HLLRedisCounter + event = Gitlab::UsageDataCounters::IssueActivityUniqueCounter::ISSUE_DESIGNS_REMOVED + + expect { run_service rescue nil } + .not_to change { redis_hll.unique_events(event_names: event, start_date: 1.day.ago, end_date: 1.day.from_now) } + + run_service rescue nil + end end context 'one design is passed' do @@ -98,6 +108,12 @@ RSpec.describe DesignManagement::DeleteDesignsService do expect { run_service }.to change { counter.read(:delete) }.by(1) end + it 'updates UsageData for removed designs' do + expect(Gitlab::UsageDataCounters::IssueActivityUniqueCounter).to receive(:track_issue_designs_removed_action).with(author: user) + + run_service + end + it 'creates an event in the activity stream' do expect { run_service } .to change { Event.count }.by(1) @@ -105,7 +121,7 @@ RSpec.describe DesignManagement::DeleteDesignsService do end it 'informs the new-version-worker' do - expect(::DesignManagement::NewVersionWorker).to receive(:perform_async).with(Integer) + expect(::DesignManagement::NewVersionWorker).to receive(:perform_async).with(Integer, false) run_service end |