Commit 551b5b0f authored by Arturo Herrero's avatar Arturo Herrero

Add spec to cover that labels are not created

parent 69cc1c31
...@@ -14,15 +14,30 @@ RSpec.describe Projects::CreateService, '#execute' do ...@@ -14,15 +14,30 @@ RSpec.describe Projects::CreateService, '#execute' do
} }
end end
it 'creates labels on Project creation if there are templates' do context 'with labels' do
Label.create!(title: "bug", template: true) subject(:project) { create_project(user, opts) }
project = create_project(user, opts)
before_all do
Label.create!(title: 'bug', template: true)
end
it 'creates labels on project creation' do
created_label = project.labels.last
created_label = project.reload.labels.last expect(created_label.type).to eq('ProjectLabel')
expect(created_label.project_id).to eq(project.id)
expect(created_label.title).to eq('bug')
end
expect(created_label.type).to eq('ProjectLabel') context 'using gitlab project import' do
expect(created_label.project_id).to eq(project.id) before do
expect(created_label.title).to eq('bug') opts[:import_type] = 'gitlab_project'
end
it 'does not creates labels on project creation' do
expect(project.labels.size).to eq(0)
end
end
end end
context 'user namespace' do context 'user namespace' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment