diff --git a/tests/Feature/ContactFormTest.php b/tests/Feature/ContactFormTest.php new file mode 100644 index 0000000..736bcf2 --- /dev/null +++ b/tests/Feature/ContactFormTest.php @@ -0,0 +1,28 @@ + 'John Doe', + 'email' => 'johndoe@example.com', + 'content' => 'Hello, this is a test message.', + ]; + + $response = $this->postJson('/api/contact', $formData); + $response->assertStatus(201); + + $formData = [ + 'name' => 'John Doe', + 'content' => 'Hello, this is a test message.', + ]; + + $response = $this->postJson('/api/contact', $formData); + $response->assertStatus(422); + } +} diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php deleted file mode 100644 index 1eafba6..0000000 --- a/tests/Feature/ExampleTest.php +++ /dev/null @@ -1,21 +0,0 @@ -get('/'); - - $response->assertStatus(200); - } -}