mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-16 04:51:18 +00:00
fix: remove duplicate admin_login function
This commit is contained in:
parent
cdf75d3eec
commit
1eb026aa2c
2 changed files with 3 additions and 22 deletions
|
|
@ -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!(
|
||||
|
|
|
|||
|
|
@ -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\",
|
||||
|
|
|
|||
Loading…
Reference in a new issue