diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-07-15 18:30:38 -0500 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-07-18 17:53:43 -0500 |
commit | c71e658ccac85f111517e04b79d915c10867c7e3 (patch) | |
tree | ffbea4cb96791b4f78ae0d9e4bb3b51f54cc8ecc /spec/models/user_spec.rb | |
parent | a3f0f2cc4d9a4c689ae0eeae73e6d4ef19c39cce (diff) | |
download | gitlab-ce-c71e658ccac85f111517e04b79d915c10867c7e3.tar.gz |
Refactor and rename `restricted_signup_domains` to `domain_whitelist` to better conform to its behavior and newly introduced behavior.
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r-- | spec/models/user_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 5f130234df1..41e531c684b 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -91,7 +91,7 @@ describe User, models: true do describe 'email' do context 'when no signup domains whitelisted' do before do - allow_any_instance_of(ApplicationSetting).to receive(:restricted_signup_domains).and_return([]) + allow_any_instance_of(ApplicationSetting).to receive(:domain_whitelist).and_return([]) end it 'accepts any email' do @@ -102,7 +102,7 @@ describe User, models: true do context 'when a signup domain is whitelisted and subdomains are allowed' do before do - allow_any_instance_of(ApplicationSetting).to receive(:restricted_signup_domains).and_return(['example.com', '*.example.com']) + allow_any_instance_of(ApplicationSetting).to receive(:domain_whitelist).and_return(['example.com', '*.example.com']) end it 'accepts info@example.com' do @@ -123,7 +123,7 @@ describe User, models: true do context 'when a signup domain is whitelisted and subdomains are not allowed' do before do - allow_any_instance_of(ApplicationSetting).to receive(:restricted_signup_domains).and_return(['example.com']) + allow_any_instance_of(ApplicationSetting).to receive(:domain_whitelist).and_return(['example.com']) end it 'accepts info@example.com' do @@ -163,7 +163,7 @@ describe User, models: true do context 'when a signup domain is black listed but a wildcard subdomain is allowed' do before do allow_any_instance_of(ApplicationSetting).to receive(:domain_blacklist).and_return(['test.example.com']) - allow_any_instance_of(ApplicationSetting).to receive(:restricted_signup_domains).and_return(['*.example.com']) + allow_any_instance_of(ApplicationSetting).to receive(:domain_whitelist).and_return(['*.example.com']) end it 'should give priority to whitelist and allow info@test.example.com' do @@ -174,7 +174,7 @@ describe User, models: true do context 'with both lists containing a domain' do before do - allow_any_instance_of(ApplicationSetting).to receive(:restricted_signup_domains).and_return(['test.com']) + allow_any_instance_of(ApplicationSetting).to receive(:domain_whitelist).and_return(['test.com']) end it 'accepts info@test.com' do |