Commit a98ad03b 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
parents b89ae830 e6968964
......@@ -11,6 +11,9 @@ Please view this file on the master branch, on stable branches it's out of date.
- Use MergeRequestsClosingIssues cache data on Issue#closed_by_merge_requests method
- Fix documents and comments on Build API `scope`
## 8.13.1 (unreleased)
- Fix error in generating labels
## 8.13.0 (2016-10-22)
- Fix save button on project pipeline settings page. (!6955)
......
......@@ -19,7 +19,7 @@ module Gitlab
]
labels.each do |params|
::Labels::FindOrCreateService.new(project.owner, project).execute(params)
::Labels::FindOrCreateService.new(project.owner, project, params).execute
end
end
end
......
......@@ -70,4 +70,19 @@ describe Projects::LabelsController do
get :index, namespace_id: project.namespace.to_param, project_id: project.to_param
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
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