Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
e1fb96da4188
Commit
e8396d8e
authored
Jan 20, 2017
by
James Lopez
Browse files
fix member mapper spec
parent
e47cf3df1df7
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/gitlab/import_export/members_mapper.rb
View file @
e1fb96da
module
Gitlab
module
ImportExport
class
MembersMapper
attr_reader
:missing_author_ids
def
initialize
(
exported_members
:,
user
:,
project
:)
@exported_members
=
user
.
admin?
?
exported_members
:
[]
@user
=
user
...
...
spec/lib/gitlab/import_export/members_mapper_spec.rb
View file @
e1fb96da
...
...
@@ -49,8 +49,6 @@
end
it
'includes the exported user ID in the map'
do
members_mapper
.
map
[
-
1
]
expect
(
members_mapper
.
map
.
keys
).
to
include
(
exported_user_id
)
end
...
...
@@ -88,28 +86,7 @@
end
context
'chooses the one with an email first'
do
before
do
exported_members
<<
{
"id"
=>
2
,
"access_level"
=>
40
,
"source_id"
=>
14
,
"source_type"
=>
"Project"
,
"user_id"
=>
19
,
"notification_level"
=>
3
,
"created_at"
=>
"2016-03-11T10:21:44.822Z"
,
"updated_at"
=>
"2016-03-11T10:21:44.822Z"
,
"created_by_id"
=>
nil
,
"invite_email"
=>
nil
,
"invite_token"
=>
nil
,
"invite_accepted_at"
=>
nil
,
"user"
=>
{
"id"
=>
exported_user_id
,
"email"
=>
'test@email.com'
,
"username"
=>
user2
.
username
}
}
end
let
(
:user3
)
{
create
(
:user
,
username:
'test'
)
}
it
'maps the project member that has a matching email first'
do
expect
(
members_mapper
.
map
[
exported_user_id
]).
to
eq
(
user2
.
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