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
Boxiang Sun
gitlab-ce
Commits
b8c3e60e
Commit
b8c3e60e
authored
Apr 23, 2019
by
charlieablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-stub stubbed method calls
parent
d5bbc33a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+9
-3
No files found.
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
View file @
b8c3e60e
...
...
@@ -24,12 +24,12 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
allow_any_instance_of
(
Project
).
to
receive
(
:latest_cached_markdown_version
).
and_return
(
434343
)
allow_any_instance_of
(
Note
).
to
receive
(
:latest_cached_markdown_version
).
and_return
(
434343
)
project_tree_restorer
=
described_class
.
new
(
user:
@user
,
shared:
@shared
,
project:
@project
)
@
project_tree_restorer
=
described_class
.
new
(
user:
@user
,
shared:
@shared
,
project:
@project
)
expect
(
Gitlab
::
ImportExport
::
RelationFactory
).
to
receive
(
:create
).
with
(
hash_including
(
excluded_keys:
[
'whatever'
])).
and_call_original
.
at_least
(
:once
)
allow
(
project_tree_restorer
).
to
receive
(
:excluded_keys_for_relation
).
and_return
([
'whatever'
])
allow
(
@
project_tree_restorer
).
to
receive
(
:excluded_keys_for_relation
).
and_return
([
'whatever'
])
@restored_project_json
=
project_tree_restorer
.
restore
@restored_project_json
=
@
project_tree_restorer
.
restore
end
end
...
...
@@ -61,6 +61,12 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
end
context
'when importing a project with cached_markdown_version and note_html'
do
before
do
expect
(
Gitlab
::
ImportExport
::
RelationFactory
).
not_to
receive
(
:create
).
with
(
hash_including
(
excluded_keys:
[
'whatever'
]))
expect
(
Gitlab
::
ImportExport
::
RelationFactory
).
to
receive
(
:create
).
with
(
hash_including
(
excluded_keys:
%w(note_html, cached_markdown_version)
)).
and_call_original
.
at_least
(
:once
)
allow
(
@project_tree_restorer
).
to
receive
(
:excluded_keys_for_relation
).
and_return
(
%w(note_html, cached_markdown_version)
)
end
let!
(
:issue
)
{
Issue
.
find_by
(
description:
'Aliquam enim illo et possimus.'
)
}
let
(
:note1
)
{
issue
.
notes
.
select
{
|
n
|
n
.
note
.
match
(
/Quo reprehenderit aliquam qui dicta impedit cupiditate eligendi/
)}.
first
}
let
(
:note2
)
{
issue
.
notes
.
select
{
|
n
|
n
.
note
.
match
(
/Est reprehenderit quas aut aspernatur autem recusandae voluptatem/
)}.
first
}
...
...
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