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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2017-08-01 15:34:11 +0300
committerZ.J. van de Weg <git@zjvandeweg.nl>2017-08-01 15:36:42 +0300
commit3baf3dc955dfaad2961bba548dab940b55dfa68e (patch)
treeda2800408de827b68899e402495f4020bc6b4e40 /spec/lib/gitlab/project_template_spec.rb
parenta853d3e944abb7a6d60ea24381028020166760d1 (diff)
Rename GitLabProjectImporterService and misc fixes
First round of review, main changes: - templates.title is human readable, #name will be passed around - GitLabProjectImporterService has been renamed
Diffstat (limited to 'spec/lib/gitlab/project_template_spec.rb')
-rw-r--r--spec/lib/gitlab/project_template_spec.rb19
1 files changed, 17 insertions, 2 deletions
diff --git a/spec/lib/gitlab/project_template_spec.rb b/spec/lib/gitlab/project_template_spec.rb
index d95dab748fe..0f68e87a41a 100644
--- a/spec/lib/gitlab/project_template_spec.rb
+++ b/spec/lib/gitlab/project_template_spec.rb
@@ -35,13 +35,28 @@ describe Gitlab::ProjectTemplate do
end
describe 'validate all templates' do
+ set(:admin) { create(:admin) }
+
described_class.all.each do |template|
it "#{template.name} has a valid archive" do
archive = template.archive_path
- logo = Rails.root.join("app/assets/images/#{template.logo_path}")
expect(File.exist?(archive)).to be(true)
- expect(File.exist?(logo)).to be(true)
+ end
+
+ context 'with valid parameters' do
+ it 'can be imported' do
+ params = {
+ template_name: template.name,
+ namespace_id: admin.namespace.id,
+ path: template.name
+ }
+
+ project = Projects::CreateFromTemplateService.new(admin, params).execute
+
+ expect(project).to be_valid
+ expect(project).to be_persisted
+ end
end
end
end