Commit 755c2993 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'feature/add-gtm-to-groups_projects-view' into 'master'

Add GTM to /users/sign_up/groups_project/new view

See merge request gitlab-org/gitlab!80348
parents 51b396f7 fda398d4
......@@ -3,7 +3,9 @@
- page_title _('Your GitLab group')
- form_params = { trial_onboarding_flow: params[:trial_onboarding_flow], glm_source: params[:glm_source], glm_content: params[:glm_content], skip_trial: params[:skip_trial] }
- content_for :page_specific_javascripts do
= render "layouts/google_tag_manager_head"
= render "layouts/one_trust"
= render "layouts/google_tag_manager_body"
.row.gl-flex-grow-1
.gl-display-flex.gl-flex-direction-column.gl-align-items-center.gl-w-full.gl-px-5.gl-pb-5
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'registrations/groups_projects/new' do
let(:google_tag_manager_id) { 'GTM-WWKMTWS'}
let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project) }
before do
assign(:group, group)
assign(:project, project)
stub_config(extra: { google_tag_manager_id: google_tag_manager_id, google_tag_manager_nonce_id: google_tag_manager_id })
allow(view).to receive(:current_user).and_return(user)
allow(view).to receive(:import_sources_enabled?).and_return(false)
end
context 'when Google Tag Manager is enabled' do
before do
allow(view).to receive(:google_tag_manager_enabled?).and_return(true)
render
end
subject { rendered }
it 'contains a Google Tag Manager tag' do
is_expected.to match(/www.googletagmanager.com/)
end
end
context 'when Google Tag Manager is disabled' do
before do
allow(view).to receive(:google_tag_manager_enabled?).and_return(false)
render
end
subject { rendered }
it 'does not contain a Google Tag Manager tag' do
is_expected.not_to match(/www.googletagmanager.com/)
end
end
end
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