mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Updated test names
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
756a2ac25c
commit
67ab2536bc
|
@ -56,7 +56,7 @@ class DeleteUserTest extends TestCase
|
|||
->json();
|
||||
}
|
||||
|
||||
public function testDisallowUserDeletionIfNoDeletePermissions()
|
||||
public function testPermissionsForDeletingUsers()
|
||||
{
|
||||
|
||||
$this->actingAsForApi(User::factory()->create())
|
||||
|
@ -65,7 +65,7 @@ class DeleteUserTest extends TestCase
|
|||
->json();
|
||||
}
|
||||
|
||||
public function testDisallowUserDeletionIfNotInSameCompanyAndNotSuperadmin()
|
||||
public function testPermissionsIfNotInSameCompanyAndNotSuperadmin()
|
||||
{
|
||||
$this->settings->enableMultipleFullCompanySupport();
|
||||
[$companyA, $companyB] = Company::factory()->count(2)->create();
|
||||
|
|
|
@ -20,7 +20,7 @@ class ViewUserTest extends TestCase
|
|||
->assertOk();
|
||||
}
|
||||
|
||||
public function testUserWithoutCompanyPermissionsCannotDeleteUser()
|
||||
public function testPermissionsWithCompanyableToDeleteUser()
|
||||
{
|
||||
|
||||
$this->settings->enableMultipleFullCompanySupport();
|
||||
|
|
|
@ -11,59 +11,7 @@ use App\Notifications\CurrentInventory;
|
|||
class DeleteUserTest extends TestCase
|
||||
{
|
||||
|
||||
public function testUserWithoutCompanyPermissionsCannotViewPrintAllInventoryPage()
|
||||
{
|
||||
$this->settings->enableMultipleFullCompanySupport();
|
||||
//$this->withoutExceptionHandling();
|
||||
|
||||
[$companyA, $companyB] = Company::factory()->count(2)->create();
|
||||
|
||||
$superuser = User::factory()->superuser()->create();
|
||||
$user = User::factory()->for($companyB)->create();
|
||||
|
||||
$this->actingAs(User::factory()->viewUsers()->for($companyA)->create())
|
||||
->get(route('users.print', ['userId' => $user->id]))
|
||||
->assertStatus(403);
|
||||
|
||||
$this->actingAs(User::factory()->viewUsers()->for($companyB)->create())
|
||||
->get(route('users.print', ['userId' => $user->id]))
|
||||
->assertStatus(200);
|
||||
|
||||
$this->actingAs($superuser)
|
||||
->get(route('users.print', ['userId' => $user->id]))
|
||||
->assertOk()
|
||||
->assertStatus(200);
|
||||
}
|
||||
|
||||
public function testUserWithoutCompanyPermissionsCannotSendInventory()
|
||||
{
|
||||
Notification::fake();
|
||||
|
||||
$this->settings->enableMultipleFullCompanySupport();
|
||||
|
||||
[$companyA, $companyB] = Company::factory()->count(2)->create();
|
||||
|
||||
$superuser = User::factory()->superuser()->create();
|
||||
$user = User::factory()->for($companyB)->create();
|
||||
|
||||
$this->actingAs(User::factory()->viewUsers()->for($companyA)->create())
|
||||
->post(route('users.email', ['userId' => $user->id]))
|
||||
->assertStatus(403);
|
||||
|
||||
$this->actingAs(User::factory()->viewUsers()->for($companyB)->create())
|
||||
->post(route('users.email', ['userId' => $user->id]))
|
||||
->assertStatus(302);
|
||||
|
||||
$this->actingAs($superuser)
|
||||
->post(route('users.email', ['userId' => $user->id]))
|
||||
->assertStatus(302);
|
||||
|
||||
Notification::assertSentTo(
|
||||
[$user], CurrentInventory::class
|
||||
);
|
||||
}
|
||||
|
||||
public function testUserWithoutCompanyPermissionsCannotDeleteUser()
|
||||
public function testPermissionsToDeleteUser()
|
||||
{
|
||||
|
||||
$this->settings->enableMultipleFullCompanySupport();
|
||||
|
|
|
@ -10,7 +10,7 @@ use App\Notifications\CurrentInventory;
|
|||
|
||||
class ViewUserTest extends TestCase
|
||||
{
|
||||
public function testUserWithoutCompanyPermissionsCannotViewUserDetailPage()
|
||||
public function testPermissionsForUserDetailPage()
|
||||
{
|
||||
$this->settings->enableMultipleFullCompanySupport();
|
||||
|
||||
|
@ -29,7 +29,7 @@ class ViewUserTest extends TestCase
|
|||
->assertStatus(200);
|
||||
}
|
||||
|
||||
public function testUserWithoutCompanyPermissionsCannotViewPrintAllInventoryPage()
|
||||
public function testPermissionsForPrintAllInventoryPage()
|
||||
{
|
||||
$this->settings->enableMultipleFullCompanySupport();
|
||||
//$this->withoutExceptionHandling();
|
||||
|
|
Loading…
Reference in a new issue