Fix tests, added gh action nuxt step
This commit is contained in:
@@ -5,7 +5,7 @@ use App\Models\User;
|
||||
it('can login to Forms', function () {
|
||||
$user = User::factory()->create();
|
||||
|
||||
$this->postJson('/api/login', [
|
||||
$this->postJson('/login', [
|
||||
'email' => $user->email,
|
||||
'password' => 'password',
|
||||
])
|
||||
@@ -16,23 +16,23 @@ it('can login to Forms', function () {
|
||||
|
||||
it('can fetch current user', function () {
|
||||
$this->actingAs(User::factory()->create())
|
||||
->getJson('/api/user')
|
||||
->getJson('/user')
|
||||
->assertSuccessful()
|
||||
->assertJsonStructure(['id', 'name', 'email']);
|
||||
});
|
||||
|
||||
it('can log out', function () {
|
||||
$this->postJson('/api/login', [
|
||||
$this->postJson('/login', [
|
||||
'email' => User::factory()->create()->email,
|
||||
'password' => 'password',
|
||||
])->assertSuccessful();
|
||||
|
||||
$this->assertAuthenticated();
|
||||
$this->postJson("/api/logout")
|
||||
$this->postJson("/logout")
|
||||
->assertSuccessful();
|
||||
|
||||
$this->assertGuest();
|
||||
$this->getJson("/api/user")
|
||||
$this->getJson("/user")
|
||||
->assertStatus(401);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user