fix teacher page

This commit is contained in:
root
2026-06-04 19:26:24 -04:00
parent 6408906f07
commit 6fa656bb6c
9 changed files with 1370 additions and 4 deletions
@@ -0,0 +1,45 @@
<?php
namespace Tests\Feature;
use App\Models\User;
use Illuminate\Encryption\Encrypter;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class TeacherAbsenceVacationRouteTest extends TestCase
{
use RefreshDatabase;
protected function setUp(): void
{
parent::setUp();
$key = 'base64:'.base64_encode(random_bytes(32));
config([
'app.key' => $key,
'app.cipher' => 'aes-256-cbc',
]);
$rawKey = base64_decode(substr($key, 7), true);
$this->app->instance('encrypter', new Encrypter($rawKey, 'aes-256-cbc'));
}
public function test_authenticated_teacher_absence_vacation_route_redirects_to_spa_page(): void
{
$user = User::factory()->create();
$response = $this->actingAs($user)->get('/teacher/absence-vacation');
$response->assertRedirect('/app/teacher/absence-vacation');
}
public function test_authenticated_legacy_teacher_absence_vacation_route_redirects_to_spa_page(): void
{
$user = User::factory()->create();
$response = $this->actingAs($user)->get('/teacher/absence_vacation');
$response->assertRedirect('/app/teacher/absence-vacation');
}
}