Commit 627eb7d1 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'sh-fix-broken-label-controller' into 'master'

Fix error in generating labels

Attempting to generate default set of labels would result in
an error:

ArgumentError: wrong number of arguments (given 1, expected 0)

Closes #23649

See merge request !7055
Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 5f2d097f
...@@ -9,6 +9,7 @@ Please view this file on the master branch, on stable branches it's out of date. ...@@ -9,6 +9,7 @@ Please view this file on the master branch, on stable branches it's out of date.
- Refactor and add new environment functionality to CI yaml reference. !7026 - Refactor and add new environment functionality to CI yaml reference. !7026
- Fix typo in project settings that prevents users from enabling container registry. !7037 - Fix typo in project settings that prevents users from enabling container registry. !7037
- Remove extra line for empty issue description. !7045 - Remove extra line for empty issue description. !7045
- Fix error in generating labels. !7055
## 8.13.0 (2016-10-22) ## 8.13.0 (2016-10-22)
......
...@@ -19,7 +19,7 @@ module Gitlab ...@@ -19,7 +19,7 @@ module Gitlab
] ]
labels.each do |params| labels.each do |params|
::Labels::FindOrCreateService.new(project.owner, project).execute(params) ::Labels::FindOrCreateService.new(project.owner, project, params).execute
end end
end end
end end
......
...@@ -70,4 +70,19 @@ describe Projects::LabelsController do ...@@ -70,4 +70,19 @@ describe Projects::LabelsController do
get :index, namespace_id: project.namespace.to_param, project_id: project.to_param get :index, namespace_id: project.namespace.to_param, project_id: project.to_param
end end
end end
describe 'POST #generate' do
let(:admin) { create(:admin) }
let(:project) { create(:empty_project) }
before do
sign_in(admin)
end
it 'creates labels' do
post :generate, namespace_id: project.namespace.to_param, project_id: project.to_param
expect(response).to have_http_status(302)
end
end
end end
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