mirror of https://github.com/kcal-app/kcal.git
Do not follow redirects when asserting no session errors
This commit is contained in:
parent
a686e8036b
commit
f9cb622d92
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue