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
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-08-09 15:13:34 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-08-09 15:13:34 +0300
commit0eb9c236888a832407bf0369ce188c4060a35c76 (patch)
tree2a5c286dc0df1bbbc3d74fc4e9e97f7a5ef7b0ba /spec
parent6a407717a9c5ba125989fa3b1f1a3974e36fe258 (diff)
Add latest changes from gitlab-org/gitlab@16-2-stable-ee
Diffstat (limited to 'spec')
-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
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