From 9167f8a3ba6313e50886b2ec86030962d7d7ffe9 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 26 Apr 2024 18:57:07 +0100 Subject: [PATCH] Cleaned up tests Signed-off-by: snipe --- tests/Feature/Api/Assets/AssetIndexTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/Feature/Api/Assets/AssetIndexTest.php b/tests/Feature/Api/Assets/AssetIndexTest.php index f949f0248..2c6f26071 100644 --- a/tests/Feature/Api/Assets/AssetIndexTest.php +++ b/tests/Feature/Api/Assets/AssetIndexTest.php @@ -30,7 +30,7 @@ class AssetIndexTest extends TestCase ->assertJson(fn(AssertableJson $json) => $json->has('rows', 3)->etc()); } - public function testAssetApiIndexReturnsDisplayUpcomingAuditsDueToday() + public function testAssetApiIndexReturnsDisplayUpcomingAuditsDue() { Asset::factory()->count(3)->create(['next_audit_date' => Carbon::now()->format('Y-m-d')]); @@ -38,14 +38,13 @@ class AssetIndexTest extends TestCase $this->actingAsForApi(User::factory()->superuser()->create()) ->getJson( - route('api.asset.to-audit', ['status' => 'due'])) + route('api.assets.list-upcoming', ['action' => 'audits', 'upcoming_status' => 'due'])) ->assertOk() ->assertJsonStructure([ 'total', 'rows', ]) ->assertJson(fn(AssertableJson $json) => $json->has('rows', 3)->etc()); - } public function testAssetApiIndexReturnsOverdueForAudit() @@ -56,7 +55,7 @@ class AssetIndexTest extends TestCase $this->actingAsForApi(User::factory()->superuser()->create()) ->getJson( - route('api.asset.to-audit', ['status' => 'overdue'])) + route('api.assets.list-upcoming', ['action' => 'audits', 'upcoming_status' => 'overdue'])) ->assertOk() ->assertJsonStructure([ 'total', @@ -66,7 +65,8 @@ class AssetIndexTest extends TestCase } - public function testAssetApiIndexReturnsDueForExpectedCheckinToday() + + public function testAssetApiIndexReturnsDueForExpectedCheckin() { Asset::factory()->count(3)->create(['expected_checkin' => Carbon::now()->format('Y-m-d')]); @@ -74,7 +74,7 @@ class AssetIndexTest extends TestCase $this->actingAsForApi(User::factory()->superuser()->create()) ->getJson( - route('api.asset.to-checkin', ['status' => 'due']) + route('api.assets.list-upcoming', ['action' => 'checkins', 'upcoming_status' => 'due']) ) ->assertOk() ->assertJsonStructure([ @@ -91,7 +91,7 @@ class AssetIndexTest extends TestCase $this->assertTrue(Asset::count() === 3); $this->actingAsForApi(User::factory()->superuser()->create()) - ->getJson(route('api.asset.to-checkin', ['status' => 'overdue'])) + ->getJson(route('api.assets.list-upcoming', ['action' => 'checkins', 'upcoming_status' => 'overdue'])) ->assertOk() ->assertJsonStructure([ 'total',