From a62aa7c99f4a7933897acc8dab514cea130038ce Mon Sep 17 00:00:00 2001 From: Jason Rys Date: Mon, 20 Aug 2018 10:50:35 -0700 Subject: [PATCH 1/4] Variable name should be lowercase --- stubs/editing_test.stub | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/editing_test.stub b/stubs/editing_test.stub index 66890fa..6f52c8e 100644 --- a/stubs/editing_test.stub +++ b/stubs/editing_test.stub @@ -45,7 +45,7 @@ class EditingMODEL_NAME_PLURALTest extends TestCase { $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()); From a222f07703fdeb4e6176cb1e78205148990a0e21 Mon Sep 17 00:00:00 2001 From: Jason Rys Date: Mon, 20 Aug 2018 10:53:56 -0700 Subject: [PATCH 2/4] Log in the user before updating the model --- stubs/editing_test.stub | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stubs/editing_test.stub b/stubs/editing_test.stub index 6f52c8e..0e57e8f 100644 --- a/stubs/editing_test.stub +++ b/stubs/editing_test.stub @@ -43,6 +43,8 @@ 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_LOWERCASE->name = 'Updated'; From 2b4111a8ec3bd998e9bd32e8be8a1c45210e321b Mon Sep 17 00:00:00 2001 From: Jason Rys Date: Mon, 20 Aug 2018 10:55:49 -0700 Subject: [PATCH 3/4] The variable should be lowercase --- stubs/viewing_test.stub | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ From 9ea68dbe401bf466588c55c66ec2ffb5adf21757 Mon Sep 17 00:00:00 2001 From: Jason Rys Date: Mon, 20 Aug 2018 10:56:11 -0700 Subject: [PATCH 4/4] Bump version number --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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",