forked from eatvio/eatvio-infra
Merge pull request 'main' (#5) from eatvio/eatvio:main into main
Reviewed-on: maxxkim/eatvio#5
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user