Welcome to mirror list, hosted at ThFree Co, Russian Federation.

project_creator_spec.rb « bitbucket_import « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0ec6a43f681c6eb93636eea8c2af093d79fcd518 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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(:group, owner: user) }

  before do
    namespace.add_owner(user)
  end
  
  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