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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
bfd53aa6
Commit
bfd53aa6
authored
Oct 03, 2017
by
Jacob Vosmaer (GitLab)
Committed by
Douwe Maan
Oct 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore User.from_gitaly
parent
69fd4f94
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
lib/gitlab/git/user.rb
lib/gitlab/git/user.rb
+5
-0
spec/lib/gitlab/git/user_spec.rb
spec/lib/gitlab/git/user_spec.rb
+14
-0
No files found.
lib/gitlab/git/user.rb
View file @
bfd53aa6
...
...
@@ -7,6 +7,11 @@ module Gitlab
new
(
gitlab_user
.
username
,
gitlab_user
.
name
,
gitlab_user
.
email
,
Gitlab
::
GlId
.
gl_id
(
gitlab_user
))
end
# TODO support the username field in Gitaly https://gitlab.com/gitlab-org/gitaly/issues/628
def
self
.
from_gitaly
(
gitaly_user
)
new
(
''
,
gitaly_user
.
name
,
gitaly_user
.
email
,
gitaly_user
.
gl_id
)
end
def
initialize
(
username
,
name
,
email
,
gl_id
)
@username
=
username
@name
=
name
...
...
spec/lib/gitlab/git/user_spec.rb
View file @
bfd53aa6
...
...
@@ -8,6 +8,20 @@ describe Gitlab::Git::User do
subject
{
described_class
.
new
(
username
,
name
,
email
,
gl_id
)
}
describe
'.from_gitaly'
do
let
(
:gitaly_user
)
{
Gitaly
::
User
.
new
(
name:
name
,
email:
email
,
gl_id:
gl_id
)
}
subject
{
described_class
.
from_gitaly
(
gitaly_user
)
}
it
{
expect
(
subject
).
to
eq
(
described_class
.
new
(
''
,
name
,
email
,
gl_id
))
}
end
describe
'.from_gitlab'
do
let
(
:user
)
{
build
(
:user
)
}
subject
{
described_class
.
from_gitlab
(
user
)
}
it
{
expect
(
subject
).
to
eq
(
described_class
.
new
(
user
.
username
,
user
.
name
,
user
.
email
,
'user-'
))
}
end
describe
'#=='
do
def
eq_other
(
username
,
name
,
email
,
gl_id
)
eq
(
described_class
.
new
(
username
,
name
,
email
,
gl_id
))
...
...
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