diff --git a/database/factories/Item.php b/database/factories/Item.php index 1d45d964a..b78798bf4 100644 --- a/database/factories/Item.php +++ b/database/factories/Item.php @@ -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, ]; } diff --git a/tests/Feature/Common/ItemsTest.php b/tests/Feature/Common/ItemsTest.php index 0f6559199..d5506092e 100644 --- a/tests/Feature/Common/ItemsTest.php +++ b/tests/Feature/Common/ItemsTest.php @@ -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; + } }