diff options
Diffstat (limited to 'spec/lib/gitlab/tracking')
-rw-r--r-- | spec/lib/gitlab/tracking/standard_context_spec.rb | 28 |
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 |