2024-05-02 10:06:39 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Feature\Auth;
|
|
|
|
|
2024-05-29 13:40:28 +03:00
|
|
|
use App\Models\Department;
|
2024-05-02 10:06:39 +03:00
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
use Tests\TestCase;
|
|
|
|
|
|
|
|
class RegistrationTest extends TestCase
|
|
|
|
{
|
|
|
|
use RefreshDatabase;
|
|
|
|
|
2024-05-02 17:02:46 +03:00
|
|
|
public function testRegistrationScreenCanBeRendered(): void
|
2024-05-02 10:06:39 +03:00
|
|
|
{
|
|
|
|
$response = $this->get('/register');
|
|
|
|
|
|
|
|
$response->assertStatus(200);
|
|
|
|
}
|
|
|
|
|
2024-05-02 17:02:46 +03:00
|
|
|
public function testNewUsersCanRegister(): void
|
2024-05-02 10:06:39 +03:00
|
|
|
{
|
|
|
|
$response = $this->post('/register', [
|
|
|
|
'name' => 'Test User',
|
|
|
|
'email' => 'test@example.com',
|
|
|
|
'password' => 'password',
|
|
|
|
'password_confirmation' => 'password',
|
|
|
|
]);
|
|
|
|
|
|
|
|
$this->assertAuthenticated();
|
|
|
|
$response->assertRedirect(route('dashboard', absolute: false));
|
|
|
|
}
|
|
|
|
}
|