feat: add input validation

This commit is contained in:
Sandro Eiler 2024-02-12 10:55:23 +01:00
parent d7d37341ba
commit 419be581b3
10 changed files with 271 additions and 122 deletions

View file

@ -105,7 +105,7 @@ async fn subscribe_returns_a_200_for_valid_form_data() {
}
#[tokio::test]
async fn subscribe_returns_a_200_when_fields_are_present_but_empty() {
async fn subscribe_returns_a_400_when_fields_are_present_but_invalid() {
// Arrange
let app = spawn_app().await;
let client = reqwest::Client::new();
@ -127,7 +127,7 @@ async fn subscribe_returns_a_200_when_fields_are_present_but_empty() {
// Assert
assert_eq!(
200,
400,
response.status().as_u16(),
"The API did not return a 200 OK when the payload was {}.",
description