2020-01-01 13:55:28 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
describe Gitlab::GoogleCodeImport::ProjectCreator do
|
2015-04-26 12:48:37 +05:30
|
|
|
let(:user) { create(:user) }
|
2015-09-11 14:41:01 +05:30
|
|
|
let(:repo) do
|
2015-04-26 12:48:37 +05:30
|
|
|
Gitlab::GoogleCodeImport::Repository.new(
|
2015-09-11 14:41:01 +05:30
|
|
|
"name" => 'vim',
|
|
|
|
"summary" => 'VI Improved',
|
|
|
|
"repositoryUrls" => ["https://vim.googlecode.com/git/"]
|
2015-04-26 12:48:37 +05:30
|
|
|
)
|
2015-09-11 14:41:01 +05:30
|
|
|
end
|
2018-10-15 14:42:47 +05:30
|
|
|
let(:namespace) { create(:group) }
|
2015-04-26 12:48:37 +05:30
|
|
|
|
|
|
|
before do
|
|
|
|
namespace.add_owner(user)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'creates project' do
|
2018-11-08 19:23:39 +05:30
|
|
|
expect_next_instance_of(Project) do |project|
|
|
|
|
expect(project).to receive(:add_import_job)
|
|
|
|
end
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
project_creator = described_class.new(repo, namespace, user)
|
2015-04-26 12:48:37 +05:30
|
|
|
project = project_creator.execute
|
2015-09-11 14:41:01 +05:30
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(project.import_url).to eq("https://vim.googlecode.com/git/")
|
|
|
|
expect(project.visibility_level).to eq(Gitlab::VisibilityLevel::PUBLIC)
|
|
|
|
end
|
|
|
|
end
|