mcaptcah uses const routes

This commit is contained in:
realaravinth
2021-05-02 16:35:15 +05:30
parent 76ae2b03e9
commit 5361e9b43a
9 changed files with 141 additions and 46 deletions

View File

@@ -68,7 +68,7 @@ pub struct AccountCheckResp {
pub exists: bool,
}
pub fn service(cfg: &mut actix_web::web::ServiceConfig) {
pub fn services(cfg: &mut actix_web::web::ServiceConfig) {
use crate::define_resource;
use crate::V1_API_ROUTES;

View File

@@ -53,6 +53,17 @@ async fn uname_email_exists_works() {
.await;
assert_eq!(resp.status(), StatusCode::OK);
// chech if get user secret works
let resp = test::call_service(
&mut app,
test::TestRequest::post()
.cookie(cookies.clone())
.uri(ROUTES.account.update_secret)
.to_request(),
)
.await;
assert_eq!(resp.status(), StatusCode::OK);
let mut payload = AccountCheckPayload { val: NAME.into() };
let user_exists_resp = test::call_service(