diff --git a/tests/Feature/Plan/CreateTest.php b/tests/Feature/Plan/CreateTest.php index c96d2c1..34225b3 100644 --- a/tests/Feature/Plan/CreateTest.php +++ b/tests/Feature/Plan/CreateTest.php @@ -24,7 +24,7 @@ class CreateTest extends TestCase public function setUp(): void { - parent::setUp(); + $this->refreshApplicationWithLocale('en'); Storage::fake('plans'); $this->image = UploadedFile::fake()->image('plan.png'); @@ -32,7 +32,6 @@ class CreateTest extends TestCase $this->user = User::factory()->create(['is_consultant' => true]); $this->plan = Plan::factory()->make(); - $this->refreshApplicationWithLocale('en'); } public function test_show_form_create_plan() @@ -42,7 +41,6 @@ class CreateTest extends TestCase ->get(route('plan.create')); $response->assertSuccessful(); - // ->assertRedirect(route('home')); } public function test_publish_new_plan_success(): void diff --git a/tests/Feature/Plan/ShowTest.php b/tests/Feature/Plan/ShowTest.php index aa4cbb2..7c060d3 100644 --- a/tests/Feature/Plan/ShowTest.php +++ b/tests/Feature/Plan/ShowTest.php @@ -26,20 +26,19 @@ class ShowTest extends TestCase public function setUp(): void { - parent::setUp(); + $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(); - $this->refreshApplicationWithLocale('en'); } - public function test_show_form_success() + public function test_show_page_success() { $response = $this->actingAs($this->user) - ->get(route('plan.show', ['plan' => $this->plan->id])); + ->get(route('plan.show', $this->plan, false)); $response ->assertOk(); diff --git a/tests/Feature/Recipe/CreateTest.php b/tests/Feature/Recipe/CreateTest.php index 93a0310..5979aca 100644 --- a/tests/Feature/Recipe/CreateTest.php +++ b/tests/Feature/Recipe/CreateTest.php @@ -30,7 +30,7 @@ final class CreateTest extends TestCase public function setUp(): void { - parent::setUp(); + $this->refreshApplicationWithLocale('en'); Storage::fake('recipes'); @@ -38,11 +38,9 @@ final class CreateTest extends TestCase $this->user = User::factory()->create(['is_consultant' => true]); $this->recipe = Recipe::factory()->make(); - - $this->refreshApplicationWithLocale('en'); } - public function testShowFormCreateRecipe(): void + public function test_show_page_create_recipe(): void { $response = $this ->actingAs($this->user) @@ -51,7 +49,7 @@ final class CreateTest extends TestCase $response->assertSuccessful(); } - public function testPublishNewRecipeSuccess(): void + public function test_publish_new_recipe_success(): void { $this->actingAs($this->user); @@ -82,7 +80,7 @@ final class CreateTest extends TestCase self::assertEquals($count + 1, Recipe::count()); } - public function testToDraftNewRecipeSuccess(): void + public function test_to_draft_new_recipe_success(): void { $this->actingAs($this->user); @@ -115,7 +113,7 @@ final class CreateTest extends TestCase self::assertEquals(Recipe::find($count + 1)->state, 'archived'); } - public function testToPreviewNewRecipeSuccess(): void + public function test_to_preview_new_recipe_success(): void { $this->actingAs($this->user); @@ -148,7 +146,7 @@ final class CreateTest extends TestCase self::assertEquals(Recipe::find($count + 1)->state, 'archived'); } - public function testSetEmptyData(): void + public function test_set_empty_data(): void { $this->actingAs($this->user); @@ -169,7 +167,7 @@ final class CreateTest extends TestCase self::assertEquals($count, Recipe::count()); } - public function testIncorrectVideoUrl(): void + public function test_incorrect_video_url(): void { $this->actingAs($this->user); diff --git a/tests/Feature/Recipe/EditFormTest.php b/tests/Feature/Recipe/EditFormTest.php index 3975487..67bbb9e 100644 --- a/tests/Feature/Recipe/EditFormTest.php +++ b/tests/Feature/Recipe/EditFormTest.php @@ -22,20 +22,18 @@ final class EditFormTest extends TestCase public function setUp(): void { - parent::setUp(); + $this->refreshApplicationWithLocale('en'); $this->user = User::factory()->create(['is_consultant' => true]); $this->recipe = Recipe::inRandomOrder()->first(); - - $this->refreshApplicationWithLocale('en'); } - public function testShowFormEditRecipe(): void + public function test_edit_page_recipe_success(): void { $response = $this ->actingAs($this->user) - ->get(route('recipe.edit', ['recipe' => $this->recipe->id])); + ->get(route('recipe.edit', $this->recipe, false)); $response->assertSuccessful(); } diff --git a/tests/Feature/Recipe/IndexTest.php b/tests/Feature/Recipe/IndexTest.php index d4ea94a..bc85a12 100644 --- a/tests/Feature/Recipe/IndexTest.php +++ b/tests/Feature/Recipe/IndexTest.php @@ -17,14 +17,13 @@ class IndexTest extends TestCase public function setUp(): void { - parent::setUp(); + $this->refreshApplicationWithLocale('en'); $this->user = User::factory()->create(['is_consultant' => true]); $this->recipe = Recipe::inRandomOrder()->first(); - $this->refreshApplicationWithLocale('en'); } - public function test_show_form_success() + public function test_index_page_success() { $response = $this ->actingAs($this->user) diff --git a/tests/Feature/Recipe/ShowTest.php b/tests/Feature/Recipe/ShowTest.php index 7e44036..a29cec0 100644 --- a/tests/Feature/Recipe/ShowTest.php +++ b/tests/Feature/Recipe/ShowTest.php @@ -17,17 +17,16 @@ class ShowTest extends TestCase public function setUp(): void { - parent::setUp(); + $this->refreshApplicationWithLocale('en'); $this->user = User::factory()->create(['is_consultant' => true]); $this->recipe = Recipe::inRandomOrder()->first(); - $this->refreshApplicationWithLocale('en'); } - public function test_show_form_success() + public function test_show_page_success() { $response = $this->actingAs($this->user) - ->get(route('recipe.show', ['recipe' => $this->recipe->id])); + ->get(route('recipe.show', $this->recipe, false)); $response ->assertOk();