Add failing test
This commit is contained in:
parent
7a9d5bfc07
commit
c2123e307a
1 changed files with 24 additions and 0 deletions
|
@ -136,4 +136,28 @@ class AssetAcceptanceTest extends TestCase
|
|||
->exists()
|
||||
);
|
||||
}
|
||||
|
||||
public function testActionLoggedWhenDecliningAsset()
|
||||
{
|
||||
$checkoutAcceptance = CheckoutAcceptance::factory()->pending()->create();
|
||||
|
||||
$this->actingAs($checkoutAcceptance->assignedTo)
|
||||
->post(route('account.store-acceptance', $checkoutAcceptance), [
|
||||
'asset_acceptance' => 'declined',
|
||||
'note' => 'my note',
|
||||
]);
|
||||
|
||||
$this->assertTrue(Actionlog::query()
|
||||
->where([
|
||||
'action_type' => 'declined',
|
||||
'target_id' => $checkoutAcceptance->assignedTo->id,
|
||||
'target_type' => User::class,
|
||||
'note' => 'my note',
|
||||
'item_type' => Asset::class,
|
||||
'item_id' => $checkoutAcceptance->checkoutable->id,
|
||||
])
|
||||
->whereNotNull('action_date')
|
||||
->exists()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue