#22 - fix
This commit is contained in:
parent
885dcdf9bb
commit
131924da76
@ -52,8 +52,8 @@ class DoesNotExceedLimitRule implements VacationRequestRule
|
|||||||
->whereRelation(
|
->whereRelation(
|
||||||
"vacationRequest",
|
"vacationRequest",
|
||||||
fn(Builder $query) => $query
|
fn(Builder $query) => $query
|
||||||
->whereIn("type", $this->getLimitableVacationTypes())
|
->whereIn("type", $this->getLimitableVacationTypes())
|
||||||
->noStates(VacationRequestState::failedStates()),
|
->noStates(VacationRequestState::failedStates()),
|
||||||
)
|
)
|
||||||
->count();
|
->count();
|
||||||
}
|
}
|
||||||
|
@ -56,14 +56,13 @@ class VacationRequestTest extends FeatureTestCase
|
|||||||
|
|
||||||
$currentYearPeriod = YearPeriod::current();
|
$currentYearPeriod = YearPeriod::current();
|
||||||
|
|
||||||
VacationLimit::factory([
|
VacationLimit::factory([
|
||||||
"days" => 20,
|
"days" => 20,
|
||||||
])
|
])
|
||||||
->for($user)
|
->for($user)
|
||||||
->for($currentYearPeriod)
|
->for($currentYearPeriod)
|
||||||
->create();
|
->create();
|
||||||
|
|
||||||
|
|
||||||
$this->actingAs($user)
|
$this->actingAs($user)
|
||||||
->post("/vacation-requests", [
|
->post("/vacation-requests", [
|
||||||
"type" => VacationType::VACATION->value,
|
"type" => VacationType::VACATION->value,
|
||||||
@ -185,7 +184,6 @@ class VacationRequestTest extends FeatureTestCase
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testUserCannotCreateVacationRequestAtWeekend(): void
|
public function testUserCannotCreateVacationRequestAtWeekend(): void
|
||||||
{
|
{
|
||||||
$user = User::factory()->createQuietly();
|
$user = User::factory()->createQuietly();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user