summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2017-02-24 20:13:27 +0100
committerRobert Schilling <rschilling@student.tugraz.at>2017-02-24 20:13:27 +0100
commit0394055112fc0fe947aa13bc049f03a0dc1db0d1 (patch)
tree186fdd2fd73af7f6c2c7412dd0c4a3016bad8cdc /spec
parent52ceaa2406d48151c4158efd46032767bdd8ad1c (diff)
downloadgitlab-ce-0394055112fc0fe947aa13bc049f03a0dc1db0d1.tar.gz
API: Return 400 for all validation erros in the mebers APIunified-member-api-response
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/members_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/requests/api/members_spec.rb b/spec/requests/api/members_spec.rb
index 31166b50033..127498ed109 100644
--- a/spec/requests/api/members_spec.rb
+++ b/spec/requests/api/members_spec.rb
@@ -173,11 +173,11 @@ describe API::Members, api: true do
expect(response).to have_http_status(400)
end
- it 'returns 422 when access_level is not valid' do
+ it 'returns 400 when access_level is not valid' do
post api("/#{source_type.pluralize}/#{source.id}/members", master),
user_id: stranger.id, access_level: 1234
- expect(response).to have_http_status(422)
+ expect(response).to have_http_status(400)
end
end
end
@@ -230,11 +230,11 @@ describe API::Members, api: true do
expect(response).to have_http_status(400)
end
- it 'returns 422 when access level is not valid' do
+ it 'returns 400 when access level is not valid' do
put api("/#{source_type.pluralize}/#{source.id}/members/#{developer.id}", master),
access_level: 1234
- expect(response).to have_http_status(422)
+ expect(response).to have_http_status(400)
end
end
end
@@ -342,7 +342,7 @@ describe API::Members, api: true do
post api("/projects/#{project.id}/members", master),
user_id: stranger.id, access_level: Member::OWNER
- expect(response).to have_http_status(422)
+ expect(response).to have_http_status(400)
end.to change { project.members.count }.by(0)
end
end