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
commit8b50bf2e66f02e64e7fbec8079094bafb5ccdc6a (patch)
tree615f6254a326077f83aa5200c822bceb823696e0 /tests/route_tests.rs
parent0158bc39981a751d53e2d12633d179d22484c791 (diff)
downloadgradecoin-8b50bf2e66f02e64e7fbec8079094bafb5ccdc6a.tar.gz
gradecoin-8b50bf2e66f02e64e7fbec8079094bafb5ccdc6a.tar.bz2
gradecoin-8b50bf2e66f02e64e7fbec8079094bafb5ccdc6a.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;