Test cleanup
This commit is contained in:
+31
-23
@@ -156,28 +156,28 @@ pub const TEST_MESSAGE_CONTENT: &str = "The wind cries mary";
|
||||
|
||||
pub fn test_mer_response() -> serde_json::Value {
|
||||
serde_json::json!({
|
||||
"account_sid": "34n97yf342y5fc349287yndx3987i4yf5c3w98dy398",
|
||||
"api_version": "2010-04-01",
|
||||
"body": "HEALINGHURTS.LETITIN.TONIGHT!GOATROPE.TRASHTHERENTAL.THEGHOSTYOUKNOW.SUMOFTHEBROTHERS.10PM.THESTAMP!VERO.LOVEYOURBLOOD.LOVE&LIGHT🙏🔥",
|
||||
"date_created": "Sat, 20 Jun 2026 15:45:01 +0000",
|
||||
"date_sent": null,
|
||||
"date_updated": "Sat, 20 Jun 2026 15:45:01 +0000",
|
||||
"direction": "outbound-api",
|
||||
"error_code": null,
|
||||
"error_message": null,
|
||||
"from": "+10123456789",
|
||||
"messaging_service_sid": "329nc29yrc394ytw37yc4t9w37ytnfdxcw39874ydx98347yr",
|
||||
"num_media": "0",
|
||||
"num_segments": "0",
|
||||
"price": null,
|
||||
"price_unit": null,
|
||||
"sid": "34niyt3i47ytfdi37w4ydtrn837q4itfyb3qi4ftciq38w7t83qw49td38dtn",
|
||||
"status": "accepted",
|
||||
"subresource_uris": {
|
||||
"media": "/2010-04-01/Accounts/34n97yf342y5fc349287yndx3987i4yf5c3w98dy398/Messages/329nc29yrc394ytw37yc4t9w37ytnfdxcw39874ydx98347yr/Media.json"
|
||||
},
|
||||
"to": "+11234567890",
|
||||
"uri": "/2010-04-01/Accounts/34n97yf342y5fc349287yndx3987i4yf5c3w98dy398/Messages/329nc29yrc394ytw37yc4t9w37ytnfdxcw39874ydx98347yr.json"
|
||||
"account_sid": "34n97yf342y5fc349287yndx3987i4yf5c3w98dy398",
|
||||
"api_version": "2010-04-01",
|
||||
"body": "HEALINGHURTS.LETITIN.TONIGHT!GOATROPE.TRASHTHERENTAL.THEGHOSTYOUKNOW.SUMOFTHEBROTHERS.10PM.THESTAMP!VERO.LOVEYOURBLOOD.LOVE&LIGHT🙏🔥",
|
||||
"date_created": "Sat, 20 Jun 2026 15:45:01 +0000",
|
||||
"date_sent": null,
|
||||
"date_updated": "Sat, 20 Jun 2026 15:45:01 +0000",
|
||||
"direction": "outbound-api",
|
||||
"error_code": null,
|
||||
"error_message": null,
|
||||
"from": "+10123456789",
|
||||
"messaging_service_sid": "329nc29yrc394ytw37yc4t9w37ytnfdxcw39874ydx98347yr",
|
||||
"num_media": "0",
|
||||
"num_segments": "0",
|
||||
"price": null,
|
||||
"price_unit": null,
|
||||
"sid": "34niyt3i47ytfdi37w4ydtrn837q4itfyb3qi4ftciq38w7t83qw49td38dtn",
|
||||
"status": "accepted",
|
||||
"subresource_uris": {
|
||||
"media": "/2010-04-01/Accounts/34n97yf342y5fc349287yndx3987i4yf5c3w98dy398/Messages/329nc29yrc394ytw37yc4t9w37ytnfdxcw39874ydx98347yr/Media.json"
|
||||
},
|
||||
"to": "+11234567890",
|
||||
"uri": "/2010-04-01/Accounts/34n97yf342y5fc349287yndx3987i4yf5c3w98dy398/Messages/329nc29yrc394ytw37yc4t9w37ytnfdxcw39874ydx98347yr.json"
|
||||
})
|
||||
}
|
||||
|
||||
@@ -358,11 +358,19 @@ mod request {
|
||||
contact_id: &uuid::Uuid,
|
||||
message_id: &uuid::Uuid,
|
||||
) -> Result<axum::response::Response, axum::http::Error> {
|
||||
let sent = time::OffsetDateTime::now_utc();
|
||||
let sent = match super::super::super::convert_time_to_iso(sent) {
|
||||
Ok(t) => t,
|
||||
Err(err) => {
|
||||
assert!(false, "Error: {err:?}");
|
||||
String::new()
|
||||
}
|
||||
};
|
||||
let payload = serde_json::json!({
|
||||
"scheduled_message_event_id": scheduled_message_event_id,
|
||||
"response": super::super::super::test_mer_response(),
|
||||
"user_id": user_id,
|
||||
"sent": "2026-06-20T17:10:00Z",
|
||||
"sent": sent,
|
||||
"status": textsender_models::message::event::MESSAGE_EVENT_RESPONSE_STATUS_SCHEDULED,
|
||||
"contact_id": contact_id,
|
||||
"message_id": message_id
|
||||
|
||||
Reference in New Issue
Block a user