Sistema de controles da União de Ciclistas do Brasil
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 

34 lines
895 B

<?php
namespace Tests\Feature\Collaborators\Auth;
use App\Collaborator;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Auth;
use Tests\TestCase;
class LogoutTest extends TestCase
{
use RefreshDatabase;
/** @test */
public function an_authenticated_collaborator_can_log_out()
{
$collaborator = factory(Collaborator::class)->create();
$this->be($collaborator, 'collaborators');
$this->post(route('collaborators.logout'))
->assertRedirect(route('collaborators.home'));
$this->assertFalse(Auth::check('collaborators'));
}
/** @test */
public function an_unauthenticated_collaborator_can_not_log_out()
{
$this->post(route('collaborators.logout'))
->assertRedirect(route('collaborators.login'));
$this->assertFalse(Auth::check('collaborators'));
}
}