2017-06-26 00:21:33 +00:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
2016-09-12 06:14:43 +00:00
|
|
|
exports[`#auth.login should login with email 1`] = `
|
2016-09-11 23:34:57 +00:00
|
|
|
Object {
|
2016-09-12 06:14:43 +00:00
|
|
|
"avatarUrl": "http://example.com/avatar.png",
|
|
|
|
"id": "86fde1d4-0050-428f-9f0b-0bf77f8bdf61",
|
|
|
|
"name": "User 1",
|
2017-06-26 00:21:33 +00:00
|
|
|
"username": "user1",
|
2016-09-11 23:34:57 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2016-09-12 06:14:43 +00:00
|
|
|
exports[`#auth.login should login with username 1`] = `
|
2016-09-11 23:34:57 +00:00
|
|
|
Object {
|
2016-09-12 06:14:43 +00:00
|
|
|
"avatarUrl": "http://example.com/avatar.png",
|
|
|
|
"id": "86fde1d4-0050-428f-9f0b-0bf77f8bdf61",
|
|
|
|
"name": "User 1",
|
2017-06-26 00:21:33 +00:00
|
|
|
"username": "user1",
|
2016-09-11 23:34:57 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2016-09-12 06:14:43 +00:00
|
|
|
exports[`#auth.login should require either username or email 1`] = `
|
2016-09-11 23:34:57 +00:00
|
|
|
Object {
|
2016-09-17 21:53:30 +00:00
|
|
|
"error": "validation_error",
|
|
|
|
"message": "username/email is required",
|
|
|
|
"ok": false,
|
2017-06-26 00:21:33 +00:00
|
|
|
"status": 400,
|
2016-09-11 23:34:57 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2016-09-12 06:14:43 +00:00
|
|
|
exports[`#auth.login should require password 1`] = `
|
2016-09-11 23:34:57 +00:00
|
|
|
Object {
|
2016-09-17 21:53:30 +00:00
|
|
|
"error": "validation_error",
|
|
|
|
"message": "username/email is required",
|
|
|
|
"ok": false,
|
2017-06-26 00:21:33 +00:00
|
|
|
"status": 400,
|
2016-09-11 23:34:57 +00:00
|
|
|
}
|
|
|
|
`;
|
2016-09-12 05:44:44 +00:00
|
|
|
|
2016-09-12 06:14:43 +00:00
|
|
|
exports[`#auth.login should validate password 1`] = `
|
2016-09-12 05:44:44 +00:00
|
|
|
Object {
|
2016-09-17 21:53:30 +00:00
|
|
|
"error": "validation_error",
|
|
|
|
"message": "username/email is required",
|
|
|
|
"ok": false,
|
2017-06-26 00:21:33 +00:00
|
|
|
"status": 400,
|
2016-09-12 05:44:44 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2016-09-12 06:14:43 +00:00
|
|
|
exports[`#auth.signup should require params 1`] = `
|
2016-09-12 05:44:44 +00:00
|
|
|
Object {
|
2016-09-17 21:53:30 +00:00
|
|
|
"error": "validation_error",
|
|
|
|
"message": "name is required",
|
|
|
|
"ok": false,
|
2017-06-26 00:21:33 +00:00
|
|
|
"status": 400,
|
2016-09-12 05:44:44 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2016-09-12 06:14:43 +00:00
|
|
|
exports[`#auth.signup should require unique email 1`] = `
|
2016-09-12 05:44:44 +00:00
|
|
|
Object {
|
2016-09-17 21:53:30 +00:00
|
|
|
"error": "user_exists_with_email",
|
|
|
|
"message": "User already exists with this email",
|
|
|
|
"ok": false,
|
2017-06-26 00:21:33 +00:00
|
|
|
"status": 400,
|
2016-09-12 05:44:44 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2016-09-12 06:14:43 +00:00
|
|
|
exports[`#auth.signup should require unique username 1`] = `
|
2016-09-12 05:44:44 +00:00
|
|
|
Object {
|
2016-09-17 21:53:30 +00:00
|
|
|
"error": "user_exists_with_username",
|
|
|
|
"message": "User already exists with this username",
|
|
|
|
"ok": false,
|
2017-06-26 00:21:33 +00:00
|
|
|
"status": 400,
|
2016-09-12 05:44:44 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2016-09-12 06:14:43 +00:00
|
|
|
exports[`#auth.signup should require valid email 1`] = `
|
2016-09-12 05:44:44 +00:00
|
|
|
Object {
|
2016-09-17 21:53:30 +00:00
|
|
|
"error": "validation_error",
|
|
|
|
"message": "email is invalid",
|
|
|
|
"ok": false,
|
2017-06-26 00:21:33 +00:00
|
|
|
"status": 400,
|
2016-09-12 05:44:44 +00:00
|
|
|
}
|
|
|
|
`;
|