fix: remove duplicate admin_login function

This commit is contained in:
Sebastian Pravda 2022-11-21 18:01:42 +01:00
parent cdf75d3eec
commit 1eb026aa2c
No known key found for this signature in database
GPG key ID: F3BC84F08EFA3F57
2 changed files with 3 additions and 22 deletions

View file

@ -159,12 +159,12 @@ pub async fn get_candidate_portfolio(
}
#[cfg(test)]
mod tests {
pub mod tests {
use rocket::{local::blocking::Client, http::{Cookie, Status}};
use crate::test::tests::{test_client, ADMIN_PASSWORD, ADMIN_ID};
fn admin_login(client: &Client) -> (Cookie, Cookie) {
pub fn admin_login(client: &Client) -> (Cookie, Cookie) {
let response = client
.post("/admin/login")
.body(format!(

View file

@ -289,7 +289,7 @@ mod tests {
local::blocking::Client,
};
use crate::test::tests::{test_client, APPLICATION_ID, CANDIDATE_PASSWORD, ADMIN_PASSWORD, ADMIN_ID};
use crate::{test::tests::{test_client, APPLICATION_ID, CANDIDATE_PASSWORD}, routes::admin::tests::admin_login};
fn candidate_login(client: &Client) -> (Cookie, Cookie) {
let response = client
@ -309,25 +309,6 @@ mod tests {
)
}
fn admin_login(client: &Client) -> (Cookie, Cookie) {
let response = client
.post("/admin/login")
.body(format!(
"{{
\"admin_id\": {},
\"password\": \"{}\"
}}",
ADMIN_ID, ADMIN_PASSWORD
))
.dispatch();
println!("{:?}", response);
(
response.cookies().get("id").unwrap().to_owned(),
response.cookies().get("key").unwrap().to_owned(),
)
}
const CANDIDATE_DETAILS: &'static str = "{
\"name\": \"idk\",
\"surname\": \"idk\",