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
a2905796
Commit
a2905796
authored
Jul 23, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Geo: Add spec for uploading import/export archives
parent
71e97660
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
ee/spec/services/geo/file_upload_service_spec.rb
ee/spec/services/geo/file_upload_service_spec.rb
+29
-0
No files found.
ee/spec/services/geo/file_upload_service_spec.rb
View file @
a2905796
...
@@ -203,5 +203,34 @@ describe Geo::FileUploadService do
...
@@ -203,5 +203,34 @@ describe Geo::FileUploadService do
expect
(
service
.
execute
).
to
be_nil
expect
(
service
.
execute
).
to
be_nil
end
end
end
end
context
'import export archive'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:upload
)
{
Upload
.
find_by
(
model:
project
,
uploader:
'ImportExportUploader'
)
}
let
(
:params
)
{
{
id:
upload
.
id
,
type:
'import_export'
}
}
let
(
:file_transfer
)
{
Gitlab
::
Geo
::
FileTransfer
.
new
(
:import_export
,
upload
)
}
let
(
:transfer_request
)
{
Gitlab
::
Geo
::
TransferRequest
.
new
(
file_transfer
.
request_data
)
}
let
(
:req_header
)
{
transfer_request
.
headers
[
'Authorization'
]
}
let
(
:file
)
{
fixture_file_upload
(
'spec/fixtures/project_export.tar.gz'
)
}
before
do
ImportExportUploader
.
new
(
project
).
store!
(
file
)
end
it
'sends the file'
do
service
=
described_class
.
new
(
params
,
req_header
)
response
=
service
.
execute
expect
(
response
[
:code
]).
to
eq
(
:ok
)
expect
(
response
[
:file
].
path
).
to
end_with
(
'tar.gz'
)
end
it
'returns nil if no authorization'
do
service
=
described_class
.
new
(
params
,
nil
)
expect
(
service
.
execute
).
to
be_nil
end
end
end
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