summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/import_export/after_export_strategies
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-16 18:25:58 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-16 18:25:58 +0000
commita5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch)
treefb69158581673816a8cd895f9d352dcb3c678b1e /spec/lib/gitlab/import_export/after_export_strategies
parentd16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff)
downloadgitlab-ce-a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4.tar.gz
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'spec/lib/gitlab/import_export/after_export_strategies')
-rw-r--r--spec/lib/gitlab/import_export/after_export_strategies/web_upload_strategy_spec.rb22
1 files changed, 16 insertions, 6 deletions
diff --git a/spec/lib/gitlab/import_export/after_export_strategies/web_upload_strategy_spec.rb b/spec/lib/gitlab/import_export/after_export_strategies/web_upload_strategy_spec.rb
index 38f1d48798b..451fd6c6f46 100644
--- a/spec/lib/gitlab/import_export/after_export_strategies/web_upload_strategy_spec.rb
+++ b/spec/lib/gitlab/import_export/after_export_strategies/web_upload_strategy_spec.rb
@@ -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 'onyl allow urls as upload urls' do
+ it 'only 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