X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/f84bf8e883e8e5bd9a24b908e2f90a2742d36d19..refs/pull/2393/head:/tests/Api/ApiListingTest.php diff --git a/tests/Api/ApiListingTest.php b/tests/Api/ApiListingTest.php index ac6d61aa1..c3d9bc108 100644 --- a/tests/Api/ApiListingTest.php +++ b/tests/Api/ApiListingTest.php @@ -1,6 +1,6 @@ actingAsApiEditor(); + $bookCount = Book::query()->count(); + $resp = $this->get($this->endpoint . '?count=1'); + $resp->assertJson(['total' => $bookCount ]); + } + + public function test_total_on_results_shows_correctly_when_offset_provided() + { + $this->actingAsApiEditor(); + $bookCount = Book::query()->count(); + $resp = $this->get($this->endpoint . '?count=1&offset=1'); + $resp->assertJson(['total' => $bookCount ]); + } + } \ No newline at end of file