diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-02-17 16:59:50 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-02-24 15:07:24 +0100 |
commit | ad6d6232342558705c54ba70a94f9d7ddbd00f8c (patch) | |
tree | 2114eb91b0ddf6273909c364c1786747cd3d4827 /spec/lib/gitlab/bitbucket_import | |
parent | 7561b1c2a486ae57e9fbebadadbe1269bfdba6a0 (diff) | |
download | gitlab-ce-ad6d6232342558705c54ba70a94f9d7ddbd00f8c.tar.gz |
Add Bitbucket importer.
Diffstat (limited to 'spec/lib/gitlab/bitbucket_import')
-rw-r--r-- | spec/lib/gitlab/bitbucket_import/project_creator_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb b/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb new file mode 100644 index 00000000000..f5523105848 --- /dev/null +++ b/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe Gitlab::BitbucketImport::ProjectCreator do + let(:user) { create(:user, bitbucket_access_token: "asdffg", bitbucket_access_token_secret: "sekret") } + let(:repo) { { + name: 'Vim', + slug: 'vim', + is_private: true, + owner: "asd"}.with_indifferent_access + } + let(:namespace){ create(:namespace) } + + it 'creates project' do + allow_any_instance_of(Project).to receive(:add_import_job) + + project_creator = Gitlab::BitbucketImport::ProjectCreator.new(repo, namespace, user) + project = project_creator.execute + + expect(project.import_url).to eq("ssh://git@bitbucket.org/asd/vim.git") + expect(project.visibility_level).to eq(Gitlab::VisibilityLevel::PRIVATE) + end +end |