Skip to content

A free open source IT asset/license management system

Fix method and variable names

Marcus Moore261231c09eb7
diff --git a/tests/Feature/AssetModels/Ui/UpdateAssetModelsTest.php b/tests/Feature/AssetModels/Ui/UpdateAssetModelsTest.php
index 6fdd1bbcfc..a46ecb849d 100644
--- a/tests/Feature/AssetModels/Ui/UpdateAssetModelsTest.php
+++ b/tests/Feature/AssetModels/Ui/UpdateAssetModelsTest.php
@@ -11,7 +11,7 @@ use Tests\TestCase;
class UpdateAssetModelsTest extends TestCase
{
- public function testPermissionRequiredToStoreAssetModel()
+ public function testPermissionRequiredToUpdateAssetModel()
{
$this->actingAs(User::factory()->create())
->put(route('models.update', ['model' => AssetModel::factory()->create()]), [
diff --git a/tests/Feature/Assets/Ui/AuditAssetTest.php b/tests/Feature/Assets/Ui/AuditAssetTest.php
index 0a7bbdce1a..473a5af531 100644
--- a/tests/Feature/Assets/Ui/AuditAssetTest.php
+++ b/tests/Feature/Assets/Ui/AuditAssetTest.php
@@ -8,10 +8,10 @@ use Tests\TestCase;
class AuditAssetTest extends TestCase
{
- public function testPermissionRequiredToCreateAssetModel()
+ public function testPermissionRequiredToViewAuditCreatePage()
{
$this->actingAs(User::factory()->create())
- ->get(route('clone/hardware', Asset::factory()->create()))
+ ->get(route('asset.audit.create', Asset::factory()->create()))
->assertForbidden();
}
@@ -22,6 +22,13 @@ class AuditAssetTest extends TestCase
->assertStatus(200);
}
+ public function testPermissionRequiredToAuditAsset()
+ {
+ $this->actingAs(User::factory()->create())
+ ->post(route('asset.audit.store', Asset::factory()->create()))
+ ->assertForbidden();
+ }
+
public function testAssetAuditPostIsRedirectedToAssetIndexIfRedirectSelectionIsIndex()
{
$asset = Asset::factory()->create();
diff --git a/tests/Feature/Assets/Ui/CloneAssetTest.php b/tests/Feature/Assets/Ui/CloneAssetTest.php
index 7989d008b5..acf7e5a782 100644
--- a/tests/Feature/Assets/Ui/CloneAssetTest.php
+++ b/tests/Feature/Assets/Ui/CloneAssetTest.php
@@ -8,7 +8,7 @@ use Tests\TestCase;
class CloneAssetTest extends TestCase
{
- public function testPermissionRequiredToCreateAssetModel()
+ public function testPermissionRequiredToCloneAsset()
{
$asset = Asset::factory()->create();
$this->actingAs(User::factory()->create())
diff --git a/tests/Feature/Consumables/Api/ConsumableUpdateTest.php b/tests/Feature/Consumables/Api/ConsumableUpdateTest.php
index 1c1e05d4d4..0d512b7604 100644
--- a/tests/Feature/Consumables/Api/ConsumableUpdateTest.php
+++ b/tests/Feature/Consumables/Api/ConsumableUpdateTest.php
@@ -25,7 +25,6 @@ class ConsumableUpdateTest extends TestCase
$consumable->refresh();
$this->assertEquals('Test Consumable', $consumable->name, 'Name was not updated');
-
}
public function testCannotUpdateConsumableViaPatchWithInvalidCategoryType()
@@ -43,10 +42,8 @@ class ConsumableUpdateTest extends TestCase
->assertStatus(200)
->json();
- $category->refresh();
+ $consumable->refresh();
$this->assertNotEquals('Test Consumable', $consumable->name, 'Name was not updated');
$this->assertNotEquals('consumable', $consumable->category_id, 'Category was not updated');
-
}
-
}
diff --git a/tests/Feature/Consumables/Ui/EditConsumableTest.php b/tests/Feature/Consumables/Ui/EditConsumableTest.php
index 308b7647b6..17f3d3daa8 100644
--- a/tests/Feature/Consumables/Ui/EditConsumableTest.php
+++ b/tests/Feature/Consumables/Ui/EditConsumableTest.php
@@ -11,7 +11,7 @@ class EditConsumableTest extends TestCase
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
- ->get(route('consumables.show', Consumable::factory()->create()))
+ ->get(route('consumables.edit', Consumable::factory()->create()))
->assertOk();
}
}
diff --git a/tests/Feature/Departments/Ui/IndexDepartmentsTest.php b/tests/Feature/Departments/Ui/IndexDepartmentsTest.php
index 68caa29b23..d4ad9259c0 100644
--- a/tests/Feature/Departments/Ui/IndexDepartmentsTest.php
+++ b/tests/Feature/Departments/Ui/IndexDepartmentsTest.php
@@ -18,7 +18,7 @@ class IndexDepartmentsTest extends TestCase
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
- ->get(route('components.index'))
+ ->get(route('departments.index'))
->assertOk();
}
diff --git a/tests/Feature/Depreciations/Api/DepreciationsIndexTest.php b/tests/Feature/Depreciations/Api/DepreciationsIndexTest.php
index 29583001ab..c70ef4d587 100644
--- a/tests/Feature/Depreciations/Api/DepreciationsIndexTest.php
+++ b/tests/Feature/Depreciations/Api/DepreciationsIndexTest.php
@@ -10,7 +10,7 @@ class DepreciationsIndexTest extends TestCase
public function testViewingDepreciationIndexRequiresPermission()
{
$this->actingAsForApi(User::factory()->create())
- ->getJson(route('api.departments.index'))
+ ->getJson(route('api.depreciations.index'))
->assertForbidden();
}
diff --git a/tests/Feature/Locations/Api/CreateLocationsTest.php b/tests/Feature/Locations/Api/CreateLocationsTest.php
index 0a75517f31..fc2686ae72 100644
--- a/tests/Feature/Locations/Api/CreateLocationsTest.php
+++ b/tests/Feature/Locations/Api/CreateLocationsTest.php
@@ -12,7 +12,7 @@ class CreateLocationsTest extends TestCase
public function testRequiresPermissionToCreateLocation()
{
$this->actingAsForApi(User::factory()->create())
- ->postJson(route('api.departments.store'))
+ ->postJson(route('api.locations.store'))
->assertForbidden();
}
@@ -31,9 +31,9 @@ class CreateLocationsTest extends TestCase
$this->assertTrue(Location::where('name', 'Test Location')->exists());
- $department = Location::find($response['payload']['id']);
- $this->assertEquals('Test Location', $department->name);
- $this->assertEquals('Test Note', $department->notes);
+ $location = Location::find($response['payload']['id']);
+ $this->assertEquals('Test Location', $location->name);
+ $this->assertEquals('Test Note', $location->notes);
}
public function testCannotCreateNewLocationsWithTheSameName()
diff --git a/tests/Feature/Manufacturers/Api/CreateManufacturersTest.php b/tests/Feature/Manufacturers/Api/CreateManufacturersTest.php
index 9dc953148e..df62928dc7 100644
--- a/tests/Feature/Manufacturers/Api/CreateManufacturersTest.php
+++ b/tests/Feature/Manufacturers/Api/CreateManufacturersTest.php
@@ -10,10 +10,10 @@ class CreateManufacturersTest extends TestCase
{
- public function testRequiresPermissionToCreateDepartment()
+ public function testRequiresPermissionToCreateManufacturer()
{
$this->actingAsForApi(User::factory()->create())
- ->postJson(route('api.departments.store'))
+ ->postJson(route('api.manufacturers.store'))
->assertForbidden();
}
diff --git a/tests/Feature/Manufacturers/Api/UpdateManufacturersTest.php b/tests/Feature/Manufacturers/Api/UpdateManufacturersTest.php
index f40052f2b2..92a376e756 100644
--- a/tests/Feature/Manufacturers/Api/UpdateManufacturersTest.php
+++ b/tests/Feature/Manufacturers/Api/UpdateManufacturersTest.php
@@ -28,11 +28,11 @@ class UpdateManufacturersTest extends TestCase
public function testUserCanEditManufacturers()
{
- $department = Manufacturer::factory()->create(['name' => 'Test Manufacturer']);
+ $manufacturer = Manufacturer::factory()->create(['name' => 'Test Manufacturer']);
$this->assertTrue(Manufacturer::where('name', 'Test Manufacturer')->exists());
$response = $this->actingAs(User::factory()->superuser()->create())
- ->put(route('manufacturers.update', ['manufacturer' => $department]), [
+ ->put(route('manufacturers.update', ['manufacturer' => $manufacturer]), [
'name' => 'Test Manufacturer Edited',
'notes' => 'Test Note Edited',
])