summaryrefslogtreecommitdiff
path: root/spec/helpers/auth_helper_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/auth_helper_spec.rb')
-rw-r--r--spec/helpers/auth_helper_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/helpers/auth_helper_spec.rb b/spec/helpers/auth_helper_spec.rb
new file mode 100644
index 00000000000..e47a54fdac5
--- /dev/null
+++ b/spec/helpers/auth_helper_spec.rb
@@ -0,0 +1,20 @@
+require "spec_helper"
+
+describe AuthHelper do
+ describe "button_based_providers" do
+ it 'returns all enabled providers' do
+ allow(helper).to receive(:auth_providers) { [:twitter, :github] }
+ expect(helper.button_based_providers).to include(*[:twitter, :github])
+ end
+
+ it 'does not return ldap provider' do
+ allow(helper).to receive(:auth_providers) { [:twitter, :ldapmain] }
+ expect(helper.button_based_providers).to include(:twitter)
+ end
+
+ it 'returns empty array' do
+ allow(helper).to receive(:auth_providers) { [] }
+ expect(helper.button_based_providers).to eq([])
+ end
+ end
+end