mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-12 18:45:41 +00:00
mcaptcah uses const routes
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user