summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-02-08 20:47:38 +0000
committerRobert Speicher <robert@gitlab.com>2017-02-08 20:47:38 +0000
commitb28d66c38d95e779157e9f68f68e7ca3b0ba2521 (patch)
tree7bdc9278cf5bbf63dd05f615cff98f0991bafd8c /spec
parentd01cd84e69999677b5cb0d4f03d140f33cfdc0f7 (diff)
parentd9ee55ee38eb75f57ce9d1052ed23965a93f72b7 (diff)
downloadgitlab-ce-b28d66c38d95e779157e9f68f68e7ca3b0ba2521.tar.gz
Merge branch 'bypass-whitelist-for-external-user' into 'master'
Bypass signup domain validation for external users Closes #25279 See merge request !8575
Diffstat (limited to 'spec')
-rw-r--r--spec/models/user_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index fe88ec63af6..7fd49c73b37 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -141,6 +141,11 @@ describe User, models: true do
user = build(:user, email: "example@test.com")
expect(user).to be_invalid
end
+
+ it 'accepts example@test.com when added by another user' do
+ user = build(:user, email: "example@test.com", created_by_id: 1)
+ expect(user).to be_valid
+ end
end
context 'domain blacklist' do
@@ -159,6 +164,11 @@ describe User, models: true do
user = build(:user, email: 'info@example.com')
expect(user).not_to be_valid
end
+
+ it 'accepts info@example.com when added by another user' do
+ user = build(:user, email: 'info@example.com', created_by_id: 1)
+ expect(user).to be_valid
+ end
end
context 'when a signup domain is blacklisted but a wildcard subdomain is allowed' do