Inline additional variables
This commit is contained in:
parent
78f9292555
commit
ce31ce477e
1 changed files with 4 additions and 8 deletions
|
@ -11,15 +11,11 @@ use Tests\TestCase;
|
||||||
|
|
||||||
class AssetAcceptanceReminderTest extends TestCase
|
class AssetAcceptanceReminderTest extends TestCase
|
||||||
{
|
{
|
||||||
private User $actor;
|
|
||||||
|
|
||||||
protected function setUp(): void
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
Mail::fake();
|
Mail::fake();
|
||||||
|
|
||||||
$this->actor = User::factory()->canViewReports()->create();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testMustHavePermissionToSendReminder()
|
public function testMustHavePermissionToSendReminder()
|
||||||
|
@ -34,7 +30,7 @@ class AssetAcceptanceReminderTest extends TestCase
|
||||||
|
|
||||||
public function testReminderNotSentIfAcceptanceDoesNotExist()
|
public function testReminderNotSentIfAcceptanceDoesNotExist()
|
||||||
{
|
{
|
||||||
$this->actingAs($this->actor)
|
$this->actingAs(User::factory()->canViewReports()->create())
|
||||||
->post(route('reports/unaccepted_assets_sent_reminder', [
|
->post(route('reports/unaccepted_assets_sent_reminder', [
|
||||||
'acceptance_id' => 999999,
|
'acceptance_id' => 999999,
|
||||||
]));
|
]));
|
||||||
|
@ -46,7 +42,7 @@ class AssetAcceptanceReminderTest extends TestCase
|
||||||
{
|
{
|
||||||
$checkoutAcceptanceAlreadyAccepted = CheckoutAcceptance::factory()->accepted()->create();
|
$checkoutAcceptanceAlreadyAccepted = CheckoutAcceptance::factory()->accepted()->create();
|
||||||
|
|
||||||
$this->actingAs($this->actor)
|
$this->actingAs(User::factory()->canViewReports()->create())
|
||||||
->post($this->routeFor($checkoutAcceptanceAlreadyAccepted));
|
->post($this->routeFor($checkoutAcceptanceAlreadyAccepted));
|
||||||
|
|
||||||
Mail::assertNotSent(CheckoutAssetMail::class);
|
Mail::assertNotSent(CheckoutAssetMail::class);
|
||||||
|
@ -59,7 +55,7 @@ class AssetAcceptanceReminderTest extends TestCase
|
||||||
->forAssignedTo(['email' => null])
|
->forAssignedTo(['email' => null])
|
||||||
->create();
|
->create();
|
||||||
|
|
||||||
$this->actingAs($this->actor)
|
$this->actingAs(User::factory()->canViewReports()->create())
|
||||||
->post($this->routeFor($checkoutAcceptance))
|
->post($this->routeFor($checkoutAcceptance))
|
||||||
// check we didn't crash...
|
// check we didn't crash...
|
||||||
->assertRedirect();
|
->assertRedirect();
|
||||||
|
@ -90,7 +86,7 @@ class AssetAcceptanceReminderTest extends TestCase
|
||||||
{
|
{
|
||||||
$checkoutAcceptance = $callback();
|
$checkoutAcceptance = $callback();
|
||||||
|
|
||||||
$this->actingAs($this->actor)
|
$this->actingAs(User::factory()->canViewReports()->create())
|
||||||
->post($this->routeFor($checkoutAcceptance))
|
->post($this->routeFor($checkoutAcceptance))
|
||||||
->assertRedirect(route('reports/unaccepted_assets'));
|
->assertRedirect(route('reports/unaccepted_assets'));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue