19 lines
408 B
PHP
19 lines
408 B
PHP
<?php
|
|
|
|
use App\Http\Resources\CountryResource;
|
|
use App\Models\Country;
|
|
|
|
test('unauthenticated', function () {
|
|
$this->getJson('/api/countries')->assertStatus(401);
|
|
});
|
|
|
|
test('get all countries', function () {
|
|
$this->login();
|
|
|
|
$this->getJson('/api/countries')
|
|
->assertOk()
|
|
->assertJson([
|
|
'data' => CountryResource::collection(Country::all())->resolve(),
|
|
]);
|
|
});
|