From b95ef77e233eab3b3d37a4a7dce545d9da36f8a0 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Tue, 2 Feb 2016 17:23:34 -0500 Subject: Move "I should see Crowd login form" feature to a view spec We were doing all kinds of code gymnastics to "enable" Crowd in the feature spec and this would sometimes cause a transient failure. Really what it's testing is if the Crowd login form shows when Crowd's enabled, so this is much better suited to a view spec. --- app/helpers/auth_helper.rb | 4 ++++ app/views/devise/sessions/new.html.haml | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/helpers/auth_helper.rb b/app/helpers/auth_helper.rb index de669e529a7..b4f80fd9b3e 100644 --- a/app/helpers/auth_helper.rb +++ b/app/helpers/auth_helper.rb @@ -6,6 +6,10 @@ module AuthHelper Gitlab.config.ldap.enabled end + def omniauth_enabled? + Gitlab.config.omniauth.enabled + end + def provider_has_icon?(name) PROVIDERS_WITH_ICONS.include?(name.to_s) end diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 1136afbf29c..d65fa60025c 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -4,7 +4,7 @@ = render 'devise/shared/signin_box' -# Omniauth fits between signin/ldap signin and signup and does not have a surrounding box - - if Gitlab.config.omniauth.enabled && devise_mapping.omniauthable? + - if omniauth_enabled? && devise_mapping.omniauthable? .clearfix.prepend-top-20 = render 'devise/shared/omniauth_box' @@ -14,6 +14,6 @@ = render 'devise/shared/signup_box' -# Show a message if none of the mechanisms above are enabled - - if !signin_enabled? && !ldap_enabled? && !(Gitlab.config.omniauth.enabled && devise_mapping.omniauthable?) + - if !signin_enabled? && !ldap_enabled? && !(omniauth_enabled? && devise_mapping.omniauthable?) %div No authentication methods configured. -- cgit v1.2.3