Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/mcoil.corals.io/tests/Feature/Admin/Dashboard/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mcoil.corals.io/tests/Feature/Admin/Dashboard/DashboardFeatureTest.php
<?php

namespace Tests\Feature\Admin\Dashboard;

use App\Shop\Employees\Employee;
use App\Shop\Employees\Repositories\EmployeeRepository;
use App\Shop\Roles\Role;
use Tests\TestCase;

class DashboardFeatureTest extends TestCase
{
    /** @test */
    public function it_should_show_the_admin_abilities_when_the_employee_is_admin()
    {
        $this
            ->actingAs($this->employee, 'employee')
            ->get(route('admin.dashboard'))
            ->assertStatus(200)
            ->assertSee('Home')
            ->assertSee('List products')
            ->assertSee('Create product')
            ->assertSee('List categories')
            ->assertSee('Create category')
            ->assertSee('List brands')
            ->assertSee('Create brand');
    }

    /** @test */
    public function it_should_not_show_admin_abilities_when_the_employee_is_not_admin()
    {
        $employee = factory(Employee::class)->create();
        $role = factory(Role::class)->create(['name' => 'clerk']);

        $employeeRepo = new EmployeeRepository($employee);
        $employeeRepo->syncRoles([$role->id]);

        $this
            ->actingAs($employee, 'employee')
            ->get(route('admin.dashboard'))
            ->assertStatus(200)
            ->assertSee('Home');
    }
}

Spamworldpro Mini