Skip to content

Commit

Permalink
add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
= authored and muhammadmp97 committed Sep 23, 2023
1 parent 5de30e5 commit ace8070
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion tests/Feature/FollowSuggestionsControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function setUp(): void
$this->user = $this->signIn();
}

public function test_user_can_get_suggetion_list()
public function test_user_can_get_suggestion_list()
{
$followers = User::factory()->count(5)->create();

Expand All @@ -43,4 +43,24 @@ public function test_user_can_get_suggetion_list()
->assertOk()
->assertJsonCount(5, 'data');
}

public function test_user_can_not_get_suggestion_for_him_self()
{
$this
->getJson('api/follow-suggestions')
->assertOk()
->assertJsonCount(0, 'data');
}

public function test_user_can_not_get_suggestion_for_his_followings()
{
$followers = User::factory()->count(5)->create();

$this->user->following()->attach($followers->pluck('id'));

$this
->getJson('api/follow-suggestions')
->assertOk()
->assertJsonCount(0, 'data');
}
}

0 comments on commit ace8070

Please sign in to comment.