Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/views/devise/sessions/new.html.haml6
-rw-r--r--app/views/layouts/devise.html.haml2
-rw-r--r--spec/views/devise/registrations/new.html.haml_spec.rb30
-rw-r--r--spec/views/devise/sessions/new.html.haml_spec.rb21
-rw-r--r--spec/views/layouts/devise.html.haml_spec.rb8
5 files changed, 59 insertions, 8 deletions
diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml
index fd96d5dc1c4..d5f15a72c34 100644
--- a/app/views/devise/sessions/new.html.haml
+++ b/app/views/devise/sessions/new.html.haml
@@ -1,7 +1,13 @@
- page_title _("Sign in")
+
- content_for :page_specific_javascripts do
= render "layouts/google_tag_manager_head"
= render "layouts/one_trust"
+
+- content_for :sessions_broadcast do
+ - unless Gitlab.com?
+ = render "layouts/broadcast"
+
= render "layouts/google_tag_manager_body"
#signin-container
diff --git a/app/views/layouts/devise.html.haml b/app/views/layouts/devise.html.haml
index 94f25a9f0ae..4e9ae7c7fd8 100644
--- a/app/views/layouts/devise.html.haml
+++ b/app/views/layouts/devise.html.haml
@@ -7,6 +7,7 @@
= header_message
= render "layouts/init_client_detection_flags"
- if Feature.enabled?(:restyle_login_page, @project)
+ = yield :sessions_broadcast
.gl-h-full.borderless.gl-display-flex.gl-flex-wrap
.container
.content
@@ -36,6 +37,7 @@
= render 'devise/shared/footer'
- else
= render "layouts/header/empty"
+ = yield :sessions_broadcast
.gl-h-full.gl-display-flex.gl-flex-wrap
.container
.content
diff --git a/spec/views/devise/registrations/new.html.haml_spec.rb b/spec/views/devise/registrations/new.html.haml_spec.rb
new file mode 100644
index 00000000000..55025424573
--- /dev/null
+++ b/spec/views/devise/registrations/new.html.haml_spec.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'devise/registrations/new', feature_category: :user_management do
+ describe 'broadcast messaging' do
+ before do
+ allow(view).to receive(:devise_mapping).and_return(Devise.mappings[:user])
+ allow(view).to receive(:resource).and_return(build(:user))
+ allow(view).to receive(:resource_name).and_return(:user)
+ allow(view).to receive(:registration_path_params).and_return({})
+ allow(view).to receive(:glm_tracking_params).and_return({})
+ allow(view).to receive(:arkose_labs_enabled?).and_return(true)
+ end
+
+ it 'does not render the broadcast layout' do
+ render
+
+ expect(rendered).not_to render_template('layouts/_broadcast')
+ end
+
+ context 'when SaaS', :saas do
+ it 'does not render the broadcast layout' do
+ render
+
+ expect(rendered).not_to render_template('layouts/_broadcast')
+ end
+ end
+ end
+end
diff --git a/spec/views/devise/sessions/new.html.haml_spec.rb b/spec/views/devise/sessions/new.html.haml_spec.rb
index 70ca0bb2195..adfe68824c5 100644
--- a/spec/views/devise/sessions/new.html.haml_spec.rb
+++ b/spec/views/devise/sessions/new.html.haml_spec.rb
@@ -102,6 +102,27 @@ RSpec.describe 'devise/sessions/new' do
end
end
+ describe 'broadcast messaging' do
+ before do
+ stub_devise
+ disable_captcha
+ end
+
+ it 'renders the broadcast layout' do
+ render
+
+ expect(rendered).to render_template('layouts/_broadcast')
+ end
+
+ context 'when SaaS', :saas do
+ it 'does not render the broadcast layout' do
+ render
+
+ expect(rendered).not_to render_template('layouts/_broadcast')
+ end
+ end
+ end
+
def disable_other_signin_methods
allow(view).to receive(:password_authentication_enabled_for_web?).and_return(false)
allow(view).to receive(:omniauth_enabled?).and_return(false)
diff --git a/spec/views/layouts/devise.html.haml_spec.rb b/spec/views/layouts/devise.html.haml_spec.rb
index 9c31f4984fa..102df757072 100644
--- a/spec/views/layouts/devise.html.haml_spec.rb
+++ b/spec/views/layouts/devise.html.haml_spec.rb
@@ -23,12 +23,4 @@ RSpec.describe 'layouts/devise', feature_category: :user_management do
end
end
end
-
- context 'without broadcast messaging' do
- it 'does not render the broadcast layout' do
- render
-
- expect(rendered).not_to render_template('layouts/_broadcast')
- end
- end
end