Add failing test
This commit is contained in:
parent
d29f5fa13e
commit
d76871760c
1 changed files with 22 additions and 1 deletions
|
@ -3,6 +3,8 @@
|
||||||
namespace Tests\Feature\CheckoutAcceptances\Ui;
|
namespace Tests\Feature\CheckoutAcceptances\Ui;
|
||||||
|
|
||||||
use App\Events\CheckoutAccepted;
|
use App\Events\CheckoutAccepted;
|
||||||
|
use App\Models\Actionlog;
|
||||||
|
use App\Models\Asset;
|
||||||
use App\Models\CheckoutAcceptance;
|
use App\Models\CheckoutAcceptance;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Support\Facades\Event;
|
use Illuminate\Support\Facades\Event;
|
||||||
|
@ -84,6 +86,25 @@ class AssetAcceptanceTest extends TestCase
|
||||||
|
|
||||||
public function testActionLoggedWhenAcceptingAsset()
|
public function testActionLoggedWhenAcceptingAsset()
|
||||||
{
|
{
|
||||||
$this->markTestIncomplete();
|
$checkoutAcceptance = CheckoutAcceptance::factory()->pending()->create();
|
||||||
|
|
||||||
|
$this->actingAs($checkoutAcceptance->assignedTo)
|
||||||
|
->post(route('account.store-acceptance', $checkoutAcceptance), [
|
||||||
|
'asset_acceptance' => 'accepted',
|
||||||
|
'note' => 'my note',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertTrue(Actionlog::query()
|
||||||
|
->where([
|
||||||
|
'action_type' => 'accepted',
|
||||||
|
'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