summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/tracking
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-07 15:08:12 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-07 15:08:12 +0000
commit7bbc731c75d0b8bf7c74ba77d521266d2ed0a1fc (patch)
tree4cab2383639b839613ffc4ef457e2a594f61aaa3 /spec/lib/gitlab/tracking
parentedb317e9fe43c62229805fae529c550467ee5dc5 (diff)
downloadgitlab-ce-7bbc731c75d0b8bf7c74ba77d521266d2ed0a1fc.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/tracking')
-rw-r--r--spec/lib/gitlab/tracking/standard_context_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/lib/gitlab/tracking/standard_context_spec.rb b/spec/lib/gitlab/tracking/standard_context_spec.rb
index c88b0af30f6..508b33949a8 100644
--- a/spec/lib/gitlab/tracking/standard_context_spec.rb
+++ b/spec/lib/gitlab/tracking/standard_context_spec.rb
@@ -92,6 +92,34 @@ RSpec.describe Gitlab::Tracking::StandardContext do
end
end
+ context 'with incorrect argument type' do
+ context 'when standard_context_type_check FF is disabled' do
+ before do
+ stub_feature_flags(standard_context_type_check: false)
+ end
+
+ subject { described_class.new(project: create(:group)) }
+
+ it 'does not call `track_and_raise_for_dev_exception`' do
+ expect(Gitlab::ErrorTracking).not_to receive(:track_and_raise_for_dev_exception)
+ snowplow_context
+ end
+ end
+
+ context 'when standard_context_type_check FF is enabled' do
+ before do
+ stub_feature_flags(standard_context_type_check: true)
+ end
+
+ subject { described_class.new(project: create(:group)) }
+
+ it 'does call `track_and_raise_for_dev_exception`' do
+ expect(Gitlab::ErrorTracking).to receive(:track_and_raise_for_dev_exception)
+ snowplow_context
+ end
+ end
+ end
+
it 'contains user id' do
expect(snowplow_context.to_json[:data].keys).to include(:user_id)
end