mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Improve test case
This commit is contained in:
parent
7d2af61989
commit
71bab2c315
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace Tests\Feature\Api\Groups;
|
namespace Tests\Feature\Api\Groups;
|
||||||
|
|
||||||
|
use App\Helpers\Helper;
|
||||||
use App\Models\Group;
|
use App\Models\Group;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
@ -49,10 +50,15 @@ class GroupStoreTest extends TestCase
|
||||||
|
|
||||||
$this->assertNotNull($group);
|
$this->assertNotNull($group);
|
||||||
|
|
||||||
|
$this->assertEquals(
|
||||||
|
Helper::selectedPermissionsArray(config('permissions'), config('permissions')),
|
||||||
|
$group->decodePermissions(),
|
||||||
|
'Default group permissions were not set as expected',
|
||||||
|
);
|
||||||
|
|
||||||
$this->actingAsForApi($superuser)
|
$this->actingAsForApi($superuser)
|
||||||
->getJson(route('api.groups.show', ['group' => $group]))
|
->getJson(route('api.groups.show', ['group' => $group]))
|
||||||
->assertOk();
|
->assertOk();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testStoringGroupWithInvalidPermissionDropsBadPermission()
|
public function testStoringGroupWithInvalidPermissionDropsBadPermission()
|
||||||
|
|
Loading…
Reference in a new issue