diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2019-01-17 14:46:49 +0100 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2019-01-17 14:46:49 +0100 |
commit | 0dcb11fdae02bbd9760bbec671ec5996161fc945 (patch) | |
tree | 9f5ae2bae1daf06db69a2e3d66f9aa5fa800252d | |
parent | 1a2a34a091b7b4faa29bfcbf7f8e1bd56067ad99 (diff) | |
download | gitlab-ce-56147-bug-gitlab-api-v4-responds-404-when-creating-duplicate-award-emoji-for-notes.tar.gz |
-rw-r--r-- | lib/api/award_emoji.rb | 2 | ||||
-rw-r--r-- | lib/api/helpers.rb | 4 | ||||
-rw-r--r-- | spec/requests/api/award_emoji_spec.rb | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/lib/api/award_emoji.rb b/lib/api/award_emoji.rb index 78ad8302c5e..435d4925be6 100644 --- a/lib/api/award_emoji.rb +++ b/lib/api/award_emoji.rb @@ -74,7 +74,7 @@ module API if award.persisted? present award, with: Entities::AwardEmoji else - not_modified!("Award Emoji #{award.errors.messages}") + not_modified! end end diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index dff5a1af6a3..fa6c9777824 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -343,8 +343,8 @@ module API render_api_error!('413 Request Entity Too Large', 413) end - def not_modified!(message = nil) - render_api_error!(message || '304 Not Modified', 304) + def not_modified! + render_api_error!('304 Not Modified', 304) end def no_content! diff --git a/spec/requests/api/award_emoji_spec.rb b/spec/requests/api/award_emoji_spec.rb index 895789ab15c..562db163255 100644 --- a/spec/requests/api/award_emoji_spec.rb +++ b/spec/requests/api/award_emoji_spec.rb @@ -179,7 +179,6 @@ describe API::AwardEmoji do post api("/projects/#{project.id}/issues/#{issue.iid}/award_emoji", user), params: { name: 'thumbsup' } expect(response).to have_gitlab_http_status(304) - expect(json_response["message"]).to match("has already been taken") end end end @@ -221,7 +220,6 @@ describe API::AwardEmoji do post api("/projects/#{project.id}/issues/#{issue.iid}/notes/#{note.id}/award_emoji", user), params: { name: 'rocket' } expect(response).to have_gitlab_http_status(304) - expect(json_response["message"]).to match("has already been taken") end end end |