2017-07-26 08:21:53 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Projects::CreateFromTemplateService do
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project_params) do
|
|
|
|
{
|
|
|
|
path: user.to_param,
|
2017-08-07 08:21:28 -04:00
|
|
|
template_name: 'rails'
|
2017-07-26 08:21:53 -04:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
subject { described_class.new(user, project_params) }
|
|
|
|
|
|
|
|
it 'calls the importer service' do
|
2017-08-01 08:34:11 -04:00
|
|
|
expect_any_instance_of(Projects::GitlabProjectsImportService).to receive(:execute)
|
2017-07-26 08:21:53 -04:00
|
|
|
|
|
|
|
subject.execute
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns the project thats created' do
|
|
|
|
project = subject.execute
|
|
|
|
|
|
|
|
expect(project).to be_saved
|
2017-08-07 08:21:28 -04:00
|
|
|
expect(project.scheduled?).to be(true)
|
2017-07-26 08:21:53 -04:00
|
|
|
end
|
|
|
|
end
|