diff options
Diffstat (limited to 'spec/lib/gitlab/bitbucket_server_import/importer_spec.rb')
-rw-r--r-- | spec/lib/gitlab/bitbucket_server_import/importer_spec.rb | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb b/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb index 70423823b89..1e90a2ef27f 100644 --- a/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb +++ b/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb @@ -21,12 +21,9 @@ describe Gitlab::BitbucketServerImport::Importer do end describe '#import_repository' do - before do + it 'adds a remote' do expect(subject).to receive(:import_pull_requests) expect(subject).to receive(:delete_temp_branches) - end - - it 'adds a remote' do expect(project.repository).to receive(:fetch_as_mirror) .with('http://bitbucket:test@my-bitbucket', refmap: [:heads, :tags, '+refs/pull-requests/*/to:refs/merge-requests/*/head'], @@ -34,6 +31,18 @@ describe Gitlab::BitbucketServerImport::Importer do subject.execute end + + it 'raises a Gitlab::Shell exception in the fetch' do + expect(project.repository).to receive(:fetch_as_mirror).and_raise(Gitlab::Shell::Error) + + expect { subject.execute }.to raise_error(Gitlab::Shell::Error) + end + + it 'raises an unhandled exception in the fetch' do + expect(project.repository).to receive(:fetch_as_mirror).and_raise(RuntimeError) + + expect { subject.execute }.to raise_error(RuntimeError) + end end describe '#import_pull_requests' do |