|
@@ -8,7 +8,7 @@ use Tests\Feature\TestCase;
|
|
|
|
|
|
class AssetTest extends TestCase
|
|
|
{
|
|
|
- public function test_asset_group_list()
|
|
|
+ public function test_asset_list()
|
|
|
{
|
|
|
Asset::factory(30)->create();
|
|
|
|
|
@@ -37,7 +37,7 @@ class AssetTest extends TestCase
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
- public function test_asset_group_create(): void
|
|
|
+ public function test_asset_create(): void
|
|
|
{
|
|
|
$form = Asset::factory()->make();
|
|
|
$form->whitelist = [1];
|
|
@@ -47,7 +47,33 @@ class AssetTest extends TestCase
|
|
|
$response->assertStatus(201);
|
|
|
}
|
|
|
|
|
|
- public function test_asset_group_update(): void
|
|
|
+ public function test_asset_detail(): void
|
|
|
+ {
|
|
|
+ $asset = Asset::factory()->create();
|
|
|
+
|
|
|
+ $response = $this->get(route('asset.show', ['asset' => $asset->id]));
|
|
|
+
|
|
|
+ $response->assertStatus(200)->assertJsonStructure([
|
|
|
+ 'data' => [
|
|
|
+ 'id',
|
|
|
+ 'name',
|
|
|
+ 'code',
|
|
|
+ 'description',
|
|
|
+ 'status',
|
|
|
+ 'created_by',
|
|
|
+ 'owner',
|
|
|
+ 'address',
|
|
|
+ 'group_id',
|
|
|
+ 'geo_address_code',
|
|
|
+ 'acl',
|
|
|
+ 'whitelist',
|
|
|
+ 'latitude',
|
|
|
+ 'longitude',
|
|
|
+ ]
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function test_asset_update(): void
|
|
|
{
|
|
|
$asset = Asset::factory()->create();
|
|
|
|
|
@@ -63,7 +89,7 @@ class AssetTest extends TestCase
|
|
|
$this->assertEquals($form->name, $newAsset->name);
|
|
|
}
|
|
|
|
|
|
- public function test_asset_group_delete(): void
|
|
|
+ public function test_asset_delete(): void
|
|
|
{
|
|
|
$asset = Asset::factory()->create();
|
|
|
|