diff options
author | James Lopez <james@jameslopez.es> | 2018-06-25 15:10:26 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2018-07-06 15:46:18 +0200 |
commit | a2bf1641546a1d3eeb3e9f44734854f655c0adef (patch) | |
tree | 0652c20a92513330aa09c4a2ec9adbfaeb3a6494 /spec/lib/gitlab/import_export/after_export_strategies/web_upload_strategy_spec.rb | |
parent | b0fa01fce3822da94aee6264829841996beb6df3 (diff) | |
download | gitlab-ce-a2bf1641546a1d3eeb3e9f44734854f655c0adef.tar.gz |
Update Import/Export to use object storage (based on aa feature flag)
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 | 31 |
1 files changed, 26 insertions, 5 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 5fe57d9987b..7f2e0a4ee2c 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 @@ -24,13 +24,34 @@ describe Gitlab::ImportExport::AfterExportStrategies::WebUploadStrategy do 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 'without object storage' do + before do + stub_feature_flags(import_export_object_storage: false) + end + + it 'removes the exported project file after the upload' do + allow(strategy).to receive(:send_file) + allow(strategy).to receive(:handle_response_error) + + expect(project).to receive(:remove_exported_project_file) + + strategy.execute(user, project) + end + end + + context 'with object storage' do + before do + stub_feature_flags(import_export_object_storage: true) + end - expect(project).to receive(:remove_exported_project_file) + it 'removes the exported project file after the upload' do + allow(strategy).to receive(:send_file) + allow(strategy).to receive(:handle_response_error) - strategy.execute(user, project) + expect(project).to receive(:remove_exported_project_file) + + strategy.execute(user, project) + end end end end |