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
1fd5f16c
Commit
1fd5f16c
authored
Nov 28, 2019
by
Aleksei Lipniagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define explicit :subject on restorer spec
parent
d6db5727
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
31 deletions
+27
-31
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+27
-31
No files found.
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
View file @
1fd5f16c
...
...
@@ -635,43 +635,39 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
end
context
'JSON with invalid records'
do
subject
(
:restored_project_json
)
{
project_tree_restorer
.
restore
}
let
(
:user
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
:builds_disabled
,
:issues_disabled
,
name:
'project'
,
path:
'project'
)
}
let
(
:project_tree_restorer
)
{
described_class
.
new
(
user:
user
,
shared:
shared
,
project:
project
)
}
let
(
:restored_project_json
)
{
project_tree_restorer
.
restore
}
context
'when some failures occur'
do
context
'because a relation fails to be processed'
do
let
(
:correlation_id
)
{
'my-correlation-id'
}
let
(
:correlation_id
)
{
'my-correlation-id'
}
before
do
setup_import_export_config
(
'with_invalid_records'
)
before
do
setup_import_export_config
(
'with_invalid_records'
)
Labkit
::
Correlation
::
CorrelationId
.
use_id
(
correlation_id
)
do
expect
(
restored_project_json
).
to
eq
(
true
)
end
end
Labkit
::
Correlation
::
CorrelationId
.
use_id
(
correlation_id
)
{
subject
}
end
it_behaves_like
'restores project successfully'
,
issues:
0
,
label
s:
0
,
label_with_priorities:
nil
,
milestones:
1
,
first_issue_labels:
0
,
service
s:
0
,
import_failures:
1
it
'records the failures in the database'
do
import_failure
=
ImportFailure
.
last
expect
(
import_failure
.
project_id
).
to
eq
(
project
.
id
)
expect
(
import_failure
.
relation_key
).
to
eq
(
'milestones'
)
expect
(
import_failure
.
relation_index
).
to
be_present
expect
(
import_failure
.
exception_class
).
to
eq
(
'ActiveRecord::RecordInvalid'
)
expect
(
import_failure
.
exception_message
).
to
be_present
expect
(
import_failure
.
correlation_id_value
).
to
eq
(
'my-correlation-id'
)
expect
(
import_failure
.
created_at
).
to
be_present
e
nd
context
'when failures occur because a relation fails to be processed'
do
it_behaves_like
'restores project successfully'
,
issue
s:
0
,
labels:
0
,
label_with_priorities:
nil
,
milestones:
1
,
first_issue_label
s:
0
,
services:
0
,
import_failures:
1
it
'records the failures in the database'
do
import_failure
=
ImportFailure
.
last
expect
(
import_failure
.
project_id
).
to
eq
(
project
.
id
)
expect
(
import_failure
.
relation_key
).
to
eq
(
'milestones'
)
expect
(
import_failure
.
relation_index
).
to
be_present
expect
(
import_failure
.
exception_class
).
to
eq
(
'ActiveRecord::RecordInvalid'
)
expect
(
import_failure
.
exception_message
).
to
be_present
expect
(
import_failure
.
correlation_id_value
).
to
eq
(
'my-correlation-id'
)
e
xpect
(
import_failure
.
created_at
).
to
be_present
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