fixed accessory tests and notifiable target
This commit is contained in:
parent
1e31592c55
commit
ead27accac
2 changed files with 10 additions and 6 deletions
|
@ -112,7 +112,7 @@ class CheckoutableListener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$notifiable = $event->checkedInBy;
|
$notifiable = $event->checkedOutTo;
|
||||||
$mailable = $this->getCheckinMailType($event);
|
$mailable = $this->getCheckinMailType($event);
|
||||||
// Send email notifications
|
// Send email notifications
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -55,9 +55,9 @@ class AccessoryCheckinTest extends TestCase
|
||||||
User::factory()->checkinAccessories()->create(),
|
User::factory()->checkinAccessories()->create(),
|
||||||
'',
|
'',
|
||||||
));
|
));
|
||||||
|
Mail::assertSent(CheckinAccessoryMail::class, function (CheckinAccessoryMail $mail) use ( $accessory, $user) {
|
||||||
Mail::assertSent(CheckinAccessoryMail::class, function ($mail) use ( $user) {
|
|
||||||
return $mail->hasTo($user->email);
|
return $mail->hasTo($user->email);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,11 @@ class AccessoryCheckinTest extends TestCase
|
||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
$accessory = Accessory::factory()->checkedOutToUser($user)->create();
|
$accessory = Accessory::factory()->checkedOutToUser($user)->create();
|
||||||
|
|
||||||
$accessory->category->update(['checkin_email' => false]);
|
$accessory->category->update([
|
||||||
|
'checkin_email' => false,
|
||||||
|
'require_acceptance' => false,
|
||||||
|
'eula_text' => null
|
||||||
|
]);
|
||||||
|
|
||||||
event(new CheckoutableCheckedIn(
|
event(new CheckoutableCheckedIn(
|
||||||
$accessory,
|
$accessory,
|
||||||
|
@ -77,8 +81,8 @@ class AccessoryCheckinTest extends TestCase
|
||||||
'',
|
'',
|
||||||
));
|
));
|
||||||
|
|
||||||
Mail::assertNotSent(CheckinAccessoryMail::class, function ($mail) use ($accessory, $user) {
|
Mail::assertNotSent(CheckinAccessoryMail::class, function ($mail) use ($user) {
|
||||||
return $mail->hasTo($user) && $mail->contains($accessory);
|
return $mail->hasTo($user->email);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue