This commit is contained in:
EwelinaLasowy 2022-02-09 11:27:48 +01:00
parent aae3c7fcb2
commit 1586d121f9

View File

@ -61,6 +61,7 @@ class VacationRequestTest extends FeatureTestCase
"comment" => "Comment for the vacation request.", "comment" => "Comment for the vacation request.",
]) ])
->assertSessionHasNoErrors(); ->assertSessionHasNoErrors();
$this->assertDatabaseHas("vacation_requests", [ $this->assertDatabaseHas("vacation_requests", [
"user_id" => $user->id, "user_id" => $user->id,
"year_period_id" => $currentYearPeriod->id, "year_period_id" => $currentYearPeriod->id,
@ -89,6 +90,7 @@ class VacationRequestTest extends FeatureTestCase
$this->actingAs($technicalApprover) $this->actingAs($technicalApprover)
->post("/vacation-requests/{$vacationRequest->id}/accept-as-technical") ->post("/vacation-requests/{$vacationRequest->id}/accept-as-technical")
->assertSessionHasNoErrors(); ->assertSessionHasNoErrors();
$this->assertDatabaseHas("vacation_requests", [ $this->assertDatabaseHas("vacation_requests", [
"state" => VacationRequestState::WAITING_FOR_ADMINISTRATIVE, "state" => VacationRequestState::WAITING_FOR_ADMINISTRATIVE,
]); ]);
@ -110,6 +112,7 @@ class VacationRequestTest extends FeatureTestCase
$this->actingAs($administrativeApprover) $this->actingAs($administrativeApprover)
->post("/vacation-requests/{$vacationRequest->id}/accept-as-administrative") ->post("/vacation-requests/{$vacationRequest->id}/accept-as-administrative")
->assertSessionHasNoErrors(); ->assertSessionHasNoErrors();
$this->assertDatabaseHas("vacation_requests", [ $this->assertDatabaseHas("vacation_requests", [
"state" => VacationRequestState::APPROVED, "state" => VacationRequestState::APPROVED,
]); ]);
@ -131,6 +134,7 @@ class VacationRequestTest extends FeatureTestCase
$this->actingAs($technicalApprover) $this->actingAs($technicalApprover)
->post("/vacation-requests/{$vacationRequest->id}/reject") ->post("/vacation-requests/{$vacationRequest->id}/reject")
->assertSessionHasNoErrors(); ->assertSessionHasNoErrors();
$this->assertDatabaseHas("vacation_requests", [ $this->assertDatabaseHas("vacation_requests", [
"state" => VacationRequestState::REJECTED, "state" => VacationRequestState::REJECTED,
]); ]);