diff options
Diffstat (limited to 'spec/support/shared_examples/controllers/trackable_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/controllers/trackable_shared_examples.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/support/shared_examples/controllers/trackable_shared_examples.rb b/spec/support/shared_examples/controllers/trackable_shared_examples.rb index e82c27c43f5..dac7d8c94ff 100644 --- a/spec/support/shared_examples/controllers/trackable_shared_examples.rb +++ b/spec/support/shared_examples/controllers/trackable_shared_examples.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true RSpec.shared_examples 'a Trackable Controller' do - describe '#track_event' do + describe '#track_event', :snowplow do before do sign_in user end @@ -14,9 +14,10 @@ RSpec.shared_examples 'a Trackable Controller' do end end - it 'tracks the action name' do - expect(Gitlab::Tracking).to receive(:event).with('AnonymousController', 'index', {}) + it 'tracks the action name', :snowplow do get :index + + expect_snowplow_event(category: 'AnonymousController', action: 'index') end end @@ -29,8 +30,9 @@ RSpec.shared_examples 'a Trackable Controller' do end it 'tracks with the specified param' do - expect(Gitlab::Tracking).to receive(:event).with('SomeCategory', 'some_event', label: 'errorlabel') get :index + + expect_snowplow_event(category: 'SomeCategory', action: 'some_event', label: 'errorlabel') end end end |