feat: change disk in tests
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user