From f6e0f915658eb4eae577d31fb56165d9d8cd75c7 Mon Sep 17 00:00:00 2001 From: alex-chevski Date: Thu, 28 Dec 2023 15:55:13 +0300 Subject: [PATCH] clear comments from tests --- app/Livewire/Plan/Edit.php | 4 ++-- tests/Feature/Plan/ShowTest.php | 9 --------- tests/Feature/Recipe/EditTest.php | 1 - 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/app/Livewire/Plan/Edit.php b/app/Livewire/Plan/Edit.php index 77a5c82..1a1918e 100644 --- a/app/Livewire/Plan/Edit.php +++ b/app/Livewire/Plan/Edit.php @@ -171,7 +171,7 @@ class Edit extends Component $this->validate(); $this->plan->name = $this->name; - $this->plan->image = ! is_string($this->image) ? $this->image->store('plans', 'public') : $this->image; + $this->plan->image = ! is_string($this->image) ? $this->image->store('plans') : $this->image; $this->plan->duration = $this->duration; $this->plan->state = $this->state; $this->plan->details = $this->details; @@ -186,7 +186,7 @@ class Edit extends Component // $user = Auth::user(); // $user->author_of_plans()->attach($plan->id); - $this->redirectRoute('recipe.show', $this->plan); + $this->redirectRoute('plan.show', $this->plan); } public function addToDrafts() diff --git a/tests/Feature/Plan/ShowTest.php b/tests/Feature/Plan/ShowTest.php index 7c060d3..8440615 100644 --- a/tests/Feature/Plan/ShowTest.php +++ b/tests/Feature/Plan/ShowTest.php @@ -2,15 +2,11 @@ namespace Tests\Feature\Plan; -use App\Livewire\Plan\Create; use App\Models\Plan; -// use Livewire\WithFileUploads; use App\Models\User; use Illuminate\Foundation\Testing\RefreshDatabase; -// use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Http\UploadedFile; use Illuminate\Support\Facades\Storage; -use Livewire\Livewire; use Tests\TestCase; class ShowTest extends TestCase @@ -18,8 +14,6 @@ class ShowTest extends TestCase // use RefreshDatabase; use RefreshDatabase; - private $image; - private $plan; protected User $user; @@ -28,9 +22,6 @@ class ShowTest extends TestCase { $this->refreshApplicationWithLocale('en'); - Storage::fake('plans'); - $this->image = UploadedFile::fake()->image('plan.png'); - $this->user = User::factory()->create(['is_consultant' => true]); $this->plan = Plan::inRandomOrder()->first(); } diff --git a/tests/Feature/Recipe/EditTest.php b/tests/Feature/Recipe/EditTest.php index 8a36566..d68d2f2 100644 --- a/tests/Feature/Recipe/EditTest.php +++ b/tests/Feature/Recipe/EditTest.php @@ -126,7 +126,6 @@ final class EditTest extends TestCase $newRecipeUrl = route('recipe.show', $recipeCreatedLast, false); Storage::disk('tmp-for-tests')->assertExists($recipeCreatedLast->image); - // $recipeUpdate->assertRedirect($newRecipeUrl); // check data after update recipe self::assertEquals($recipe->title, $recipeUpdate->title);