diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-23 00:06:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-23 00:06:42 +0300 |
commit | d5e0416021aa6de53b89f9d415f368226d9326e5 (patch) | |
tree | 9a3e3bd6d1aac10cfde7f0079f784a489491a48b /spec/views | |
parent | 24fe7aa2aa199b2aace0cfec26d744f51d7e2167 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views')
-rw-r--r-- | spec/views/layouts/_head.html.haml_spec.rb | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/spec/views/layouts/_head.html.haml_spec.rb b/spec/views/layouts/_head.html.haml_spec.rb index e9b3334fffc..41e685f185a 100644 --- a/spec/views/layouts/_head.html.haml_spec.rb +++ b/spec/views/layouts/_head.html.haml_spec.rb @@ -84,7 +84,7 @@ describe 'layouts/_head' do allow(Gitlab::CurrentSettings).to receive(:snowplow_collector_hostname).and_return('www.snow.plow') end - it 'add a snowplow script tag with asset host' do + it 'adds a snowplow script tag with asset host' do render expect(rendered).to match('http://test.host/assets/snowplow/') expect(rendered).to match('window.snowplow') @@ -92,6 +92,28 @@ describe 'layouts/_head' do end end + context 'when pendo is enabled' do + it 'adds a pendo initialization snippet with url', :aggregate_failures do + allow(Gitlab::CurrentSettings).to receive(:pendo_enabled?).and_return(true) + allow(Gitlab::CurrentSettings).to receive(:pendo_url).and_return('www.pen.do') + + render + + expect(rendered).to match('pendo.initialize') + expect(rendered).to match('www.pen.do') + end + end + + context 'when pendo is not enabled' do + it 'do not add pendo snippet' do + allow(Gitlab::CurrentSettings).to receive(:pendo_enabled?).and_return(false) + + render + + expect(rendered).not_to match('pendo.initialize') + end + end + context 'when a Piwik config is set' do let(:piwik_host) { 'piwik.example.com' } |