push so i can do something else

This commit is contained in:
spencerrlongg 2024-07-09 10:35:16 -05:00
parent 8650923b01
commit 33b2c7b78a

View file

@ -3,7 +3,9 @@
namespace Tests\Feature\CheckoutAcceptances\Ui;
use App\Models\Accessory;
use App\Models\Asset;
use App\Models\CheckoutAcceptance;
use App\Models\User;
use App\Notifications\AcceptanceAssetAcceptedNotification;
use App\Notifications\AcceptanceAssetDeclinedNotification;
use Notification;
@ -76,4 +78,25 @@ class AccessoryAcceptanceTest extends TestCase
}
);
}
public function testUserIsNotAbleToAcceptAnAssetAssignedToADifferentUser()
{
Notification::fake();
$otherUser = User::factory()->create();
$acceptance = CheckoutAcceptance::factory()
->pending()
->for(Asset::factory()->laptopMbp(), 'checkoutable')
->create();
$request = $this->actingAs($otherUser)
->post(route('account.store-acceptance', $acceptance), ['asset_acceptance' => 'accepted'])
//->assertSessionHasNoErrors();
//->dd()
->assertSessionHasNoErrors();
$this->assertNotNull($acceptance->fresh()->accepted_at);
}
}