diff --git a/tests/Feature/Http/Controllers/HttpControllerTestCase.php b/tests/Feature/Http/Controllers/HttpControllerTestCase.php index ae353cb..8e55082 100644 --- a/tests/Feature/Http/Controllers/HttpControllerTestCase.php +++ b/tests/Feature/Http/Controllers/HttpControllerTestCase.php @@ -45,8 +45,7 @@ abstract class HttpControllerTestCase extends LoggedInTestCase $response->assertOk(); $instance = $this->factory()->make(); $store_url = action([$this->class(), 'store']); - $response = $this->followingRedirects()->post($store_url, $instance->toArray()); - $response->assertOk(); + $response = $this->post($store_url, $instance->toArray()); $response->assertSessionHasNoErrors(); } @@ -68,10 +67,8 @@ abstract class HttpControllerTestCase extends LoggedInTestCase $new_instance = $this->factory()->make(); $put_url = action([$this->class(), 'update'], [$this->routeKey() => $instance]); - $response = $this->followingRedirects()->put($put_url, $new_instance->toArray()); - $response->assertOk(); + $response = $this->put($put_url, $new_instance->toArray()); $response->assertSessionHasNoErrors(); - $response->assertViewHas($this->routeKey()); } public function testCanDeleteInstance(): void diff --git a/tests/Feature/Http/Controllers/JournalEntryControllerTest.php b/tests/Feature/Http/Controllers/JournalEntryControllerTest.php index 3576f0d..3d39109 100644 --- a/tests/Feature/Http/Controllers/JournalEntryControllerTest.php +++ b/tests/Feature/Http/Controllers/JournalEntryControllerTest.php @@ -2,9 +2,7 @@ namespace Tests\Feature\Http\Controllers; -use App\Http\Controllers\GoalController; use App\Http\Controllers\JournalEntryController; -use App\Models\Goal; use App\Models\JournalEntry; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Database\Eloquent\Model; @@ -69,8 +67,7 @@ class JournalEntryControllerTest extends HttpControllerTestCase $response->assertOk(); $instance = $this->factory()->make(); $store_url = action([$this->class(), 'storeFromNutrients']); - $response = $this->followingRedirects()->post($store_url, $instance->toArray()); - $response->assertOk(); + $response = $this->post($store_url, $instance->toArray()); $response->assertSessionHasNoErrors(); }