diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-06-03 15:20:11 +0200 |
---|---|---|
committer | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-06-03 15:20:11 +0200 |
commit | 9d491712cfe33286329524fb39dc5bf8e4c8affd (patch) | |
tree | 0e99ae15e613d5971ba9e7c7ffcdd51e37a2f725 /spec/models/user_spec.rb | |
parent | fab695461afbc4d03fbbf8cfbf9c5d90760ce752 (diff) | |
parent | ca3c5c295ed653b483fe81c3918ffe60f46666b9 (diff) | |
download | gitlab-ce-9d491712cfe33286329524fb39dc5bf8e4c8affd.tar.gz |
Merge branch 'master' into awardablesawardables
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r-- | spec/models/user_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 77f745b2660..528a79bf221 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -68,7 +68,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 @@ -76,7 +76,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 @@ -94,7 +94,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") @@ -142,7 +142,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 |