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
Léo-Paul Géneau
gitlab-ce
Commits
68eae045
Commit
68eae045
authored
Mar 08, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finish project tree saver spec
parent
e228453f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
185 additions
and
36 deletions
+185
-36
spec/services/projects/import_export/project_tree_saver_spec.rb
...ervices/projects/import_export/project_tree_saver_spec.rb
+185
-36
No files found.
spec/services/projects/import_export/project_tree_saver_spec.rb
View file @
68eae045
...
...
@@ -5,7 +5,23 @@ describe Projects::ImportExport::ProjectTreeSaver, services: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:issue
)
{
create
(
:issue
,
assignee:
user
)
}
let!
(
:project
)
{
create
(
:project
,
:public
,
name:
'searchable_project'
,
issues:
[
issue
]
)}
let
(
:merge_request
)
{
create
(
:merge_request
)
}
let
(
:label
)
{
create
(
:label
)
}
let
(
:snippet
)
{
create
(
:project_snippet
)
}
let
(
:commit_status
)
{
create
(
:commit_status
)
}
let
(
:release
)
{
create
(
:release
)
}
let!
(
:project
)
do
create
(
:project
,
:public
,
name:
'searchable_project'
,
issues:
[
issue
],
merge_requests:
[
merge_request
],
labels:
[
label
],
snippets:
[
snippet
],
releases:
[
release
],
commit_statuses:
[
commit_status
])
end
let!
(
:milestone
)
{
create
(
:milestone
,
title:
"Milestone v1.2"
,
project:
project
)
}
let
(
:export_path
)
{
"
#{
Dir
::
tmpdir
}
/project_tree_saver_spec"
}
let
(
:project_tree_saver
)
{
Projects
::
ImportExport
::
ProjectTreeSaver
.
new
(
project:
project
)
}
...
...
@@ -37,9 +53,33 @@ describe Projects::ImportExport::ProjectTreeSaver, services: true do
expect
(
saved_project_json
[
'events'
]).
not_to
be_empty
end
it
'has milestones'
do
expect
(
saved_project_json
[
'milestones'
]).
not_to
be_empty
end
it
'has merge requests'
do
expect
(
saved_project_json
[
'merge_requests'
]).
not_to
be_empty
end
it
'has labels'
do
expect
(
saved_project_json
[
'labels'
]).
not_to
be_empty
end
it
'has snippets'
do
expect
(
saved_project_json
[
'snippets'
]).
not_to
be_empty
end
it
'has releases'
do
expect
(
saved_project_json
[
'releases'
]).
not_to
be_empty
end
it
'has issues'
do
expect
(
saved_project_json
[
'issues'
]).
not_to
be_empty
end
it
'has commit statuses'
do
expect
(
saved_project_json
[
'commit_statuses'
]).
not_to
be_empty
end
end
end
...
...
@@ -49,51 +89,160 @@ describe Projects::ImportExport::ProjectTreeSaver, services: true do
# TODO: Remove this. Current JSON pretty printed:
# {
# "id": 1,
# "name": "searchable_project",
# "path": "gitlabhq",
# "description": null,
# "issues_enabled": true,
# "wall_enabled": false,
# "merge_requests_enabled": true,
# "wiki_enabled": true,
# "snippets_enabled": true,
# "visibility_level": 20,
# "archived": false,
# "issues": [
#
# "id":7,
# "name":"searchable_project",
# "path":"gitlabhq",
# "description":null,
# "issues_enabled":true,
# "wall_enabled":false,
# "merge_requests_enabled":true,
# "wiki_enabled":true,
# "snippets_enabled":true,
# "visibility_level":20,
# "archived":false,
# "issues":[
# {
# "id":1,
# "title":"Voluptas dolores molestias iste excepturi quia atque sint et.",
# "assignee_id":1,
# "author_id":2,
# "project_id":7,
# "created_at":"2016-03-08T09:14:31.726Z",
# "updated_at":"2016-03-08T09:14:36.293Z",
# "position":0,
# "branch_name":null,
# "description":null,
# "milestone_id":null,
# "state":"opened",
# "iid":1,
# "updated_by_id":null
# }
# ],
# "merge_requests": [
# "merge_requests":[
# {
# "id":1,
# "target_branch":"feature",
# "source_branch":"master",
# "source_project_id":2,
# "author_id":5,
# "assignee_id":null,
# "title":"Quam velit cupiditate culpa perspiciatis esse maiores quaerat.",
# "created_at":"2016-03-08T09:14:32.597Z",
# "updated_at":"2016-03-08T09:14:32.597Z",
# "milestone_id":null,
# "state":"opened",
# "merge_status":"can_be_merged",
# "target_project_id":7,
# "iid":1,
# "description":null,
# "position":0,
# "locked_at":null,
# "updated_by_id":null,
# "merge_error":null,
# "merge_params":{
#
# },
# "merge_when_build_succeeds":false,
# "merge_user_id":null,
# "merge_commit_sha":null
# }
# ],
# "labels": [
#
# "labels":[
# {
# "id":1,
# "title":"Bug",
# "color":"#990000",
# "project_id":7,
# "created_at":"2016-03-08T09:14:33.774Z",
# "updated_at":"2016-03-08T09:14:36.314Z",
# "template":false,
# "description":null
# }
# ],
# "milestones": [
#
# "milestones":[
# {
# "id":1,
# "title":"Milestone v1.2",
# "project_id":7,
# "description":null,
# "due_date":null,
# "created_at":"2016-03-08T09:14:36.526Z",
# "updated_at":"2016-03-08T09:14:36.526Z",
# "state":"active",
# "iid":1
# }
# ],
# "snippets": [
#
# "snippets":[
# {
# "id":1,
# "title":"Voluptatem qui officiis modi ut fugit distinctio dolor qui.",
# "content":"Quaerat sunt eligendi voluptatum magnam.",
# "author_id":12,
# "project_id":7,
# "created_at":"2016-03-08T09:14:34.539Z",
# "updated_at":"2016-03-08T09:14:36.332Z",
# "file_name":"rowland.tremblay",
# "expires_at":null,
# "visibility_level":0
# }
# ],
# "releases": [
#
# "releases":[
# {
# "id":1,
# "tag":"v1.1.0",
# "description":"Awesome release",
# "project_id":7,
# "created_at":"2016-03-08T09:14:35.023Z",
# "updated_at":"2016-03-08T09:14:36.351Z"
# }
# ],
# "events":
[
# "events":[
# {
# "id":
1,
# "target_type":
null,
# "target_id":
null,
# "title":
null,
# "data":
null,
# "project_id":
1
,
# "created_at":
"2016-03-07T17:05:20.92
6Z",
# "updated_at":
"2016-03-07T17:05:20.92
6Z",
# "action":
8,
# "author_id":
3
# "id":1,
# "target_type":null,
# "target_id":null,
# "title":null,
# "data":null,
# "project_id":
7
,
# "created_at":
"2016-03-08T09:14:36.80
6Z",
# "updated_at":
"2016-03-08T09:14:36.80
6Z",
# "action":8,
# "author_id":
1
# }
# ],
# "commit_statuses": [
#
# "commit_statuses":[
# {
# "id":1,
# "project_id":null,
# "status":"success",
# "finished_at":"2016-01-26T07:23:42.000Z",
# "trace":null,
# "created_at":"2016-03-08T09:14:35.633Z",
# "updated_at":"2016-03-08T09:14:36.385Z",
# "started_at":"2016-01-26T07:21:42.000Z",
# "runner_id":null,
# "coverage":null,
# "commit_id":1,
# "commands":null,
# "job_id":null,
# "name":"default",
# "deploy":false,
# "options":null,
# "allow_failure":false,
# "stage":null,
# "trigger_request_id":null,
# "stage_idx":null,
# "tag":null,
# "ref":null,
# "user_id":null,
# "target_url":null,
# "description":"commit status",
# "artifacts_file":null,
# "gl_project_id":7,
# "artifacts_metadata":null,
# "erased_by_id":null,
# "erased_at":null
# }
# ]
# }
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