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
c2e09e8f
Commit
c2e09e8f
authored
May 28, 2021
by
George Koltsov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not remove export when uploading via URL
Changelog: fixed
parent
9f5bdd47
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
lib/gitlab/import_export/after_export_strategies/web_upload_strategy.rb
...ort_export/after_export_strategies/web_upload_strategy.rb
+4
-0
spec/lib/gitlab/import_export/after_export_strategies/web_upload_strategy_spec.rb
...xport/after_export_strategies/web_upload_strategy_spec.rb
+16
-6
No files found.
lib/gitlab/import_export/after_export_strategies/web_upload_strategy.rb
View file @
c2e09e8f
...
...
@@ -32,6 +32,10 @@ module Gitlab
end
end
def
delete_export?
false
end
private
def
send_file
...
...
spec/lib/gitlab/import_export/after_export_strategies/web_upload_strategy_spec.rb
View file @
c2e09e8f
...
...
@@ -27,20 +27,30 @@ RSpec.describe Gitlab::ImportExport::AfterExportStrategies::WebUploadStrategy do
expect
(
subject
.
new
(
url:
example_url
,
http_method:
'whatever'
)).
not_to
be_valid
end
it
'on
yl
allow urls as upload urls'
do
it
'on
ly
allow urls as upload urls'
do
expect
(
subject
.
new
(
url:
example_url
)).
to
be_valid
expect
(
subject
.
new
(
url:
'whatever'
)).
not_to
be_valid
end
end
describe
'#execute'
do
it
'removes the exported project file after the upload'
do
allow
(
strategy
).
to
receive
(
:send_file
)
allow
(
strategy
).
to
receive
(
:handle_response_error
)
context
'when upload succeeds'
do
before
do
allow
(
strategy
).
to
receive
(
:send_file
)
allow
(
strategy
).
to
receive
(
:handle_response_error
)
end
it
'does not remove the exported project file after the upload'
do
expect
(
project
).
not_to
receive
(
:remove_exports
)
expect
(
project
).
to
receive
(
:remove_exports
)
strategy
.
execute
(
user
,
project
)
end
strategy
.
execute
(
user
,
project
)
it
'has finished export status'
do
strategy
.
execute
(
user
,
project
)
expect
(
project
.
export_status
).
to
eq
(
:finished
)
end
end
context
'when upload fails'
do
...
...
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