diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /spec/services/notes/destroy_service_spec.rb | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'spec/services/notes/destroy_service_spec.rb')
-rw-r--r-- | spec/services/notes/destroy_service_spec.rb | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/spec/services/notes/destroy_service_spec.rb b/spec/services/notes/destroy_service_spec.rb index 55acdabef82..be95a4bb181 100644 --- a/spec/services/notes/destroy_service_spec.rb +++ b/spec/services/notes/destroy_service_spec.rb @@ -25,15 +25,25 @@ RSpec.describe Notes::DestroyService do .to change { user.todos_pending_count }.from(1).to(0) end - it 'tracks issue comment removal usage data', :clean_gitlab_redis_shared_state do - note = create(:note, project: project, noteable: issue) - event = Gitlab::UsageDataCounters::IssueActivityUniqueCounter::ISSUE_COMMENT_REMOVED - counter = Gitlab::UsageDataCounters::HLLRedisCounter + describe 'comment removed event tracking', :snowplow do + let(:property) { Gitlab::UsageDataCounters::IssueActivityUniqueCounter::ISSUE_COMMENT_REMOVED } + let(:note) { create(:note, project: project, noteable: issue) } + let(:service_action) { described_class.new(project, user).execute(note) } + + it 'tracks issue comment removal usage data', :clean_gitlab_redis_shared_state do + counter = Gitlab::UsageDataCounters::HLLRedisCounter + + expect(Gitlab::UsageDataCounters::IssueActivityUniqueCounter).to receive(:track_issue_comment_removed_action) + .with(author: user, project: project) + .and_call_original + expect do + service_action + end.to change { counter.unique_events(event_names: property, start_date: 1.day.ago, end_date: 1.day.from_now) }.by(1) + end - expect(Gitlab::UsageDataCounters::IssueActivityUniqueCounter).to receive(:track_issue_comment_removed_action).with(author: user).and_call_original - expect do - described_class.new(project, user).execute(note) - end.to change { counter.unique_events(event_names: event, start_date: 1.day.ago, end_date: 1.day.from_now) }.by(1) + it_behaves_like 'issue_edit snowplow tracking' do + subject(:execute_service_action) { service_action } + end end it 'tracks merge request usage data' do |