File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,7 @@ async fn test_json_body() -> actix_web::Result<()> {
3131 resp. headers( ) . get( header:: CONTENT_TYPE ) . unwrap( ) ,
3232 "application/json"
3333 ) ;
34- let body = test:: read_body ( resp) . await ;
35- let body_json: serde_json:: Value = serde_json:: from_slice ( & body) . unwrap ( ) ;
34+ let body_json: serde_json:: Value = test:: read_body_json ( resp) . await ;
3635 assert_eq ! (
3736 body_json,
3837 serde_json:: json!( [ { "message" : "It works!" } , { "cool" : "cool" } ] )
@@ -106,8 +105,7 @@ async fn test_accept_json_returns_json_array() -> actix_web::Result<()> {
106105 resp. headers( ) . get( header:: CONTENT_TYPE ) . unwrap( ) ,
107106 "application/json"
108107 ) ;
109- let body = test:: read_body ( resp) . await ;
110- let body_json: serde_json:: Value = serde_json:: from_slice ( & body) . unwrap ( ) ;
108+ let body_json: serde_json:: Value = test:: read_body_json ( resp) . await ;
111109 assert ! ( body_json. is_array( ) ) ;
112110 let arr = body_json. as_array ( ) . unwrap ( ) ;
113111 assert ! ( arr. len( ) >= 2 ) ;
You can’t perform that action at this time.
0 commit comments