Commit 0890aeb6 authored by Stan Hu's avatar Stan Hu

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
parent 4ae57e0b
......@@ -10,6 +10,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
## 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.code).to eq(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