diff options
Diffstat (limited to 'tests/route_tests.rs')
-rw-r--r-- | tests/route_tests.rs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/route_tests.rs b/tests/route_tests.rs index ce7d704..bae58ee 100644 --- a/tests/route_tests.rs +++ b/tests/route_tests.rs | |||
@@ -1,6 +1,8 @@ | |||
1 | #[cfg(test)] | 1 | #[cfg(test)] |
2 | mod tests { | 2 | mod tests { |
3 | use gradecoin::schema::{create_database, AuthRequest, Block, Db, MetuId, Transaction, User}; | 3 | use gradecoin::schema::{ |
4 | create_database, AuthRequest, Block, Db, InitialAuthRequest, MetuId, Transaction, User, | ||
5 | }; | ||
4 | 6 | ||
5 | use gradecoin::routes::consensus_routes; | 7 | use gradecoin::routes::consensus_routes; |
6 | use warp::http::StatusCode; | 8 | use warp::http::StatusCode; |
@@ -440,6 +442,21 @@ FQIDAQAB | |||
440 | #[tokio::test] | 442 | #[tokio::test] |
441 | async fn user_authentication() { | 443 | async fn user_authentication() { |
442 | let db = mocked_db(); | 444 | let db = mocked_db(); |
445 | let filter = consensus_routes(db); | ||
446 | |||
447 | let res = warp::test::request() | ||
448 | .method("POST") | ||
449 | .json(&InitialAuthRequest { | ||
450 | c: "llqkPAX8oGxBLFHGMNzwrCAP2WmsGZlOcm3mCp7+ZnX9p7BPffRvGcYHpif4htwU5RyR3fLo/VWERXqddVQkxhfuum0dFn1cpPfYTokc2BHpi61i4SXCaCHlJDxCtCKnujfEzMnS5hAKMQSyrwq/DPBwOSQ/XQeeMB0YF+l+ZfVJ8e6sQ5FfSK9rSInv+TokA7az6vR7Ky5fGjQ0GxKkO+SKLd5eHuGKgQ19JUQrj3k19GJn1h1cmWW1PYqVKFDp/RfWFL9weG8VynRND6xGK5fQarjdG0uMAk8Cy8ItOCAeMnBhUv/P2a721u3tA7L496r4E3ZwdgsiHe4iYzFiAdvWDWsLRlxXS+6Q2vUYSLgcFVsv2jyQ28c/ay3F1hYAHaqN4HiDhKz6bFCiyow1Doya2V24VQm5eUGxXErjEnLY1FWE5sqRn6DUnES3FT8VJoMtnhCFtZhO4Jk0cjh15p9r+vK6uJv0PUCKOOYhghFi5bLL34OpmzoV7u7Fj6tSc/e9UujbCfYc3r9g0oUQ+QKxw6R5Fcqf21TbffxX/i1tKElIhkatfWCaZ+c0scLNL4Jg3KbNqbensOFqzErr12pXHFy7QKXH1usnCJyC+9D7NncxKZ9JuVFJL19Ayq90o/IYWhtVlkhZs/F5UPIhl3G7f8OQ1tUgfdCfiXZ5qgg=".to_owned(), | ||
451 | iv: "RbZzPxu1IL+f+PZ/SJzi/Q==".to_owned(), | ||
452 | key: "baz".to_owned(), | ||
453 | }) | ||
454 | .path("/register") | ||
455 | .reply(&filter) | ||
456 | .await; | ||
457 | |||
458 | println!("{:?}", res); | ||
459 | assert_eq!(res.status(), StatusCode::CREATED); | ||
443 | } | 460 | } |
444 | } | 461 | } |
445 | 462 | ||