Skip to content

Commit

Permalink
add test for now
Browse files Browse the repository at this point in the history
Signed-off-by: Valentin Sickert <[email protected]>
  • Loading branch information
Lapotor committed Dec 11, 2023
1 parent 7f414d6 commit 71e0d8f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/Feature/Http/Middleware/JsonOnlyMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,23 @@ public function test_json_requests_are_accepted(): void

$user->delete();
}

/**
* Test that empty requests are accepted.
*/
public function test_empty_requests_are_accepted(): void
{

$response = $this->post(uri: '/api/v1/login', headers: ['Accept' => 'application/json']);

$response->assertStatus(422)
->assertJson([
'message' => 'The email field is required. (and 1 more error)',
'errors' => [
'email' => ['The email field is required.'],
'password' => ['The password field is required.']
]
]);

}
}

0 comments on commit 71e0d8f

Please sign in to comment.