summaryrefslogtreecommitdiff
path: root/spec/views/admin
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-26 12:06:00 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-26 12:06:00 +0000
commit5707f305f4b961e24369fcdaecf0b8ce1c34bad8 (patch)
tree3b291653b83b3e6c2bffc77c54527fbe6f6373be /spec/views/admin
parent759cd6c2985088d187ed519f2a881c2c690b34ec (diff)
downloadgitlab-ce-5707f305f4b961e24369fcdaecf0b8ce1c34bad8.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views/admin')
-rw-r--r--spec/views/admin/sessions/new.html.haml_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/views/admin/sessions/new.html.haml_spec.rb b/spec/views/admin/sessions/new.html.haml_spec.rb
new file mode 100644
index 00000000000..eb431a0b6de
--- /dev/null
+++ b/spec/views/admin/sessions/new.html.haml_spec.rb
@@ -0,0 +1,29 @@
+require 'spec_helper'
+
+describe 'admin/sessions/new.html.haml' do
+ context 'admin has password set' do
+ before do
+ allow(view).to receive(:password_authentication_enabled_for_web?).and_return(true)
+ end
+
+ it "shows enter password form" do
+ render
+
+ expect(rendered).to have_css('#login-pane.active')
+ expect(rendered).to have_selector('input[name="password"]')
+ end
+ end
+
+ context 'admin has no password set' do
+ before do
+ allow(view).to receive(:password_authentication_enabled_for_web?).and_return(false)
+ end
+
+ it "warns authentication not possible" do
+ render
+
+ expect(rendered).not_to have_css('#login-pane')
+ expect(rendered).to have_content 'No authentication methods configured'
+ end
+ end
+end