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:40:27 +0300
committerAndrei Gliga <otzy_007@yahoo.com>2016-05-12 13:44:46 +0300
commitfc88527c9e21f99a9411423f1c8a6475957c02f3 (patch)
tree199da0ce41de6c47cb4a38c338e4f352b4886188 /spec/helpers
parent2e4c914ae88b77c8a3871f8415163a51e23254e5 (diff)
use stub_application_setting instead
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/auth_helper_spec.rb14
1 files changed, 4 insertions, 10 deletions
diff --git a/spec/helpers/auth_helper_spec.rb b/spec/helpers/auth_helper_spec.rb
index 6dc1135927d..e6af074a780 100644
--- a/spec/helpers/auth_helper_spec.rb
+++ b/spec/helpers/auth_helper_spec.rb
@@ -2,8 +2,6 @@ require "spec_helper"
describe AuthHelper do
describe "button_based_providers" do
- let(:settings) { ApplicationSetting.create_from_defaults }
-
it 'returns all enabled providers from devise' do
allow(helper).to receive(:auth_providers) { [:twitter, :github] }
expect(helper.button_based_providers).to include(*[:twitter, :github])
@@ -25,13 +23,11 @@ describe AuthHelper do
end
it "should not return github as provider because it's disabled from settings" do
- settings.update_attribute(
- :disabled_oauth_sign_in_sources,
- ['github']
+ stub_application_setting(
+ disabled_oauth_sign_in_sources: ['github']
)
allow(helper).to receive(:auth_providers) { [:twitter, :github] }
- allow(helper).to receive(:current_application_settings) { settings }
expect(helper.enabled_button_based_providers).to include('twitter')
expect(helper.enabled_button_based_providers).to_not include('github')
@@ -44,13 +40,11 @@ describe AuthHelper do
end
it 'returns false for button_based_providers_enabled? because there providers' do
- settings.update_attribute(
- :disabled_oauth_sign_in_sources,
- ['github', 'twitter']
+ stub_application_setting(
+ disabled_oauth_sign_in_sources: ['github', 'twitter']
)
allow(helper).to receive(:auth_providers) { [:twitter, :github] }
- allow(helper).to receive(:current_application_settings) { settings }
expect(helper.button_based_providers_enabled?).to be false
end