mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
More unification
This commit is contained in:
parent
f325c4afdb
commit
f5705a1dde
|
@ -48,9 +48,9 @@ class DeleteDepartmentTest extends TestCase implements TestsMultipleFullCompanyS
|
||||||
->deleteJson(route('api.departments.destroy', $departmentC))
|
->deleteJson(route('api.departments.destroy', $departmentC))
|
||||||
->assertStatusMessageIs('success');
|
->assertStatusMessageIs('success');
|
||||||
|
|
||||||
$this->assertNotNull($departmentA->fresh(), 'Department unexpectedly deleted');
|
$this->assertDatabaseHas('departments', ['id' => $departmentA->id]);
|
||||||
$this->assertNotNull($departmentB->fresh(), 'Department unexpectedly deleted');
|
$this->assertDatabaseHas('departments', ['id' => $departmentB->id]);
|
||||||
$this->assertNull($departmentC->fresh(), 'Department was not deleted');
|
$this->assertDatabaseMissing('departments', ['id' => $departmentC->id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCannotDeleteDepartmentThatStillHasUsers()
|
public function testCannotDeleteDepartmentThatStillHasUsers()
|
||||||
|
@ -61,7 +61,7 @@ class DeleteDepartmentTest extends TestCase implements TestsMultipleFullCompanyS
|
||||||
->deleteJson(route('api.departments.destroy', $department))
|
->deleteJson(route('api.departments.destroy', $department))
|
||||||
->assertStatusMessageIs('error');
|
->assertStatusMessageIs('error');
|
||||||
|
|
||||||
$this->assertNotNull($department->fresh(), 'Department unexpectedly deleted');
|
$this->assertDatabaseHas('departments', ['id' => $department->id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCanDeleteDepartment()
|
public function testCanDeleteDepartment()
|
||||||
|
|
|
@ -28,7 +28,7 @@ class DeleteDepreciationTest extends TestCase implements TestsPermissionsRequire
|
||||||
->deleteJson(route('api.depreciations.destroy', $depreciation))
|
->deleteJson(route('api.depreciations.destroy', $depreciation))
|
||||||
->assertStatusMessageIs('error');
|
->assertStatusMessageIs('error');
|
||||||
|
|
||||||
$this->assertNotNull($depreciation->fresh(), 'Depreciation unexpectedly deleted');
|
$this->assertDatabaseHas('depreciations', ['id' => $depreciation->id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCanDeleteDepreciation()
|
public function testCanDeleteDepreciation()
|
||||||
|
|
Loading…
Reference in a new issue