feat: add auth things
This commit is contained in:
parent
42a75ba800
commit
88c4045d33
7 changed files with 182 additions and 20 deletions
|
|
@ -21,7 +21,7 @@ async fn test_quick_dev() -> Result<()> {
|
|||
json!(
|
||||
{
|
||||
"username": "demo1",
|
||||
"password": "demo1"
|
||||
"password": "demowrong"
|
||||
}
|
||||
)
|
||||
);
|
||||
|
|
@ -31,7 +31,7 @@ async fn test_quick_dev() -> Result<()> {
|
|||
json!(
|
||||
{
|
||||
"username": "demo1",
|
||||
"password": "demowrong"
|
||||
"password": "demo1"
|
||||
}
|
||||
)
|
||||
);
|
||||
|
|
@ -39,5 +39,34 @@ async fn test_quick_dev() -> Result<()> {
|
|||
|
||||
hc.do_get("/hello2/mike").await?.print().await?;
|
||||
|
||||
let req_create_property = hc.do_post(
|
||||
"/api/properties",
|
||||
json!(
|
||||
{
|
||||
"address": "Lolilat Street 1",
|
||||
"contact": "01234 567890"
|
||||
}
|
||||
)
|
||||
);
|
||||
req_create_property.await?.print().await?;
|
||||
let req_create_property = hc.do_post(
|
||||
"/api/properties",
|
||||
json!(
|
||||
{
|
||||
"address": "Lolilat Street 2",
|
||||
"contact": "01243 217890"
|
||||
}
|
||||
)
|
||||
);
|
||||
req_create_property.await?.print().await?;
|
||||
let req_get_properties = hc.do_get("/api/properties").await?;
|
||||
req_get_properties.print().await?;
|
||||
let req_delete_property = hc.do_delete("/api/properties/1").await?;
|
||||
req_delete_property.print().await?;
|
||||
let req_get_properties = hc.do_get("/api/properties").await?;
|
||||
req_get_properties.print().await?;
|
||||
let req_delete_property = hc.do_delete("/api/properties/0").await?;
|
||||
req_delete_property.print().await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue