diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-01 12:08:56 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-01 12:08:56 +0000 |
commit | 50d66f5ece57dcfbe074d97703691a8d3c38f4ac (patch) | |
tree | c96aa5ffd1cb73c18e53356680cb9792d24c257b /spec/lib/gitlab/tracking | |
parent | cfec4ed6fe77e4150b1ea83b87f407aa0cca944c (diff) | |
download | gitlab-ce-50d66f5ece57dcfbe074d97703691a8d3c38f4ac.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.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/spec/lib/gitlab/tracking/standard_context_spec.rb b/spec/lib/gitlab/tracking/standard_context_spec.rb index 561edbd38f8..dacd08cf12b 100644 --- a/spec/lib/gitlab/tracking/standard_context_spec.rb +++ b/spec/lib/gitlab/tracking/standard_context_spec.rb @@ -58,10 +58,16 @@ RSpec.describe Gitlab::Tracking::StandardContext do end context 'with extra data' do - subject { described_class.new(foo: 'bar') } + subject { described_class.new(extra_key_1: 'extra value 1', extra_key_2: 'extra value 2') } - it 'creates a Snowplow context with the given data' do - expect(snowplow_context.to_json.dig(:data, :foo)).to eq('bar') + it 'includes extra data in `extra` hash' do + expect(snowplow_context.to_json.dig(:data, :extra)).to eq(extra_key_1: 'extra value 1', extra_key_2: 'extra value 2') + end + end + + context 'without extra data' do + it 'contains an empty `extra` hash' do + expect(snowplow_context.to_json.dig(:data, :extra)).to be_empty end end |