summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-11-10 09:54:23 +0000
committerRémy Coutable <remy@rymai.me>2016-11-10 09:54:23 +0000
commite3dcd83d4a4b75dc050592ea008dc34ecbe0aa49 (patch)
treed9f7b417dd386c2fa166661f5c3392c5f4908a5b /spec
parenta29544f5fee8ba65fcfea0689b0c60b77d8784ab (diff)
parent603ebe55f0232f16b5f1db95d2962a4cf5cdcc1b (diff)
downloadgitlab-ce-e3dcd83d4a4b75dc050592ea008dc34ecbe0aa49.tar.gz
Merge branch 'grapify-session-api' into 'master'
Grapify the session API ## What are the relevant issue numbers? Related to #22928 See merge request !7381
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/session_spec.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/spec/requests/api/session_spec.rb b/spec/requests/api/session_spec.rb
index acad1365ace..e3f22b4c578 100644
--- a/spec/requests/api/session_spec.rb
+++ b/spec/requests/api/session_spec.rb
@@ -67,22 +67,24 @@ describe API::API, api: true do
end
context "when empty password" do
- it "returns authentication error" do
+ it "returns authentication error with email" do
post api("/session"), email: user.email
- expect(response).to have_http_status(401)
- expect(json_response['email']).to be_nil
- expect(json_response['private_token']).to be_nil
+ expect(response).to have_http_status(400)
+ end
+
+ it "returns authentication error with username" do
+ post api("/session"), email: user.username
+
+ expect(response).to have_http_status(400)
end
end
context "when empty name" do
it "returns authentication error" do
post api("/session"), password: user.password
- expect(response).to have_http_status(401)
- expect(json_response['email']).to be_nil
- expect(json_response['private_token']).to be_nil
+ expect(response).to have_http_status(400)
end
end
end