diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-02-03 01:23:34 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-02-25 01:38:13 +0300 |
commit | b95ef77e233eab3b3d37a4a7dce545d9da36f8a0 (patch) | |
tree | cd5717ac2010967f33ed35691093a3b2c040e3c9 /app | |
parent | 4a9affa7330f2099f6385d3d74150f93cfd008f1 (diff) |
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.
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/auth_helper.rb | 4 | ||||
-rw-r--r-- | app/views/devise/sessions/new.html.haml | 4 |
2 files changed, 6 insertions, 2 deletions
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. |