diff options
Diffstat (limited to 'spec/lib/gitlab/tracking_spec.rb')
-rw-r--r-- | spec/lib/gitlab/tracking_spec.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/lib/gitlab/tracking_spec.rb b/spec/lib/gitlab/tracking_spec.rb index 805bd92fd43..8efd4d4b848 100644 --- a/spec/lib/gitlab/tracking_spec.rb +++ b/spec/lib/gitlab/tracking_spec.rb @@ -36,6 +36,11 @@ RSpec.describe Gitlab::Tracking do end describe '.event' do + before do + allow_any_instance_of(Gitlab::Tracking::Destinations::Snowplow).to receive(:event) + allow_any_instance_of(Gitlab::Tracking::Destinations::ProductAnalytics).to receive(:event) + end + it 'delegates to snowplow destination' do expect_any_instance_of(Gitlab::Tracking::Destinations::Snowplow) .to receive(:event) @@ -43,6 +48,14 @@ RSpec.describe Gitlab::Tracking do described_class.event('category', 'action', label: 'label', property: 'property', value: 1.5) end + + it 'delegates to ProductAnalytics destination' do + expect_any_instance_of(Gitlab::Tracking::Destinations::ProductAnalytics) + .to receive(:event) + .with('category', 'action', label: 'label', property: 'property', value: 1.5, context: nil) + + described_class.event('category', 'action', label: 'label', property: 'property', value: 1.5) + end end describe '.self_describing_event' do @@ -51,7 +64,7 @@ RSpec.describe Gitlab::Tracking do .to receive(:self_describing_event) .with('iglu:com.gitlab/foo/jsonschema/1-0-0', { foo: 'bar' }, context: nil) - described_class.self_describing_event('iglu:com.gitlab/foo/jsonschema/1-0-0', foo: 'bar') + described_class.self_describing_event('iglu:com.gitlab/foo/jsonschema/1-0-0', { foo: 'bar' }) end end end |