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@selenight.nl>2016-06-01 13:55:00 +0300
committerDouwe Maan <douwe@selenight.nl>2016-06-01 13:55:00 +0300
commit4a50e1f0514f318d10a273d1c252d855cfb106fb (patch)
treeb5ae0597bea9768e5540b49dcbb184bed462e43d /spec/models
parentc0f19cc94ecb606e521afc4a39582c4dae9c5967 (diff)
parentc8eb1dccabe5cd961895127dbbbf46d3eee4aebd (diff)
Merge branch 'current-settings-use-request-store-during-request'
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/user_spec.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 9581990666b..548bec364f8 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -67,7 +67,7 @@ describe User, models: true do
describe 'email' do
context 'when no signup domains listed' do
- before { allow(current_application_settings).to receive(:restricted_signup_domains).and_return([]) }
+ before { allow_any_instance_of(ApplicationSetting).to receive(:restricted_signup_domains).and_return([]) }
it 'accepts any email' do
user = build(:user, email: "info@example.com")
expect(user).to be_valid
@@ -75,7 +75,7 @@ describe User, models: true do
end
context 'when a signup domain is listed and subdomains are allowed' do
- before { allow(current_application_settings).to receive(:restricted_signup_domains).and_return(['example.com', '*.example.com']) }
+ before { allow_any_instance_of(ApplicationSetting).to receive(:restricted_signup_domains).and_return(['example.com', '*.example.com']) }
it 'accepts info@example.com' do
user = build(:user, email: "info@example.com")
expect(user).to be_valid
@@ -93,7 +93,7 @@ describe User, models: true do
end
context 'when a signup domain is listed and subdomains are not allowed' do
- before { allow(current_application_settings).to receive(:restricted_signup_domains).and_return(['example.com']) }
+ before { allow_any_instance_of(ApplicationSetting).to receive(:restricted_signup_domains).and_return(['example.com']) }
it 'accepts info@example.com' do
user = build(:user, email: "info@example.com")
@@ -141,7 +141,7 @@ describe User, models: true do
end
describe '#confirm' do
- before { allow(current_application_settings).to receive(:send_user_confirmation_email).and_return(true) }
+ before { allow_any_instance_of(ApplicationSetting).to receive(:send_user_confirmation_email).and_return(true) }
let(:user) { create(:user, confirmed_at: nil, unconfirmed_email: 'test@gitlab.com') }
it 'returns unconfirmed' do