diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2015-01-07 13:39:20 +0300 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2015-01-07 13:39:20 +0300 |
commit | 8dd672776ee72990fd41b37559a8ba102595d6ca (patch) | |
tree | af57df7a2013883162ebff91de1a6f3ede775194 /lib | |
parent | cd0aed3d54fc01d0c361a8cf282d2de48297f66a (diff) |
Fix failing tests due to updates on the return messages.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/deploy_keys.rb | 2 | ||||
-rw-r--r-- | lib/api/issues.rb | 8 | ||||
-rw-r--r-- | lib/api/labels.rb | 4 | ||||
-rw-r--r-- | lib/api/merge_requests.rb | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/api/deploy_keys.rb b/lib/api/deploy_keys.rb index dd4b761feb2..06eb7756841 100644 --- a/lib/api/deploy_keys.rb +++ b/lib/api/deploy_keys.rb @@ -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 diff --git a/lib/api/issues.rb b/lib/api/issues.rb index 01496c39955..d2828b24c36 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -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 diff --git a/lib/api/labels.rb b/lib/api/labels.rb index e8ded662253..78ca58ad0d1 100644 --- a/lib/api/labels.rb +++ b/lib/api/labels.rb @@ -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 diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb index 1a73c4943b8..81038d05f12 100644 --- a/lib/api/merge_requests.rb +++ b/lib/api/merge_requests.rb @@ -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) |