aboutsummaryrefslogtreecommitdiffstats
path: root/tests/route_tests.rs
diff options
context:
space:
mode:
authorYigit Sever2021-04-13 04:51:19 +0300
committerYigit Sever2021-04-13 04:51:19 +0300
commit116af4059f43eb3986b54fee080af9f67c247472 (patch)
tree387c03347f7d72fe949861518cfc606759b4c4a2 /tests/route_tests.rs
parent14b6904f00a17d3d6757a7e5222df966aa37fa35 (diff)
downloadgradecoin-116af4059f43eb3986b54fee080af9f67c247472.tar.gz
gradecoin-116af4059f43eb3986b54fee080af9f67c247472.tar.bz2
gradecoin-116af4059f43eb3986b54fee080af9f67c247472.zip
Require authorization for Block POST
Not tested because it's impossible to follow without verbose error messages, failing 1 test
Diffstat (limited to 'tests/route_tests.rs')
-rw-r--r--tests/route_tests.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/route_tests.rs b/tests/route_tests.rs
index ba3ecf3..57c4870 100644
--- a/tests/route_tests.rs
+++ b/tests/route_tests.rs
@@ -263,13 +263,14 @@ sQIDAQAB
263 /// Should accept the json request, create 263 /// Should accept the json request, create
264 /// the block 264 /// the block
265 #[tokio::test] 265 #[tokio::test]
266 async fn post_block_201() { 266 async fn post_block_auth_201() {
267 let db = mocked_db(); 267 let db = mocked_db();
268 let filter = consensus_routes(db.clone()); 268 let filter = consensus_routes(db.clone());
269 269
270 let res = warp::test::request() 270 let res = warp::test::request()
271 .method("POST") 271 .method("POST")
272 .json(&mocked_block()) 272 .json(&mocked_block())
273 .header("Authorization", "Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aGEiOiIyYjY0OGZmYWI1ZDlhZjFkNWQ1ZmMwNTJmYzllNTFiODgyZmM0ZmIwYzk5ODYwOGM5OTIzMmY5MjgyMDAwMDAwIiwiaWF0IjoxNjE4MzYwNjQxLCJleHAiOjE3MTgyNjA2NDF9.P5L_uZ9lOhRZCbsG9GDXn_rmZat3dP9Y2lbk8GY4Kg4pOxJIklBUxot-TtJzB0vEJFcjnxVnT2lFLCgfdQLHTJvURiW0KRHi94e1Kj8aDXxJ0qjlq4-c1JCZnAIbDpvkFtHNKz04yfyeSR2htJ6kOjlqVpeUhLVokHhi1x-ZUZZSpeGnlIXgi-AcmkEoyOypZGSZgQ1hjID2f18zgfbshgPK4Dr0hiN36wYMB0y0YiikRbvDuGgDzRLN2nitih46-CXTGZMqIRz3eAfM2wuUSH1yhdKi5_vavz8L3EPVCGMO-CKlPUDkYA-duQZf_q3tG2fkdaFlTAcCik_kVMprdw")
273 .path("/block") 274 .path("/block")
274 .reply(&filter) 275 .reply(&filter)
275 .await; 276 .await;