Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-07-02 17:33:38 +0300
committerDouwe Maan <douwe@gitlab.com>2015-07-23 16:20:12 +0300
commit70a3c165a9f3882a82cf8946a783ace091635797 (patch)
tree2d09f34639859b2eadf5b648ac42f55b2419ceb2 /spec/helpers
parent5dd4dea93baa6386ed860a50125dce3ca3890f16 (diff)
Allow custom label to be set for authentication providers.
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/auth_helper_spec.rb20
-rw-r--r--spec/helpers/oauth_helper_spec.rb20
2 files changed, 20 insertions, 20 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
diff --git a/spec/helpers/oauth_helper_spec.rb b/spec/helpers/oauth_helper_spec.rb
deleted file mode 100644
index 3ef35f35102..00000000000
--- a/spec/helpers/oauth_helper_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require "spec_helper"
-
-describe OauthHelper do
- describe "additional_providers" do
- it 'returns all enabled providers' do
- allow(helper).to receive(:enabled_oauth_providers) { [:twitter, :github] }
- expect(helper.additional_providers).to include(*[:twitter, :github])
- end
-
- it 'does not return ldap provider' do
- allow(helper).to receive(:enabled_oauth_providers) { [:twitter, :ldapmain] }
- expect(helper.additional_providers).to include(:twitter)
- end
-
- it 'returns empty array' do
- allow(helper).to receive(:enabled_oauth_providers) { [] }
- expect(helper.additional_providers).to eq([])
- end
- end
-end