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
a1a5dd4b
Commit
a1a5dd4b
authored
Jan 31, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add spec replicating validation error
parent
83711c78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
spec/lib/gitlab/import_export/members_mapper_spec.rb
spec/lib/gitlab/import_export/members_mapper_spec.rb
+28
-0
No files found.
spec/lib/gitlab/import_export/members_mapper_spec.rb
View file @
a1a5dd4b
...
@@ -92,5 +92,33 @@ describe Gitlab::ImportExport::MembersMapper, services: true do
...
@@ -92,5 +92,33 @@ describe Gitlab::ImportExport::MembersMapper, services: true do
expect
(
members_mapper
.
map
[
exported_user_id
]).
to
eq
(
user2
.
id
)
expect
(
members_mapper
.
map
[
exported_user_id
]).
to
eq
(
user2
.
id
)
end
end
end
end
context
'importer same as group member'
do
let
(
:user2
)
{
create
(
:admin
,
authorized_projects_populated:
true
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:empty_project
,
:public
,
name:
'searchable_project'
,
namespace:
group
)
}
let
(
:members_mapper
)
do
described_class
.
new
(
exported_members:
exported_members
,
user:
user2
,
project:
project
)
end
before
do
GroupMember
.
add_users_to_group
(
group
,
[
user
,
user2
],
GroupMember
::
DEVELOPER
)
end
it
'maps the project member'
do
expect
(
members_mapper
.
map
[
exported_user_id
]).
to
eq
(
user2
.
id
)
end
it
'maps the project member if it already exists'
do
ProjectMember
.
create!
(
user:
user2
,
access_level:
ProjectMember
::
MASTER
,
source_id:
project
.
id
)
expect
(
members_mapper
.
map
[
exported_user_id
]).
to
eq
(
user2
.
id
)
end
end
end
end
end
end
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