diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-07 15:08:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-07 15:08:52 +0300 |
commit | 28f0cd8e0725320c294f9dbf74c698ee727de594 (patch) | |
tree | 5e2ba5fc09fbddc0ac88d8b726795f8c62922a3b /spec/views | |
parent | 929712792964c31c895cb83ebf0862da038c57a0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views')
-rw-r--r-- | spec/views/devise/registrations/new.html.haml_spec.rb | 30 | ||||
-rw-r--r-- | spec/views/devise/sessions/new.html.haml_spec.rb | 21 | ||||
-rw-r--r-- | spec/views/layouts/devise.html.haml_spec.rb | 8 |
3 files changed, 51 insertions, 8 deletions
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 |