diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2018-04-23 00:15:48 +0100 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2018-04-30 17:32:23 +0100 |
commit | c741f95a3b599971aaf3dfc1ff3ca43a8ba938b8 (patch) | |
tree | 753c43562b26bd99f6f4d37de75fa3e40cb9f838 /spec/helpers | |
parent | b51f6e2c214df34a94b9097355775f29b269524b (diff) | |
download | gitlab-ce-c741f95a3b599971aaf3dfc1ff3ca43a8ba938b8.tar.gz |
Exclude LDAP from OmniauthCallbackController base methods
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/auth_helper_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/helpers/auth_helper_spec.rb b/spec/helpers/auth_helper_spec.rb index c94fedd615b..120b23e66ac 100644 --- a/spec/helpers/auth_helper_spec.rb +++ b/spec/helpers/auth_helper_spec.rb @@ -18,6 +18,30 @@ describe AuthHelper do end end + describe "providers_for_base_controller" do + it 'returns all enabled providers from devise' do + allow(helper).to receive(:auth_providers) { [:twitter, :github] } + expect(helper.providers_for_base_controller).to include(*[:twitter, :github]) + end + + it 'excludes ldap providers' do + allow(helper).to receive(:auth_providers) { [:twitter, :ldapmain] } + expect(helper.providers_for_base_controller).not_to include(:ldapmain) + end + end + + describe "form_based_providers" do + it 'includes LDAP providers' do + allow(helper).to receive(:auth_providers) { [:twitter, :ldapmain] } + expect(helper.form_based_providers).to eq %i(ldapmain) + end + + it 'includes crowd provider' do + allow(helper).to receive(:auth_providers) { [:twitter, :crowd] } + expect(helper.form_based_providers).to eq %i(crowd) + end + end + describe 'enabled_button_based_providers' do before do allow(helper).to receive(:auth_providers) { [:twitter, :github] } |