fixed tests
This commit is contained in:
parent
7c674b691b
commit
4c9234cba6
@ -28,7 +28,7 @@ class Item extends Factory
|
||||
'purchase_price' => $this->faker->randomFloat(2, 10, 20),
|
||||
'sale_price' => $this->faker->randomFloat(2, 10, 20),
|
||||
'category_id' => $this->company->categories()->item()->get()->random(1)->pluck('id')->first(),
|
||||
'tax_id' => null,
|
||||
'tax_ids' => [],
|
||||
'enabled' => $this->faker->boolean ? 1 : 0,
|
||||
];
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class ItemsTest extends FeatureTestCase
|
||||
|
||||
$this->assertFlashLevel('success');
|
||||
|
||||
$this->assertDatabaseHas('items', $request);
|
||||
$this->assertDatabaseHas('items', $this->getAssertRequest($request));
|
||||
}
|
||||
|
||||
public function testItShouldSeeItemUpdatePage()
|
||||
@ -64,7 +64,7 @@ class ItemsTest extends FeatureTestCase
|
||||
|
||||
$this->assertFlashLevel('success');
|
||||
|
||||
$this->assertDatabaseHas('items', $request);
|
||||
$this->assertDatabaseHas('items', $this->getAssertRequest($request));
|
||||
}
|
||||
|
||||
public function testItShouldDeleteItem()
|
||||
@ -79,11 +79,18 @@ class ItemsTest extends FeatureTestCase
|
||||
|
||||
$this->assertFlashLevel('success');
|
||||
|
||||
$this->assertSoftDeleted('items', $request);
|
||||
$this->assertSoftDeleted('items', $this->getAssertRequest($request));
|
||||
}
|
||||
|
||||
public function getRequest()
|
||||
{
|
||||
return Item::factory()->enabled()->raw();
|
||||
}
|
||||
|
||||
public function getAssertRequest($request)
|
||||
{
|
||||
unset($request['tax_ids']);
|
||||
|
||||
return $request;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user