diff options
Diffstat (limited to 'spec/lib/gitlab/import_export/after_export_strategies/web_upload_strategy_spec.rb')
-rw-r--r-- | spec/lib/gitlab/import_export/after_export_strategies/web_upload_strategy_spec.rb | 22 |
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 |