diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-22 21:10:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-22 21:10:33 +0300 |
commit | a9a2f9257eae40935e03ca4185d5263bcb7ba45f (patch) | |
tree | f12875873819442e10ab04bd15fd975bf4bb7b64 /spec/support/shared_examples/requests/api/graphql/mutations/snippets_shared_examples.rb | |
parent | 917d93d86da4dffd96abcfcf3aa83b0d6fa45286 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/shared_examples/requests/api/graphql/mutations/snippets_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/requests/api/graphql/mutations/snippets_shared_examples.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/support/shared_examples/requests/api/graphql/mutations/snippets_shared_examples.rb b/spec/support/shared_examples/requests/api/graphql/mutations/snippets_shared_examples.rb index 53329c5caec..8ed3464b009 100644 --- a/spec/support/shared_examples/requests/api/graphql/mutations/snippets_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/graphql/mutations/snippets_shared_examples.rb @@ -14,7 +14,7 @@ RSpec.shared_examples 'snippet edit usage data counters' do context 'when user is sessionless' do it 'does not track usage data actions' do - expect(::Gitlab::UsageDataCounters::EditorUniqueCounter).not_to receive(:track_snippet_editor_edit_action) + expect(::Gitlab::InternalEvents).not_to receive(:track_event) post_graphql_mutation(mutation, current_user: current_user) end @@ -25,17 +25,19 @@ RSpec.shared_examples 'snippet edit usage data counters' do stub_session('warden.user.user.key' => [[current_user.id], current_user.authenticatable_salt]) end - it 'tracks usage data actions', :clean_gitlab_redis_sessions do - expect(::Gitlab::UsageDataCounters::EditorUniqueCounter).to receive(:track_snippet_editor_edit_action) - + subject do post_graphql_mutation(mutation) end + it_behaves_like 'internal event tracking' do + let(:event) { 'g_edit_by_snippet_ide' } + end + context 'when mutation result raises an error' do it 'does not track usage data actions' do mutation_vars[:title] = nil - expect(::Gitlab::UsageDataCounters::EditorUniqueCounter).not_to receive(:track_snippet_editor_edit_action) + expect(::Gitlab::InternalEvents).not_to receive(:track_event) post_graphql_mutation(mutation) end |