Level 102
You could try
$this->get(route('profiles.index'))->assertSeeInOrder($sortUsers);
/** @test */
public function it_shows_top_ten_profiles_according_to_the_reputation_points_earned()
{
$users = create('App\User', [], 20);
$sortUsers = $users->sortByDesc('reputation')->pluck('name')->take(10)->toArray();
$this->get(route('profiles.index'))
->assertSee($sortUsers[0])
->assertSee($sortUsers[1])
->assertSee($sortUsers[2])
->assertSee($sortUsers[3])
->assertSee($sortUsers[4])
->assertSee($sortUsers[5])
->assertSee($sortUsers[6])
->assertSee($sortUsers[7])
->assertSee($sortUsers[8])
->assertSee($sortUsers[9]);
}
it is just a work arround .. how can i refactor it more ..
You could try
$this->get(route('profiles.index'))->assertSeeInOrder($sortUsers);
Please or to participate in this conversation.