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-05 10:34:51 +0300
committerAndrei Gliga <otzy_007@yahoo.com>2016-05-12 13:44:46 +0300
commitdeca3da1a7f4e59c97c27bedf7aa26185a4d883b (patch)
tree54973589e048f0fb664405022e1438a564faaae0 /spec/models/application_setting_spec.rb
parent6f69f6a1ab70bd2252803a64927d0c8df1d03612 (diff)
stub Devise.omniauth_providers to return GitHub even if the gitlab.yml has no omniauth provider enabled
This will fix failing tests in case gitlab.yml file has no omniauth providers enabled
Diffstat (limited to 'spec/models/application_setting_spec.rb')
-rw-r--r--spec/models/application_setting_spec.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb
index fb3ea491df7..d84f3e998f5 100644
--- a/spec/models/application_setting_spec.rb
+++ b/spec/models/application_setting_spec.rb
@@ -20,8 +20,14 @@ describe ApplicationSetting, models: true do
it { is_expected.to allow_value(https).for(:after_sign_out_path) }
it { is_expected.not_to allow_value(ftp).for(:after_sign_out_path) }
- it { is_expected.to allow_value([:github]).for(:disabled_oauth_sign_in_sources) }
- it { is_expected.not_to allow_value([:test]).for(:disabled_oauth_sign_in_sources) }
+ describe 'disabled_oauth_sign_in_sources validations' do
+ before do
+ allow(Devise).to receive(:omniauth_providers).and_return([:github])
+ end
+
+ it { is_expected.to allow_value(['github']).for(:disabled_oauth_sign_in_sources) }
+ it { is_expected.not_to allow_value(['test']).for(:disabled_oauth_sign_in_sources) }
+ end
it { is_expected.to validate_presence_of(:max_attachment_size) }