fanatic/tests/Feature/SessionsTest.php
Marley Rae 259ebe827c tests
2022-04-27 18:41:16 -07:00

16 lines
388 B
PHP

<?php
use App\Models\Collective;
uses()->group('sessions', 'admin');
test('dashboard hidden for guests', function () {
$response = $this->get('/fanatic');
$response->assertRedirect('/fanatic/login');
});
test('logs in', function () {
$user = Collective::first();
$response = $this->actingAs($user)->get('/fanatic');
$response->assertViewIs('admin.dashboard');
});