Commit 7c503fef authored by Stan Hu's avatar Stan Hu
Browse files

Add first rev of Bitbucket Server importer test

parent 94b33181285e
......@@ -640,6 +640,8 @@ def create_or_update_import_data(data: nil, credentials: nil)
project_import_data.credentials ||= {}
project_import_data.credentials = project_import_data.credentials.merge(credentials)
end
project_import_data
end
def import?
......
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment