Separated laravel app to its own folder (#540)
This commit is contained in:
24
api/tests/Feature/Zapier/ValidateAuthTest.php
Normal file
24
api/tests/Feature/Zapier/ValidateAuthTest.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
use function Pest\Laravel\get;
|
||||
|
||||
test('validate auth', function () {
|
||||
$user = User::factory()->create();
|
||||
|
||||
Sanctum::actingAs($user);
|
||||
|
||||
get(route('zapier.validate'))
|
||||
->assertOk()
|
||||
->assertJson([
|
||||
'name' => $user->name,
|
||||
'email' => $user->email,
|
||||
]);
|
||||
});
|
||||
|
||||
test('cannot validate auth with incorrect credentials', function () {
|
||||
get(route('zapier.validate'))
|
||||
->assertUnauthorized();
|
||||
});
|
||||
Reference in New Issue
Block a user