assertRedirect(route('dashboard')) ->assertSessionHas('error', 'You are not authorized to perform this action'); }); it('ignores requests from tabulation users', function () { // Arrange actAsTab(); get(route('admin.signInSheets.index')) ->assertRedirect(route('dashboard')) ->assertSessionHas('error', 'You are not authorized to perform this action'); }); it('ignores requests from guests', function () { // Arrange get(route('admin.signInSheets.index')) ->assertRedirect(route('home')); }); it('allows access to admin users', function () { // Arrange actAsAdmin(); // Act and Assert get(route('admin.signInSheets.index')) ->assertOk() ->assertViewIs('admin.print_sign_in_sheets.index') ->assertSessionHasNoErrors(); }); it('shows rooms', function () { $room = Room::factory()->create(); actAsAdmin(); get(route('admin.signInSheets.index')) ->assertSee($room->name); }); // Process the form and print the sheets