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
}
end
it 'creates labels on Project creation if there are templates' do
Label.create!(title: "bug", template: true)
project = create_project(user, opts)
context 'with labels' do
subject(: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')
expect(created_label.project_id).to eq(project.id)
expect(created_label.title).to eq('bug')
context 'using gitlab project import' do
before do
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
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