feat: utils: ErrorToResponse implements Debug and get_request accepts cookies

master
Aravinth Manivannan 2022-02-18 22:53:28 +05:30
parent 632fe272fa
commit bcb3545f8f
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
2 changed files with 12 additions and 1 deletions

View File

@ -174,7 +174,7 @@ use actix_web::{
HttpResponse, HttpResponseBuilder,
};
#[derive(Serialize, Deserialize)]
#[derive(Serialize, Deserialize, Debug)]
#[cfg(not(tarpaulin_include))]
pub struct ErrorToResponse {
pub error: String,

View File

@ -108,6 +108,17 @@ macro_rules! get_request {
($app:expr,$route:expr ) => {
test::call_service(&$app, test::TestRequest::get().uri($route).to_request()).await
};
($app:expr, $route:expr, $cookies:expr) => {
test::call_service(
&$app,
test::TestRequest::get()
.uri($route)
.cookie($cookies)
.to_request(),
)
.await
};
}
#[macro_export]