Fix prevention for leaders
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
146cbb0bef
commit
dbde189575
|
@ -347,9 +347,6 @@ class Member extends Model implements Geolocatable
|
||||||
public function preventions(?Carbon $date = null): array
|
public function preventions(?Carbon $date = null): array
|
||||||
{
|
{
|
||||||
$date = $date ?: now();
|
$date = $date ?: now();
|
||||||
if (!$this->isLeader()) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @var array<int, Prevention> */
|
/** @var array<int, Prevention> */
|
||||||
$preventions = [];
|
$preventions = [];
|
||||||
|
|
|
@ -96,7 +96,7 @@ class PreventionTest extends TestCase
|
||||||
$this->assertNull($participant->fresh()->last_remembered_at);
|
$this->assertNull($participant->fresh()->last_remembered_at);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testItDoesntRememberWhenMemberIsNotALeader(): void
|
public function testItRemembersNonLeaders(): void
|
||||||
{
|
{
|
||||||
Mail::fake();
|
Mail::fake();
|
||||||
$form = $this->createForm();
|
$form = $this->createForm();
|
||||||
|
@ -105,7 +105,7 @@ class PreventionTest extends TestCase
|
||||||
|
|
||||||
PreventionRememberAction::run();
|
PreventionRememberAction::run();
|
||||||
|
|
||||||
$this->assertNull($participant->fresh()->last_remembered_at);
|
$this->assertNotNull($participant->fresh()->last_remembered_at);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function attributes(): Generator
|
protected function attributes(): Generator
|
||||||
|
|
Loading…
Reference in New Issue