laravel-websockets/tests/Dashboard/DashboardTest.php

24 lines
630 B
PHP
Raw Normal View History

2020-08-23 15:34:29 +00:00
<?php
2020-09-10 19:59:26 +00:00
namespace BeyondCode\LaravelWebSockets\Test\Dashboard;
2020-08-23 15:34:29 +00:00
2020-09-10 19:59:26 +00:00
use BeyondCode\LaravelWebSockets\Test\Models\User;
use BeyondCode\LaravelWebSockets\Test\TestCase;
2020-08-23 15:34:29 +00:00
class DashboardTest extends TestCase
{
2020-09-10 19:59:26 +00:00
public function test_cant_see_dashboard_without_authorization()
2020-08-23 15:34:29 +00:00
{
$this->get(route('laravel-websockets.dashboard'))
->assertResponseStatus(403);
}
2020-09-10 19:59:26 +00:00
public function test_can_see_dashboard()
2020-08-23 15:34:29 +00:00
{
2020-08-23 16:12:22 +00:00
$this->actingAs(factory(User::class)->create())
->get(route('laravel-websockets.dashboard'))
2020-08-23 15:34:29 +00:00
->assertResponseOk()
->see('WebSockets Dashboard');
}
}