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:
authorRobert Speicher <robert@gitlab.com>2016-02-23 21:19:41 +0300
committerRémy Coutable <remy@rymai.me>2016-02-24 11:18:28 +0300
commit85f3dabefa1231ee22a422ea296b5a41128bcaaf (patch)
tree8f0db52dc0ec6586ec36a63087de9fffefeeb202
parent11b6c8c30bf55fdb3150749a905ce5c4642417c4 (diff)
Merge branch 'hudecof/show-crowd-login-form-when-signin-disabled' into 'master'
Show Crowd login even when sign-in is disabled Fixes #13176. See merge request !2749
-rw-r--r--CHANGELOG1
-rw-r--r--app/views/devise/sessions/new.html.haml2
-rw-r--r--features/login_form.feature10
-rw-r--r--features/steps/login_form.rb10
4 files changed, 15 insertions, 8 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 977a93f6693..cc81aceef97 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -8,6 +8,7 @@ v 8.5.1
- Fix a set of small UI glitches in project, profile, and wiki pages
- Issues can now be dragged & dropped into empty milestone lists. This is also
possible with MRs
+ - Show Crowd login tab when sign in is disabled and Crowd is enabled (Peter Hudec)
- Restrict permissions on public/uploads
- Add when the Builds & Runners API changes got introduced
- Update sentry-raven gem to 0.15.6
diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml
index dbc8eda6196..1136afbf29c 100644
--- a/app/views/devise/sessions/new.html.haml
+++ b/app/views/devise/sessions/new.html.haml
@@ -1,6 +1,6 @@
- page_title "Sign in"
%div
- - if signin_enabled? || ldap_enabled?
+ - if signin_enabled? || ldap_enabled? || crowd_enabled?
= render 'devise/shared/signin_box'
-# Omniauth fits between signin/ldap signin and signup and does not have a surrounding box
diff --git a/features/login_form.feature b/features/login_form.feature
index b4d95754482..7965882f7fc 100644
--- a/features/login_form.feature
+++ b/features/login_form.feature
@@ -1,5 +1,11 @@
Feature: Login form
- Scenario: I see crowd form
+ Scenario: I see Crowd form
Given Crowd integration enabled
When I visit sign in page
- Then I should see Crowd login form \ No newline at end of file
+ Then I should see Crowd login form
+
+ Scenario: I see Crowd form when sign-in is disabled
+ Given Crowd integration enabled
+ And Sign-in is disabled
+ When I visit sign in page
+ Then I should see Crowd login form
diff --git a/features/steps/login_form.rb b/features/steps/login_form.rb
index b9ff6ae67fd..90ab10e6229 100644
--- a/features/steps/login_form.rb
+++ b/features/steps/login_form.rb
@@ -5,18 +5,18 @@ class Spinach::Features::LoginForm < Spinach::FeatureSteps
include SharedUser
include SharedSearch
+ step 'Sign-in is disabled' do
+ allow_any_instance_of(ApplicationHelper).to receive(:signin_enabled?).and_return(false)
+ end
+
step 'Crowd integration enabled' do
- @providers_orig = Gitlab::OAuth::Provider.providers
- @omniauth_conf_orig = Gitlab.config.omniauth.enabled
expect(Gitlab::OAuth::Provider).to receive(:providers).and_return([:crowd])
- allow_any_instance_of(ApplicationHelper).to receive(:user_omniauth_authorize_path).and_return(root_path)
expect(Gitlab.config.omniauth).to receive(:enabled).and_return(true)
+ allow_any_instance_of(ApplicationHelper).to receive(:user_omniauth_authorize_path).and_return(root_path)
end
step 'I should see Crowd login form' do
expect(page).to have_selector '#tab-crowd form'
- Gitlab::OAuth::Provider.stub(:providers).and_return(@providers_orig)
- Gitlab.config.omniauth.stub(:enabled).and_return(@omniauth_conf_orig)
end
step 'I visit sign in page' do