Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-08-15 06:11:57 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-08-15 06:11:57 +0300
commit1b5891ee8ce8adc6877c462ea292eaee3c4ab30b (patch)
tree6773287f5bcf34597f131c64588c285c304f1301 /spec/services/notes/destroy_service_spec.rb
parent25c9c07a16a8100809542eb209df4902f5ef427c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/notes/destroy_service_spec.rb')
-rw-r--r--spec/services/notes/destroy_service_spec.rb26
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