fanatic/tests/Feature/SessionsTest.php

17 lines
388 B
PHP
Raw Normal View History

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