mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 18:15:39 +00:00
duplicate email check and address clippy warnings
This commit is contained in:
@@ -94,10 +94,10 @@ mod tests {
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn error_pages_work() {
|
||||
let mut app = test::init_service(App::new().configure(services)).await;
|
||||
let app = test::init_service(App::new().configure(services)).await;
|
||||
|
||||
let resp = test::call_service(
|
||||
&mut app,
|
||||
&app,
|
||||
test::TestRequest::get()
|
||||
.uri(PAGES.errors.internal_server_error)
|
||||
.to_request(),
|
||||
@@ -106,7 +106,7 @@ mod tests {
|
||||
assert_eq!(resp.status(), StatusCode::INTERNAL_SERVER_ERROR);
|
||||
|
||||
let resp = test::call_service(
|
||||
&mut app,
|
||||
&app,
|
||||
test::TestRequest::get()
|
||||
.uri(PAGES.errors.unknown_error)
|
||||
.to_request(),
|
||||
|
||||
@@ -54,7 +54,7 @@ mod tests {
|
||||
let (data, _, signin_resp) = register_and_signin(NAME, EMAIL, PASSWORD).await;
|
||||
let cookies = get_cookie!(signin_resp);
|
||||
|
||||
let mut app = get_app!(data).await;
|
||||
let app = get_app!(data).await;
|
||||
|
||||
let urls = vec![
|
||||
PAGES.home,
|
||||
@@ -64,14 +64,14 @@ mod tests {
|
||||
|
||||
for url in urls.iter() {
|
||||
let resp = test::call_service(
|
||||
&mut app,
|
||||
&app,
|
||||
test::TestRequest::get().uri(url).to_request(),
|
||||
)
|
||||
.await;
|
||||
assert_eq!(resp.status(), StatusCode::FOUND);
|
||||
|
||||
let authenticated_resp = test::call_service(
|
||||
&mut app,
|
||||
&app,
|
||||
test::TestRequest::get()
|
||||
.uri(url)
|
||||
.cookie(cookies.clone())
|
||||
@@ -87,12 +87,12 @@ mod tests {
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn public_pages_tempaltes_work() {
|
||||
let mut app = test::init_service(App::new().configure(services)).await;
|
||||
let app = test::init_service(App::new().configure(services)).await;
|
||||
let urls = vec![PAGES.auth.login, PAGES.auth.join];
|
||||
|
||||
for url in urls.iter() {
|
||||
let resp = test::call_service(
|
||||
&mut app,
|
||||
&app,
|
||||
test::TestRequest::get().uri(url).to_request(),
|
||||
)
|
||||
.await;
|
||||
|
||||
@@ -87,10 +87,10 @@ mod test {
|
||||
let (data, _, signin_resp, key) = add_levels_util(NAME, PASSWORD).await;
|
||||
let cookies = get_cookie!(signin_resp);
|
||||
|
||||
let mut app = get_app!(data).await;
|
||||
let app = get_app!(data).await;
|
||||
|
||||
let list_sitekey_resp = test::call_service(
|
||||
&mut app,
|
||||
&app,
|
||||
test::TestRequest::get()
|
||||
.uri(PAGES.panel.sitekey.list)
|
||||
.cookie(cookies.clone())
|
||||
|
||||
@@ -123,12 +123,12 @@ mod test {
|
||||
let (data, _, signin_resp, key) = add_levels_util(NAME, PASSWORD).await;
|
||||
let cookies = get_cookie!(signin_resp);
|
||||
|
||||
let mut app = get_app!(data).await;
|
||||
let app = get_app!(data).await;
|
||||
|
||||
let url = format!("/sitekey/{}/view", &key.key);
|
||||
|
||||
let list_sitekey_resp = test::call_service(
|
||||
&mut app,
|
||||
&app,
|
||||
test::TestRequest::get()
|
||||
.uri(&url)
|
||||
.cookie(cookies.clone())
|
||||
|
||||
Reference in New Issue
Block a user