create([ 'name' => 'Amarul Author', 'username' => 'amarul', 'email' => 'amarul@example.com', ]); $role = Role::query()->create(['name' => 'Writer']); $author->roles()->attach($role); $this->get('/author/amarul') ->assertSuccessful() ->assertSee('Amarul Author') ->assertSee('@amarul') ->assertSee('Writer') ->assertDontSee('amarul@example.com'); }); test('author profile returns not found for unknown username', function () { $this->get('/author/missing-author')->assertNotFound(); });