diff options
author | Stan Hu <stanhu@gmail.com> | 2018-07-16 00:24:16 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-07-16 00:24:16 +0300 |
commit | 1d03ff930829110616fda32d2bc04ddddce2d119 (patch) | |
tree | 08dba34b89b0d01e43bbdabd38711b270d194ffd /spec/lib/gitlab/bitbucket_server_import | |
parent | 81c8c98e1710913fe3b2bdfda533a9f0e1597e6b (diff) |
Add first rev of Bitbucket Server importer test
Diffstat (limited to 'spec/lib/gitlab/bitbucket_server_import')
-rw-r--r-- | spec/lib/gitlab/bitbucket_server_import/importer_spec.rb | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb b/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb new file mode 100644 index 00000000000..73875b92b71 --- /dev/null +++ b/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb @@ -0,0 +1,42 @@ +require 'spec_helper' + +describe Gitlab::BitbucketServerImport::Importer do + include ImportSpecHelper + + let(:project) { create(:project, import_url: 'http://my-bitbucket') } + + subject { described_class.new(project) } + + before do + data = project.create_or_update_import_data( + data: { project_key: 'TEST', repo_slug: 'rouge' }, + credentials: { base_uri: 'http://my-bitbucket', user: 'bitbucket', password: 'test' } + ) + data.save + project.save + end + + describe '#import_repository' do + before 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'], + remote_name: 'bitbucket_server') + + subject.execute + end + end + + describe '#import_pull_requests' do + + end + + describe '#delete_temp_branches' do + + end +end |