tests: add test for email format
TODO: actually test items/sync
This commit is contained in:
parent
847dfd80dd
commit
3541ee1d7f
16
src/tests.rs
16
src/tests.rs
|
@ -59,6 +59,22 @@ fn should_not_add_user_twice() {
|
||||||
assert_eq!(resp.status(), Status::InternalServerError);
|
assert_eq!(resp.status(), Status::InternalServerError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn should_not_add_user_invalid_email() {
|
||||||
|
let resp = CLIENT
|
||||||
|
.post("/auth")
|
||||||
|
.header(ContentType::JSON)
|
||||||
|
.body(r#"{
|
||||||
|
"email": "test.example.com",
|
||||||
|
"password": "testpw",
|
||||||
|
"pw_cost": 100,
|
||||||
|
"pw_nonce": "whatever",
|
||||||
|
"version": "001"
|
||||||
|
}"#)
|
||||||
|
.dispatch();
|
||||||
|
assert_eq!(resp.status(), Status::BadRequest);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn should_log_in_successfully() {
|
fn should_log_in_successfully() {
|
||||||
CLIENT.post("/auth")
|
CLIENT.post("/auth")
|
||||||
|
|
Loading…
Reference in a new issue