summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-02-23 18:19:41 +0000
committerRobert Speicher <robert@gitlab.com>2016-02-23 18:19:41 +0000
commitad3433f91e4366b7ee9f92ae6e16792536c65795 (patch)
tree3d318d1233adfb8cb854c62d14af1d98e76ee749 /features
parent5deb4ac1449d58d61ad891db05174207386929b0 (diff)
parenteb178f6d66b65035ce5795cac517d3389a187acc (diff)
downloadgitlab-ce-ad3433f91e4366b7ee9f92ae6e16792536c65795.tar.gz
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
Diffstat (limited to 'features')
-rw-r--r--features/login_form.feature10
-rw-r--r--features/steps/login_form.rb10
2 files changed, 13 insertions, 7 deletions
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