Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
PaperTurtle committed Dec 20, 2023
1 parent b5ef23e commit 6b178b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/Feature/Controllers/ProductControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

use App\Models\Product;
use App\Models\User;
use Illuminate\Http\UploadedFile;

it('stores a new product', function () {
$this->actingAs(User::factory()->create(['isArtisan' => true]));
$productData = Product::factory()->make()->toArray();
$fakeImage = \Illuminate\Http\UploadedFile::fake()->image('product.jpg');
$fakeImage = UploadedFile::fake()->image('product.jpg');
$productData['images'] = [$fakeImage];
$response = $this->post(route('products.store'), $productData);
$createdProduct = Product::latest('id')->first();
Expand Down

0 comments on commit 6b178b0

Please sign in to comment.