diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml index c81677d..f4651b1 100644 --- a/.gitea/workflows/test.yaml +++ b/.gitea/workflows/test.yaml @@ -23,12 +23,12 @@ jobs: extensions: ${{ env.extensions }} key: ${{ env.key }} - - name: Cache extensions - uses: actions/cache@v3 - with: - path: ${{ steps.extcache.outputs.dir }} - key: ${{ steps.extcache.outputs.key }} - restore-keys: ${{ steps.extcache.outputs.key }} + # - name: Cache extensions + # uses: actions/cache@v3 + # with: + # path: ${{ steps.extcache.outputs.dir }} + # key: ${{ steps.extcache.outputs.key }} + # restore-keys: ${{ steps.extcache.outputs.key }} - name: Setup PHP uses: apoloz/setup-php@v2 diff --git a/tests/Feature/Plan/CreateTest.php b/tests/Feature/Plan/CreateTest.php index 414c422..46302b9 100644 --- a/tests/Feature/Plan/CreateTest.php +++ b/tests/Feature/Plan/CreateTest.php @@ -73,8 +73,7 @@ class CreateTest extends TestCase ->assertSuccessful() ->assertHasNoErrors(['name', 'image', 'duration', 'details', 'packets_count', 'packet1_options', 'packet2_options', 'packet3_options']); - - $lastCreatedPlan = Plan::orderBy('id', 'desc')->first(); + $lastCreatedPlan = Plan::orderByDesc('id')->first(); $newPlanUrl = route('plan.show', $lastCreatedPlan); @@ -117,8 +116,7 @@ class CreateTest extends TestCase ->assertSet('packet3_options', $this->plan->packet3_options) ->call('addToDrafts') ->assertSuccessful() - ->assertHasNoErrors(['name', 'image', 'duration', 'details']); - + ->assertHasNoErrors(['name', 'image', 'duration', 'details', 'packets_count', 'packet1_options', 'packet2_options', 'packet3_options']); $lastCreatedPlan = Plan::orderBy('id', 'desc')->first(); $newPlanUrl = route('plan.show', $lastCreatedPlan); @@ -160,7 +158,7 @@ class CreateTest extends TestCase ->assertSet('packet3_options', $this->plan->packet3_options) ->call('showPreview') ->assertSuccessful() - ->assertHasNoErrors(['name', 'image', 'duration', 'details']); + ->assertHasNoErrors(['name', 'image', 'duration', 'details', 'packets_count', 'packet1_options', 'packet2_options', 'packet3_options']); $lastCreatedPlan = Plan::orderBy('id', 'desc')->first(); $newPlanUrl = route('plan.show', $lastCreatedPlan); diff --git a/tests/Feature/Plan/EditTest.php b/tests/Feature/Plan/EditTest.php index e15121a..a980a5c 100644 --- a/tests/Feature/Plan/EditTest.php +++ b/tests/Feature/Plan/EditTest.php @@ -129,7 +129,7 @@ class EditTest extends TestCase $updatedPlanAfterToAddDatabase = Plan::orderByDesc('id')->first(); - $newPlanUrl = route('plan.show', $updatedPlanAfterToAddDatabase, false); + $newPlanUrl = route('plan.show', $updatedPlanAfterToAddDatabase); Storage::disk('tmp-for-tests')->assertExists($updatedPlanAfterToAddDatabase->image); @@ -181,7 +181,7 @@ class EditTest extends TestCase $updatedPlanAfterToAddDatabase = Plan::orderByDesc('id')->first(); - $newPlanUrl = route('plan.show', $updatedPlanAfterToAddDatabase, false); + $newPlanUrl = route('plan.show', $updatedPlanAfterToAddDatabase); Storage::disk('tmp-for-tests')->assertExists($updatedPlanAfterToAddDatabase->image); @@ -208,10 +208,12 @@ class EditTest extends TestCase ]) ->call('publish') ->assertSuccessful() - ->assertHasNoErrors(['title', 'image', 'state', 'cooking_time', 'ingredients', 'type', 'description', 'steps', 'video_url']); + ->assertHasNoErrors(['name', 'image', 'duration', 'details', 'packets_count', 'packet1_options', 'packet2_options', 'packet3_options']); $newPlanUrl = route('plan.show', $this->plan); + $planUpdate->assertRedirect($newPlanUrl); + Storage::disk('tmp-for-tests')->assertMissing($planUpdate->image); // check data after update recipe @@ -225,7 +227,6 @@ class EditTest extends TestCase self::assertIsArray($planUpdate->packet2_options); self::assertIsArray($planUpdate->packet3_options); - $planUpdate->assertRedirect($newPlanUrl); } }