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
This commit is contained in:
Rémy Coutable 2016-10-22 12:52:02 +00:00
commit a98ad03ba1
3 changed files with 19 additions and 1 deletions

View file

@ -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)

View file

@ -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

View file

@ -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