Last active
February 11, 2021 19:30
-
-
Save jsdecena/49bccc8abd08f0ddd54e325a6c5c246f to your computer and use it in GitHub Desktop.
Article Api Test File
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Feature; | |
class ArticleTest extends TestCase | |
{ | |
/** @test */ | |
public function it_can_create_an_article() | |
{ | |
$data = [ | |
'title' => $this->faker->sentence, | |
'content' => $this->faker->paragraph | |
]; | |
$this->post(route('articles.store'), $data) | |
->assertStatus(201) | |
->assertJson(compact('data')); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment