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
e7dae6cf
Commit
e7dae6cf
authored
Jan 16, 2020
by
Albert Salim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract `epic_json` into a `let`
parent
9877a42a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
ee/spec/lib/ee/gitlab/import_export/group_tree_saver_spec.rb
ee/spec/lib/ee/gitlab/import_export/group_tree_saver_spec.rb
+8
-10
No files found.
ee/spec/lib/ee/gitlab/import_export/group_tree_saver_spec.rb
View file @
e7dae6cf
...
@@ -33,6 +33,12 @@ describe Gitlab::ImportExport::GroupTreeSaver do
...
@@ -33,6 +33,12 @@ describe Gitlab::ImportExport::GroupTreeSaver do
end
end
context
'epics relation'
do
context
'epics relation'
do
let
(
:epic_json
)
do
saved_group_json
[
'epics'
].
find
do
|
attrs
|
attrs
[
'id'
]
==
epic
.
id
end
end
it
'saves top level epics'
do
it
'saves top level epics'
do
expect_successful_save
(
group_tree_saver
)
expect_successful_save
(
group_tree_saver
)
expect
(
saved_group_json
[
'epics'
].
size
).
to
eq
(
2
)
expect
(
saved_group_json
[
'epics'
].
size
).
to
eq
(
2
)
...
@@ -41,11 +47,7 @@ describe Gitlab::ImportExport::GroupTreeSaver do
...
@@ -41,11 +47,7 @@ describe Gitlab::ImportExport::GroupTreeSaver do
it
'saves parent of epic'
do
it
'saves parent of epic'
do
expect_successful_save
(
group_tree_saver
)
expect_successful_save
(
group_tree_saver
)
child
=
saved_group_json
[
'epics'
].
find
do
|
attrs
|
parent
=
epic_json
[
'parent'
]
attrs
[
'id'
]
==
epic
.
id
end
parent
=
child
[
'parent'
]
expect
(
parent
).
not_to
be_empty
expect
(
parent
).
not_to
be_empty
expect
(
parent
[
'id'
]).
to
eq
(
parent_epic
.
id
)
expect
(
parent
[
'id'
]).
to
eq
(
parent_epic
.
id
)
...
@@ -54,11 +56,7 @@ describe Gitlab::ImportExport::GroupTreeSaver do
...
@@ -54,11 +56,7 @@ describe Gitlab::ImportExport::GroupTreeSaver do
it
'saves epic notes'
do
it
'saves epic notes'
do
expect_successful_save
(
group_tree_saver
)
expect_successful_save
(
group_tree_saver
)
child
=
saved_group_json
[
'epics'
].
find
do
|
attrs
|
notes
=
epic_json
[
'notes'
]
attrs
[
'id'
]
==
epic
.
id
end
notes
=
child
[
'notes'
]
expect
(
notes
).
not_to
be_empty
expect
(
notes
).
not_to
be_empty
expect
(
notes
.
first
[
'note'
]).
to
eq
(
note
.
note
)
expect
(
notes
.
first
[
'note'
]).
to
eq
(
note
.
note
)
...
...
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