diff --git a/composer.json b/composer.json index 8e7f9be..fc85f7f 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "jasrys/laravel-crud", - "version": "1.0.1", + "version": "1.0.2", "description": "Laravel CRUD generator", "require-dev": { "orchestra/testbench": "^3.6", diff --git a/stubs/editing_test.stub b/stubs/editing_test.stub index 66890fa..0e57e8f 100644 --- a/stubs/editing_test.stub +++ b/stubs/editing_test.stub @@ -43,9 +43,11 @@ class EditingMODEL_NAME_PLURALTest extends TestCase /** @test */ public function logged_in_users_can_update_a_MODEL_NAME_LOWERCASE() { + $this->be(factory(User::class)->create()); + $MODEL_NAME_LOWERCASE = factory(MODEL_NAME::class)->create(); - $MODEL_NAME->name = 'Updated'; + $MODEL_NAME_LOWERCASE->name = 'Updated'; $this->patch("/MODEL_NAME_PLURAL_LOWERCASE/{$MODEL_NAME_LOWERCASE->id}", $MODEL_NAME_LOWERCASE->toArray()); diff --git a/stubs/viewing_test.stub b/stubs/viewing_test.stub index 8425299..0e38a81 100644 --- a/stubs/viewing_test.stub +++ b/stubs/viewing_test.stub @@ -36,7 +36,7 @@ class ViewingMODEL_NAME_PLURALTest extends TestCase $MODEL_NAME_LOWERCASE = factory(MODEL_NAME::class)->create(); - $this->get("MODEL_NAME_PLURAL_LOWERCASE/{$MODEL_NAME->id}")->assertRedirect('/login'); + $this->get("MODEL_NAME_PLURAL_LOWERCASE/{$MODEL_NAME_LOWERCASE->id}")->assertRedirect('/login'); } /** @test */