Add /api/news route
This commit is contained in:
@@ -62,6 +62,18 @@ class ApiTest extends TestCase
|
||||
$this->get($uri)->assertStatus(401);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test getting the news from the API
|
||||
*/
|
||||
public function testGetNews(): void
|
||||
{
|
||||
factory(App\Models\News::class)->create();
|
||||
$response = $this->get('/api/news')->json();
|
||||
|
||||
$this->assertCount(1, $response['data']);
|
||||
$this->assertTrue(array_key_exists('user', $response['data'][0]));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user