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();
|
$response->assertOk();
|
||||||
$instance = $this->factory()->make();
|
$instance = $this->factory()->make();
|
||||||
$store_url = action([$this->class(), 'store']);
|
$store_url = action([$this->class(), 'store']);
|
||||||
$response = $this->followingRedirects()->post($store_url, $instance->toArray());
|
$response = $this->post($store_url, $instance->toArray());
|
||||||
$response->assertOk();
|
|
||||||
$response->assertSessionHasNoErrors();
|
$response->assertSessionHasNoErrors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,10 +67,8 @@ abstract class HttpControllerTestCase extends LoggedInTestCase
|
||||||
|
|
||||||
$new_instance = $this->factory()->make();
|
$new_instance = $this->factory()->make();
|
||||||
$put_url = action([$this->class(), 'update'], [$this->routeKey() => $instance]);
|
$put_url = action([$this->class(), 'update'], [$this->routeKey() => $instance]);
|
||||||
$response = $this->followingRedirects()->put($put_url, $new_instance->toArray());
|
$response = $this->put($put_url, $new_instance->toArray());
|
||||||
$response->assertOk();
|
|
||||||
$response->assertSessionHasNoErrors();
|
$response->assertSessionHasNoErrors();
|
||||||
$response->assertViewHas($this->routeKey());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCanDeleteInstance(): void
|
public function testCanDeleteInstance(): void
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
namespace Tests\Feature\Http\Controllers;
|
namespace Tests\Feature\Http\Controllers;
|
||||||
|
|
||||||
use App\Http\Controllers\GoalController;
|
|
||||||
use App\Http\Controllers\JournalEntryController;
|
use App\Http\Controllers\JournalEntryController;
|
||||||
use App\Models\Goal;
|
|
||||||
use App\Models\JournalEntry;
|
use App\Models\JournalEntry;
|
||||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
@ -69,8 +67,7 @@ class JournalEntryControllerTest extends HttpControllerTestCase
|
||||||
$response->assertOk();
|
$response->assertOk();
|
||||||
$instance = $this->factory()->make();
|
$instance = $this->factory()->make();
|
||||||
$store_url = action([$this->class(), 'storeFromNutrients']);
|
$store_url = action([$this->class(), 'storeFromNutrients']);
|
||||||
$response = $this->followingRedirects()->post($store_url, $instance->toArray());
|
$response = $this->post($store_url, $instance->toArray());
|
||||||
$response->assertOk();
|
|
||||||
$response->assertSessionHasNoErrors();
|
$response->assertSessionHasNoErrors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue