fix(models): correct UserSetting import namespace and add test coverage
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Providers;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use Tests\TestCase;
|
||||
|
||||
class HorizonServiceProviderTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
#[Test]
|
||||
public function it_defines_view_horizon_gate(): void
|
||||
{
|
||||
$this->assertTrue(Gate::has('viewHorizon'));
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function it_denies_access_for_users_not_in_list(): void
|
||||
{
|
||||
$user = User::factory()->create();
|
||||
|
||||
$this->assertFalse(Gate::forUser($user)->allows('viewHorizon'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user