Init
This commit is contained in:
29
tests/Feature/Auth/RegistrationTest.php
Normal file
29
tests/Feature/Auth/RegistrationTest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Auth;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Spatie\Permission\Models\Role;
|
||||
use Tests\TestCase;
|
||||
|
||||
class RegistrationTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_new_users_can_register(): void
|
||||
{
|
||||
$role = Role::create(['name' => 'user']);
|
||||
|
||||
$response = $this->post('/api/v1/register', [
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@example.com',
|
||||
'password' => 'password',
|
||||
'password_confirmation' => 'password',
|
||||
]);
|
||||
|
||||
$response->assertCreated();
|
||||
$response->assertJson(['ok' => true], true);
|
||||
|
||||
$role->delete();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user