diff options
Diffstat (limited to 'spec/lib/gitlab/tracking_spec.rb')
-rw-r--r-- | spec/lib/gitlab/tracking_spec.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/lib/gitlab/tracking_spec.rb b/spec/lib/gitlab/tracking_spec.rb index a353a3a512c..f3e27c72143 100644 --- a/spec/lib/gitlab/tracking_spec.rb +++ b/spec/lib/gitlab/tracking_spec.rb @@ -267,7 +267,7 @@ RSpec.describe Gitlab::Tracking, feature_category: :application_instrumentation allow(YAML).to receive(:load_file).with(Rails.root.join('config/events/filename.yml')).and_return(test_definition) end - it 'dispatchs the data to .event' do + it 'dispatches the data to .event' do project = build_stubbed(:project) user = build_stubbed(:user) @@ -317,4 +317,18 @@ RSpec.describe Gitlab::Tracking, feature_category: :application_instrumentation expect(described_class).not_to be_snowplow_micro_enabled end end + + describe 'tracker' do + it 'returns a SnowPlowMicro instance in development' do + allow(Rails.env).to receive(:development?).and_return(true) + + expect(described_class.tracker).to be_an_instance_of(Gitlab::Tracking::Destinations::SnowplowMicro) + end + + it 'returns a SnowPlow instance when not in development' do + allow(Rails.env).to receive(:development?).and_return(false) + + expect(described_class.tracker).to be_an_instance_of(Gitlab::Tracking::Destinations::Snowplow) + end + end end |