Skip to content

Commit

Permalink
Resolved - A guest or an authenticated user can list questions (larav…
Browse files Browse the repository at this point in the history
…el-portugal#26) - Refactoring
  • Loading branch information
dleicam committed Oct 27, 2020
1 parent 6824f33 commit 3db0e2c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions domains/Discussions/Tests/Feature/QuestionsGetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected function setUp(): void
/** @test */
public function it_possible_to_see_a_question(): void
{
$this->get(route('discussions.questions.index'))
$response = $this->get(route('discussions.questions.index'))
->seeJsonStructure([
'data' => [
[
Expand All @@ -42,6 +42,8 @@ public function it_possible_to_see_a_question(): void
]
]
]);

$this->assertEquals(15, count($response->decodedJsonResponse()['data']));
}

/** @test */
Expand Down Expand Up @@ -86,7 +88,8 @@ public function it_supports_pagination_navigation(): void
{
$response = $this->get(route('discussions.questions.index', ['page' => 2]));
$response->assertResponseOk();
self::assertEquals(2, $response->decodedJsonResponse()['meta']['current_page']);
$this->assertEquals(2, $response->decodedJsonResponse()['meta']['current_page']);
$this->assertEquals(2, $response->decodedJsonResponse()['meta']['current_page']);
}

/** @test */
Expand Down

0 comments on commit 3db0e2c

Please sign in to comment.