Test payload changes
This commit is contained in:
+19
-17
@@ -327,7 +327,7 @@ mod tests {
|
|||||||
app: &axum::Router,
|
app: &axum::Router,
|
||||||
id: &uuid::Uuid,
|
id: &uuid::Uuid,
|
||||||
) -> Result<axum::response::Response, std::convert::Infallible> {
|
) -> Result<axum::response::Response, std::convert::Infallible> {
|
||||||
let payload = queue_metadata_payload_data(&id).await;
|
let payload = payload_data::queue_metadata_payload_data(&id).await;
|
||||||
|
|
||||||
let req = axum::http::Request::builder()
|
let req = axum::http::Request::builder()
|
||||||
.method(axum::http::Method::POST)
|
.method(axum::http::Method::POST)
|
||||||
@@ -600,22 +600,24 @@ mod tests {
|
|||||||
serde_json::from_slice(&body).unwrap()
|
serde_json::from_slice(&body).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn queue_metadata_payload_data(id: &uuid::Uuid) -> serde_json::Value {
|
pub mod payload_data {
|
||||||
serde_json::json!(
|
pub async fn queue_metadata_payload_data(id: &uuid::Uuid) -> serde_json::Value {
|
||||||
{
|
serde_json::json!(
|
||||||
"id": id,
|
{
|
||||||
"album" : "Machine Gun: The FillMore East First Show",
|
"song_queue_id": id,
|
||||||
"album_artist" : "Jimi Hendrix",
|
"album" : "Machine Gun: The FillMore East First Show",
|
||||||
"artist" : "Jimi Hendrix",
|
"album_artist" : "Jimi Hendrix",
|
||||||
"disc" : 1,
|
"artist" : "Jimi Hendrix",
|
||||||
"disc_count" : 1,
|
"disc" : 1,
|
||||||
"duration" : 330,
|
"disc_count" : 1,
|
||||||
"genre" : "Psychadelic Rock",
|
"duration" : 330,
|
||||||
"title" : "Power of Soul",
|
"genre" : "Psychadelic Rock",
|
||||||
"track" : 1,
|
"title" : "Power of Soul",
|
||||||
"track_count" : 11,
|
"track" : 1,
|
||||||
"year" : 2016
|
"track_count" : 11,
|
||||||
})
|
"year" : 2016
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
|||||||
Reference in New Issue
Block a user