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:
authorAndrei Gliga <otzy_007@yahoo.com>2016-05-09 10:51:24 +0300
committerAndrei Gliga <otzy_007@yahoo.com>2016-05-12 13:44:46 +0300
commit038dbb6803948e050484ed3f34c99b2f3bf7a6c5 (patch)
tree869bbdb0fd61065bcebb56df9c4df1d211e92abd /spec/helpers/auth_helper_spec.rb
parent3922e7ee2249bb5a683b7474b281d8e83d465740 (diff)
DRYing enabled_button_based_providers tests
Diffstat (limited to 'spec/helpers/auth_helper_spec.rb')
-rw-r--r--spec/helpers/auth_helper_spec.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/spec/helpers/auth_helper_spec.rb b/spec/helpers/auth_helper_spec.rb
index 04b51282795..a6df8204213 100644
--- a/spec/helpers/auth_helper_spec.rb
+++ b/spec/helpers/auth_helper_spec.rb
@@ -19,8 +19,11 @@ describe AuthHelper do
end
describe 'enabled_button_based_providers' do
- it 'returns all the enabled providers from settings' do
+ before do
allow(helper).to receive(:auth_providers) { [:twitter, :github] }
+ end
+
+ it 'returns all the enabled providers from settings' do
expect(helper.enabled_button_based_providers).to include(*['twitter', 'github'])
end
@@ -29,15 +32,11 @@ describe AuthHelper do
disabled_oauth_sign_in_sources: ['github']
)
- allow(helper).to receive(:auth_providers) { [:twitter, :github] }
-
expect(helper.enabled_button_based_providers).to include('twitter')
expect(helper.enabled_button_based_providers).to_not include('github')
end
it 'returns true for button_based_providers_enabled? because there providers' do
- allow(helper).to receive(:auth_providers) { [:twitter, :github] }
-
expect(helper.button_based_providers_enabled?).to be true
end
@@ -46,8 +45,6 @@ describe AuthHelper do
disabled_oauth_sign_in_sources: ['github', 'twitter']
)
- allow(helper).to receive(:auth_providers) { [:twitter, :github] }
-
expect(helper.button_based_providers_enabled?).to be false
end
end