diff options
author | James Lopez <james@jameslopez.es> | 2018-01-26 11:14:54 +0100 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2018-01-26 15:26:26 +0100 |
commit | 7affc2311282a032722af245abb92f0bd2da8db9 (patch) | |
tree | 009e6dd2be7aaa8b72ca9c999c61de975e130ef0 /spec | |
parent | 865bb64a06f33b1076d1b9a202cd41c7ad0728c5 (diff) | |
download | gitlab-ce-7affc2311282a032722af245abb92f0bd2da8db9.tar.gz |
add spec
Diffstat (limited to 'spec')
-rw-r--r-- | spec/workers/repository_import_worker_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/workers/repository_import_worker_spec.rb b/spec/workers/repository_import_worker_spec.rb index 7274a9f00f9..b8bdc049482 100644 --- a/spec/workers/repository_import_worker_spec.rb +++ b/spec/workers/repository_import_worker_spec.rb @@ -52,6 +52,19 @@ describe RepositoryImportWorker do end.to raise_error(StandardError, error) expect(project.reload.import_jid).not_to be_nil end + + it 'updates the error on Import/Export' do + error = %q{remote: Not Found fatal: repository 'https://user:pass@test.com/root/repoC.git/' not found } + + project.update_attributes(import_jid: '123', import_type: 'gitlab_project') + expect_any_instance_of(Projects::ImportService).to receive(:execute).and_return({ status: :error, message: error }) + + expect do + subject.perform(project.id) + end.to raise_error(StandardError, error) + + expect(project.reload.import_error).not_to be_nil + end end context 'when using an asynchronous importer' do |