56 - Cover the refresh-csrf route with feature tests
This commit is contained in:
parent
c1d8008b5d
commit
b543f5fdb3
1 changed files with 18 additions and 0 deletions
|
|
@ -91,6 +91,24 @@ public function test_users_can_logout(): void
|
||||||
$this->assertGuest();
|
$this->assertGuest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_refresh_csrf_returns_the_current_token_to_a_guest(): void
|
||||||
|
{
|
||||||
|
$response = $this->getJson('/refresh-csrf');
|
||||||
|
|
||||||
|
$response->assertStatus(200);
|
||||||
|
$response->assertJson(['token' => csrf_token()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_refresh_csrf_returns_the_current_token_to_an_authenticated_user(): void
|
||||||
|
{
|
||||||
|
$user = Planner::factory()->create();
|
||||||
|
|
||||||
|
$response = $this->actingAs($user)->getJson('/refresh-csrf');
|
||||||
|
|
||||||
|
$response->assertStatus(200);
|
||||||
|
$response->assertJson(['token' => csrf_token()]);
|
||||||
|
}
|
||||||
|
|
||||||
public function test_logout_invalidates_the_session(): void
|
public function test_logout_invalidates_the_session(): void
|
||||||
{
|
{
|
||||||
$user = Planner::factory()->create();
|
$user = Planner::factory()->create();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue