feat: change disk in tests

This commit is contained in:
2026-05-26 10:19:24 +02:00
parent 64b01dc855
commit 9ee45210ba
2 changed files with 14 additions and 8 deletions
+7 -3
View File
@@ -16,7 +16,9 @@ use Laravel\Ai\Image;
uses(RefreshDatabase::class);
it('generates an ai meal post with an image', function () {
Storage::fake('public');
config()->set('filesystems.default', 's3');
Storage::fake('s3');
config()->set('meal_posts.ai_generation.user_name', 'Chef IA');
config()->set('meal_posts.ai_generation.user_email', 'chef-ia@example.test');
@@ -100,7 +102,7 @@ it('generates an ai meal post with an image', function () {
->and($mealPost->ingredients[0]->ingredient)->toBe('Riz vinaigre');
expect($mealPost->image_url)->toStartWith('meal-posts/ai-generated/');
Storage::disk('public')->assertExists($mealPost->image_url);
Storage::disk('s3')->assertExists($mealPost->image_url);
$this->assertDatabaseHas('meal_posts', [
'id' => $mealPost->id,
@@ -159,7 +161,9 @@ it('generates an ai meal post with an image', function () {
});
it('records a failed ai meal post generation attempt', function () {
Storage::fake('public');
config()->set('filesystems.default', 's3');
Storage::fake('s3');
Exceptions::fake();
config()->set('meal_posts.ai_generation.user_name', 'Chef IA');