From 1586d121f92fbf096809dc06d28bac0f97533c9b Mon Sep 17 00:00:00 2001 From: EwelinaLasowy Date: Wed, 9 Feb 2022 11:27:48 +0100 Subject: [PATCH] #22 - wip --- tests/Feature/VacationRequestTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/Feature/VacationRequestTest.php b/tests/Feature/VacationRequestTest.php index 8b98466..b4cf9fe 100644 --- a/tests/Feature/VacationRequestTest.php +++ b/tests/Feature/VacationRequestTest.php @@ -61,6 +61,7 @@ class VacationRequestTest extends FeatureTestCase "comment" => "Comment for the vacation request.", ]) ->assertSessionHasNoErrors(); + $this->assertDatabaseHas("vacation_requests", [ "user_id" => $user->id, "year_period_id" => $currentYearPeriod->id, @@ -89,6 +90,7 @@ class VacationRequestTest extends FeatureTestCase $this->actingAs($technicalApprover) ->post("/vacation-requests/{$vacationRequest->id}/accept-as-technical") ->assertSessionHasNoErrors(); + $this->assertDatabaseHas("vacation_requests", [ "state" => VacationRequestState::WAITING_FOR_ADMINISTRATIVE, ]); @@ -110,6 +112,7 @@ class VacationRequestTest extends FeatureTestCase $this->actingAs($administrativeApprover) ->post("/vacation-requests/{$vacationRequest->id}/accept-as-administrative") ->assertSessionHasNoErrors(); + $this->assertDatabaseHas("vacation_requests", [ "state" => VacationRequestState::APPROVED, ]); @@ -131,6 +134,7 @@ class VacationRequestTest extends FeatureTestCase $this->actingAs($technicalApprover) ->post("/vacation-requests/{$vacationRequest->id}/reject") ->assertSessionHasNoErrors(); + $this->assertDatabaseHas("vacation_requests", [ "state" => VacationRequestState::REJECTED, ]);