get('/role')->assertRedirect('/login'); }); test('authenticated users can view the role index', function () { Role::query()->create(['name' => 'Admin']); Role::query()->create(['name' => 'Editor']); $response = $this ->actingAs(User::factory()->create()) ->get('/role'); $response ->assertSuccessful() ->assertSee('Roles') ->assertSee('Admin') ->assertSee('Editor'); });