Fix failing tests due to updates on the return messages.
This commit is contained in:
parent
cd0aed3d54
commit
8dd672776e
5 changed files with 10 additions and 10 deletions
|
@ -58,7 +58,7 @@ module API
|
|||
if key.valid? && user_project.deploy_keys << key
|
||||
present key, with: Entities::SSHKey
|
||||
else
|
||||
render_api_error!("Failed to add key #{key.errors.messages}", 400)
|
||||
render_validation_error!(key)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ module API
|
|||
|
||||
# Validate label names in advance
|
||||
if (errors = validate_label_params(params)).any?
|
||||
render_api_error!("Unable to validate label: #{errors}"}, 400)
|
||||
render_api_error!({ labels: errors }, 400)
|
||||
end
|
||||
|
||||
issue = ::Issues::CreateService.new(user_project, current_user, attrs).execute
|
||||
|
@ -118,7 +118,7 @@ module API
|
|||
|
||||
present issue, with: Entities::Issue
|
||||
else
|
||||
render_api_error!("Unable to create issue #{issue.errors.messages}", 400)
|
||||
render_validation_error!(issue)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -142,7 +142,7 @@ module API
|
|||
|
||||
# Validate label names in advance
|
||||
if (errors = validate_label_params(params)).any?
|
||||
render_api_error!("Unable to validate label: #{errors}"}, 400)
|
||||
render_api_error!({ labels: errors }, 400)
|
||||
end
|
||||
|
||||
issue = ::Issues::UpdateService.new(user_project, current_user, attrs).execute(issue)
|
||||
|
@ -158,7 +158,7 @@ module API
|
|||
|
||||
present issue, with: Entities::Issue
|
||||
else
|
||||
render_api_error!("Unable to update issue #{issue.errors.messages}", 400)
|
||||
render_validation_error!(issue)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ module API
|
|||
if label.valid?
|
||||
present label, with: Entities::Label
|
||||
else
|
||||
render_api_error!("Unable to create label #{label.errors.messages}", 400)
|
||||
render_validation_error!(label)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -90,7 +90,7 @@ module API
|
|||
if label.update(attrs)
|
||||
present label, with: Entities::Label
|
||||
else
|
||||
render_api_error!("Unable to create label #{label.errors.messages}", 400)
|
||||
render_validation_error!(label)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -137,7 +137,7 @@ module API
|
|||
|
||||
# Validate label names in advance
|
||||
if (errors = validate_label_params(params)).any?
|
||||
render_api_error!("Unable to validate label: #{errors}"}, 400)
|
||||
render_api_error!({ labels: errors }, 400)
|
||||
end
|
||||
|
||||
merge_request = ::MergeRequests::UpdateService.new(user_project, current_user, attrs).execute(merge_request)
|
||||
|
|
|
@ -91,8 +91,8 @@ describe API::API, api: true do
|
|||
|
||||
it "should not create group, duplicate" do
|
||||
post api("/groups", admin), {name: "Duplicate Test", path: group2.path}
|
||||
response.status.should == 422
|
||||
response.message.should == "Unprocessable Entity"
|
||||
response.status.should == 400
|
||||
response.message.should == "Bad Request"
|
||||
end
|
||||
|
||||
it "should return 400 bad request error if name not given" do
|
||||
|
|
Loading…
Reference in a new issue