TRF Certest first commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Api;
|
||||
|
||||
use Tests\Feature\ApiTestCase;
|
||||
use Vanguard\Country;
|
||||
use Vanguard\Http\Resources\CountryResource;
|
||||
|
||||
class CountriesControllerTest extends ApiTestCase
|
||||
{
|
||||
/** @test */
|
||||
public function unauthenticated()
|
||||
{
|
||||
$this->getJson('/api/countries')->assertStatus(401);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function get_all_countries()
|
||||
{
|
||||
$this->login();
|
||||
|
||||
$this->getJson('/api/countries')
|
||||
->assertOk()
|
||||
->assertJson([
|
||||
'data' => CountryResource::collection(Country::all())->resolve(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user