pinakes-server: add more route tests
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ief16a2b3181bfa50193fb69a5ad4a9166a6a6964
This commit is contained in:
parent
d26f237828
commit
f1eacc8484
5 changed files with 295 additions and 8 deletions
|
|
@ -7,6 +7,7 @@ use common::{
|
|||
get_authed,
|
||||
patch_json_authed,
|
||||
post_json_authed,
|
||||
put_json_authed,
|
||||
response_body,
|
||||
setup_app,
|
||||
setup_app_with_auth,
|
||||
|
|
@ -207,6 +208,22 @@ async fn get_user_libraries_requires_admin() {
|
|||
assert_eq!(response.status(), StatusCode::FORBIDDEN);
|
||||
}
|
||||
|
||||
// PUT coverage
|
||||
|
||||
#[tokio::test]
|
||||
async fn update_sync_device_requires_editor() {
|
||||
let (app, _, _, viewer_token) = setup_app_with_auth().await;
|
||||
let response = app
|
||||
.oneshot(put_json_authed(
|
||||
"/api/v1/sync/devices/00000000-0000-0000-0000-000000000000",
|
||||
r#"{"name":"device"}"#,
|
||||
&viewer_token,
|
||||
))
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(response.status(), StatusCode::FORBIDDEN);
|
||||
}
|
||||
|
||||
// No-auth coverage (exercises setup_app and get helpers)
|
||||
|
||||
#[tokio::test]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue