feat: add input validation
This commit is contained in:
parent
d7d37341ba
commit
419be581b3
10 changed files with 271 additions and 122 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue