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/lib/gitlab/tracking/standard_context_spec.rb')
-rw-r--r--spec/lib/gitlab/tracking/standard_context_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/gitlab/tracking/standard_context_spec.rb b/spec/lib/gitlab/tracking/standard_context_spec.rb
index dacd08cf12b..289818266bd 100644
--- a/spec/lib/gitlab/tracking/standard_context_spec.rb
+++ b/spec/lib/gitlab/tracking/standard_context_spec.rb
@@ -57,6 +57,22 @@ RSpec.describe Gitlab::Tracking::StandardContext do
expect(snowplow_context.to_json.dig(:data, :source)).to eq(described_class::GITLAB_RAILS_SOURCE)
end
+ context 'plan' do
+ context 'when namespace is not available' do
+ it 'is nil' do
+ expect(snowplow_context.to_json.dig(:data, :plan)).to be_nil
+ end
+ end
+
+ context 'when namespace is available' do
+ subject { described_class.new(namespace: create(:namespace)) }
+
+ it 'contains plan name' do
+ expect(snowplow_context.to_json.dig(:data, :plan)).to eq(Plan::DEFAULT)
+ end
+ end
+ end
+
context 'with extra data' do
subject { described_class.new(extra_key_1: 'extra value 1', extra_key_2: 'extra value 2') }