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:
Diffstat (limited to 'spec/requests/api/graphql/mutations/snippets/update_spec.rb')
-rw-r--r--spec/requests/api/graphql/mutations/snippets/update_spec.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/requests/api/graphql/mutations/snippets/update_spec.rb b/spec/requests/api/graphql/mutations/snippets/update_spec.rb
index eb7e6f840fe..1a5d3620f22 100644
--- a/spec/requests/api/graphql/mutations/snippets/update_spec.rb
+++ b/spec/requests/api/graphql/mutations/snippets/update_spec.rb
@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe 'Updating a Snippet' do
include GraphqlHelpers
+ include SessionHelpers
let_it_be(:original_content) { 'Initial content' }
let_it_be(:original_description) { 'Initial description' }
@@ -162,7 +163,7 @@ RSpec.describe 'Updating a Snippet' do
end
end
- context 'when the author is a member of the project' do
+ context 'when the author is a member of the project', :snowplow do
before do
project.add_developer(current_user)
end
@@ -185,6 +186,20 @@ RSpec.describe 'Updating a Snippet' do
it_behaves_like 'has spam protection' do
let(:mutation_class) { ::Mutations::Snippets::Update }
end
+
+ context 'when not sessionless', :clean_gitlab_redis_sessions do
+ before do
+ stub_session('warden.user.user.key' => [[current_user.id], current_user.authenticatable_salt])
+ end
+
+ it_behaves_like 'Snowplow event tracking' do
+ let(:user) { current_user }
+ let(:namespace) { project.namespace }
+ let(:category) { 'ide_edit' }
+ let(:action) { 'g_edit_by_snippet_ide' }
+ let(:feature_flag_name) { :route_hll_to_snowplow_phase2 }
+ end
+ end
end
it_behaves_like 'when the snippet is not found'