diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-08-07 19:24:14 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-08-07 19:24:14 +0000 |
commit | 4c8b666893aa9f5ab94b800489fd9e3240ad4f5e (patch) | |
tree | 4c499f649a9b3461963d9c084333259aad8a57be /spec/services | |
parent | 4e2b630df716174ea9b07319a0fd5eda7b60cf8e (diff) | |
parent | ae5003a35ef47bbdafc51e3e9d0f27039f9d20a2 (diff) | |
download | gitlab-ce-4c8b666893aa9f5ab94b800489fd9e3240ad4f5e.tar.gz |
Merge branch 'zj-project-templates' into 'master'
Allow projects to be started from a template
Closes #32420
See merge request !13108
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/projects/create_from_template_service_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/services/projects/create_from_template_service_spec.rb b/spec/services/projects/create_from_template_service_spec.rb new file mode 100644 index 00000000000..9919ec254c6 --- /dev/null +++ b/spec/services/projects/create_from_template_service_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +describe Projects::CreateFromTemplateService do + let(:user) { create(:user) } + let(:project_params) do + { + path: user.to_param, + template_name: 'rails' + } + end + + subject { described_class.new(user, project_params) } + + it 'calls the importer service' do + expect_any_instance_of(Projects::GitlabProjectsImportService).to receive(:execute) + + subject.execute + end + + it 'returns the project thats created' do + project = subject.execute + + expect(project).to be_saved + expect(project.scheduled?).to be(true) + end +end |