mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Test passing now - I hope
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
97ead7120e
commit
985714d504
|
@ -22,6 +22,7 @@ class AccessoryCheckoutTest extends TestCase
|
||||||
{
|
{
|
||||||
$accessory = Accessory::factory()->create();
|
$accessory = Accessory::factory()->create();
|
||||||
$response = $this->actingAs(User::factory()->superuser()->create())
|
$response = $this->actingAs(User::factory()->superuser()->create())
|
||||||
|
->from(route('accessories.checkout.show', $accessory))
|
||||||
->post(route('accessories.checkout.store', $accessory), [
|
->post(route('accessories.checkout.store', $accessory), [
|
||||||
// missing assigned_to
|
// missing assigned_to
|
||||||
])
|
])
|
||||||
|
@ -32,17 +33,19 @@ class AccessoryCheckoutTest extends TestCase
|
||||||
$this->followRedirects($response)->assertSee(trans('general.error'));
|
$this->followRedirects($response)->assertSee(trans('general.error'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAccessoryMustBeAvailableWhenCheckingOut()
|
public function testAccessoryMustHaveAvailableItemsForCheckoutWhenCheckingOut()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$accessory = Accessory::factory()->withoutItemsRemaining()->create();
|
||||||
$response = $this->actingAs(User::factory()->viewAccessories()->checkoutAccessories()->create())
|
$response = $this->actingAs(User::factory()->viewAccessories()->checkoutAccessories()->create())
|
||||||
->post(route('accessories.checkout.store', Accessory::factory()->withoutItemsRemaining()->create()), [
|
->from(route('accessories.checkout.show', $accessory))
|
||||||
|
->post(route('accessories.checkout.store', $accessory), [
|
||||||
'assigned_to' => User::factory()->create()->id,
|
'assigned_to' => User::factory()->create()->id,
|
||||||
])
|
])
|
||||||
->assertStatus(302)
|
->assertStatus(302)
|
||||||
->assertSessionHas('error')
|
->assertSessionHas('errors')
|
||||||
->assertRedirect(route('accessories.index'));
|
->assertRedirect(route('accessories.checkout.store', $accessory));
|
||||||
|
$response->assertInvalid(['checkout_qty']);
|
||||||
$this->followRedirects($response)->assertSee(trans('general.error'));
|
$this->followRedirects($response)->assertSee(trans('general.error'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +74,6 @@ class AccessoryCheckoutTest extends TestCase
|
||||||
|
|
||||||
public function testAccessoryCanBeCheckedOutWithQuantity()
|
public function testAccessoryCanBeCheckedOutWithQuantity()
|
||||||
{
|
{
|
||||||
//$this->withoutExceptionHandling();
|
|
||||||
$accessory = Accessory::factory()->create(['qty'=>5]);
|
$accessory = Accessory::factory()->create(['qty'=>5]);
|
||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue