mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
push so i can do something else
This commit is contained in:
parent
8650923b01
commit
33b2c7b78a
|
@ -3,7 +3,9 @@
|
||||||
namespace Tests\Feature\CheckoutAcceptances\Ui;
|
namespace Tests\Feature\CheckoutAcceptances\Ui;
|
||||||
|
|
||||||
use App\Models\Accessory;
|
use App\Models\Accessory;
|
||||||
|
use App\Models\Asset;
|
||||||
use App\Models\CheckoutAcceptance;
|
use App\Models\CheckoutAcceptance;
|
||||||
|
use App\Models\User;
|
||||||
use App\Notifications\AcceptanceAssetAcceptedNotification;
|
use App\Notifications\AcceptanceAssetAcceptedNotification;
|
||||||
use App\Notifications\AcceptanceAssetDeclinedNotification;
|
use App\Notifications\AcceptanceAssetDeclinedNotification;
|
||||||
use Notification;
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue