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
fe56d29d
Commit
fe56d29d
authored
Jun 19, 2018
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update spec
parent
b99bc6d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
6 deletions
+55
-6
spec/lib/gitlab/import_export/group_project_finder_spec.rb
spec/lib/gitlab/import_export/group_project_finder_spec.rb
+55
-6
No files found.
spec/lib/gitlab/import_export/group_project_finder_spec.rb
View file @
fe56d29d
...
...
@@ -10,12 +10,61 @@ describe Gitlab::ImportExport::GroupProjectFinder do
group:
create
(
:group
))
end
it
'finds the right group label'
do
group_label
=
create
(
:group_label
,
'name'
:
'group label'
,
'group'
:
project
.
group
)
context
'labels'
do
it
'finds the right group label'
do
group_label
=
create
(
:group_label
,
'name'
:
'group label'
,
'group'
:
project
.
group
)
expect
(
described_class
.
find
(
Label
,
title:
'group label'
,
'project_id'
:
project
.
id
,
'group_id'
:
project
.
group
.
id
)).
to
eq
([
group_label
])
expect
(
described_class
.
find_or_new
(
Label
,
title:
'group label'
,
'project_id'
=>
project
.
id
,
'group_id'
=>
project
.
group
.
id
)).
to
eq
(
group_label
)
end
it
'initializes a new label'
do
label
=
described_class
.
find_or_new
(
Label
,
title:
'group label'
,
'project_id'
=>
project
.
id
,
'group_id'
=>
project
.
group
.
id
)
expect
(
label
.
persisted?
).
to
be
false
end
it
'creates a new label'
do
label
=
described_class
.
find_or_create
(
Label
,
title:
'group label'
,
'project_id'
=>
project
.
id
,
'group_id'
=>
project
.
group
.
id
)
expect
(
label
.
persisted?
).
to
be
true
end
end
context
'milestones'
do
it
'finds the right group milestone'
do
milestone
=
create
(
:milestone
,
'name'
=>
'group milestone'
,
'group'
=>
project
.
group
)
expect
(
described_class
.
find_or_new
(
Milestone
,
title:
'group milestone'
,
'project_id'
=>
project
.
id
,
'group_id'
=>
project
.
group
.
id
)).
to
eq
(
milestone
)
end
it
'initializes a new milestone'
do
milestone
=
described_class
.
find_or_new
(
Milestone
,
title:
'group milestone'
,
'project_id'
=>
project
.
id
,
'group_id'
=>
project
.
group
.
id
)
expect
(
milestone
.
persisted?
).
to
be
false
end
it
'creates a new milestone'
do
milestone
=
described_class
.
find_or_create
(
Milestone
,
title:
'group milestone'
,
'project_id'
=>
project
.
id
,
'group_id'
=>
project
.
group
.
id
)
expect
(
milestone
.
persisted?
).
to
be
true
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