mirror of https://github.com/realaravinth/gitpad
feat: utils: ErrorToResponse implements Debug and get_request accepts cookies
parent
632fe272fa
commit
bcb3545f8f
|
@ -174,7 +174,7 @@ use actix_web::{
|
||||||
HttpResponse, HttpResponseBuilder,
|
HttpResponse, HttpResponseBuilder,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
#[cfg(not(tarpaulin_include))]
|
#[cfg(not(tarpaulin_include))]
|
||||||
pub struct ErrorToResponse {
|
pub struct ErrorToResponse {
|
||||||
pub error: String,
|
pub error: String,
|
||||||
|
|
11
src/tests.rs
11
src/tests.rs
|
@ -108,6 +108,17 @@ macro_rules! get_request {
|
||||||
($app:expr,$route:expr ) => {
|
($app:expr,$route:expr ) => {
|
||||||
test::call_service(&$app, test::TestRequest::get().uri($route).to_request()).await
|
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]
|
#[macro_export]
|
||||||
|
|
Loading…
Reference in New Issue