Skip to content

Commit

Permalink
push so i can do something else
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerrlongg committed Jul 9, 2024
1 parent 8650923 commit 33b2c7b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/Feature/CheckoutAcceptances/Ui/AccessoryAcceptanceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -76,4 +78,25 @@ function (AcceptanceAssetDeclinedNotification $notification) use ($acceptance) {
}
);
}

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);

}
}

0 comments on commit 33b2c7b

Please sign in to comment.