Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
072f29fd
Commit
072f29fd
authored
Mar 30, 2020
by
Aishwarya Subramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return false for unconfirmed email
parent
dbdac50a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
app/models/user.rb
app/models/user.rb
+1
-1
spec/models/user_spec.rb
spec/models/user_spec.rb
+6
-0
No files found.
app/models/user.rb
View file @
072f29fd
...
...
@@ -1695,7 +1695,7 @@ class User < ApplicationRecord
def
gitlab_employee?
strong_memoize
(
:gitlab_employee
)
do
if
Gitlab
.
com?
Mail
::
Address
.
new
(
email
).
domain
==
"gitlab.com"
Mail
::
Address
.
new
(
email
).
domain
==
"gitlab.com"
&&
confirmed?
else
false
end
...
...
spec/models/user_spec.rb
View file @
072f29fd
...
...
@@ -4420,6 +4420,12 @@ describe User, :do_not_mock_admin_mode do
it
{
is_expected
.
to
be
expected_result
}
end
context
'when email is of Gitlab and is not confirmed'
do
let
(
:user
)
{
build
(
:user
,
email:
'test@gitlab.com'
,
confirmed_at:
nil
)
}
it
{
is_expected
.
to
be
false
}
end
end
describe
'#current_highest_access_level'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment