Commit 85390301 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'fix-snowplow-micro-options' into 'master'

Camelize keys of Snowplow Micro options object

See merge request gitlab-org/gitlab!75003
parents f0f0cdc1 6ccd5325
...@@ -15,7 +15,7 @@ module Gitlab ...@@ -15,7 +15,7 @@ module Gitlab
protocol: uri.scheme, protocol: uri.scheme,
port: uri.port, port: uri.port,
force_secure_tracker: false force_secure_tracker: false
) ).transform_keys! { |key| key.to_s.camelize(:lower).to_sym }
end end
override :hostname override :hostname
......
...@@ -48,4 +48,24 @@ RSpec.describe Gitlab::Tracking::Destinations::SnowplowMicro do ...@@ -48,4 +48,24 @@ RSpec.describe Gitlab::Tracking::Destinations::SnowplowMicro do
end end
end end
end end
describe '#options' do
let_it_be(:group) { create :group }
before do
stub_env('SNOWPLOW_MICRO_URI', 'http://gdk.test:9091')
end
it 'includes protocol with the correct value' do
expect(subject.options(group)[:protocol]).to eq 'http'
end
it 'includes port with the correct value' do
expect(subject.options(group)[:port]).to eq 9091
end
it 'includes forceSecureTracker with value false' do
expect(subject.options(group)[:forceSecureTracker]).to eq false
end
end
end end
...@@ -63,7 +63,7 @@ RSpec.describe Gitlab::Tracking do ...@@ -63,7 +63,7 @@ RSpec.describe Gitlab::Tracking do
appId: '_abc123_', appId: '_abc123_',
protocol: 'http', protocol: 'http',
port: 9090, port: 9090,
force_secure_tracker: false, forceSecureTracker: false,
formTracking: true, formTracking: true,
linkClickTracking: true linkClickTracking: true
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment