mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Add simple tests to ensure views render
This commit is contained in:
parent
af135fa42c
commit
1be7508340
|
@ -13,4 +13,11 @@ class AccessoriesIndexTest extends TestCase
|
|||
->get(route('accessories.index'))
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('accessories.index'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
||||
|
|
17
tests/Feature/Accessories/Ui/EditAccessoryTest.php
Normal file
17
tests/Feature/Accessories/Ui/EditAccessoryTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Accessories\Ui;
|
||||
|
||||
use App\Models\Accessory;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class EditAccessoryTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('accessories.edit', Accessory::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
17
tests/Feature/Accessories/Ui/ShowAccessoryTest.php
Normal file
17
tests/Feature/Accessories/Ui/ShowAccessoryTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Accessories\Ui;
|
||||
|
||||
use App\Models\Accessory;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ShowAccessoryTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('accessories.show', Accessory::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\AssetMaintenances\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AssetMaintenanceIndexTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('maintenances.index'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\AssetMaintenances\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CreateAssetMaintenanceTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('maintenances.create'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\AssetMaintenances\Ui;
|
||||
|
||||
use App\Models\AssetMaintenance;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class EditAssetMaintenanceTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('maintenances.edit', AssetMaintenance::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\AssetMaintenances\Ui;
|
||||
|
||||
use App\Models\AssetMaintenance;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ShowAssetMaintenanceTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('maintenances.show', AssetMaintenance::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
|
@ -19,6 +19,13 @@ class CreateAssetModelsTest extends TestCase
|
|||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('models.create'))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testUserCanCreateAssetModels()
|
||||
{
|
||||
$this->assertFalse(AssetModel::where('name', 'Test Model')->exists());
|
||||
|
|
17
tests/Feature/AssetModels/Ui/ShowAssetModelsTest.php
Normal file
17
tests/Feature/AssetModels/Ui/ShowAssetModelsTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\AssetModels\Ui;
|
||||
|
||||
use App\Models\AssetModel;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ShowAssetModelsTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('models.show', AssetModel::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
|
@ -21,6 +21,13 @@ class UpdateAssetModelsTest extends TestCase
|
|||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('models.edit', AssetModel::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testUserCanEditAssetModels()
|
||||
{
|
||||
$category = Category::factory()->forAssets()->create();
|
||||
|
|
16
tests/Feature/Assets/Ui/AssetIndexTest.php
Normal file
16
tests/Feature/Assets/Ui/AssetIndexTest.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Assets\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AssetIndexTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('hardware.index'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
16
tests/Feature/Assets/Ui/StoreAssetsTest.php
Normal file
16
tests/Feature/Assets/Ui/StoreAssetsTest.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Assets\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class StoreAssetsTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('hardware.create'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
|
@ -19,6 +19,13 @@ class CreateCategoriesTest extends TestCase
|
|||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('categories.create'))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testUserCanCreateCategories()
|
||||
{
|
||||
$this->assertFalse(Category::where('name', 'Test Category')->exists());
|
||||
|
|
17
tests/Feature/Categories/Ui/ShowCategoryTest.php
Normal file
17
tests/Feature/Categories/Ui/ShowCategoryTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Categories\Ui;
|
||||
|
||||
use App\Models\Category;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ShowCategoryTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('categories.show', Category::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
|
@ -20,6 +20,13 @@ class UpdateCategoriesTest extends TestCase
|
|||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('categories.edit', Category::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testUserCanCreateCategories()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
|
|
|
@ -23,6 +23,13 @@ class AccessoryCheckinTest extends TestCase
|
|||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('accessories.checkin.show', Accessory::factory()->checkedOutToUser()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testAccessoryCanBeCheckedIn()
|
||||
{
|
||||
Event::fake([CheckoutableCheckedIn::class]);
|
||||
|
|
|
@ -42,6 +42,13 @@ class AssetCheckinTest extends TestCase
|
|||
->assertRedirect(route('hardware.index'));
|
||||
}
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('hardware.checkin.create', Asset::factory()->assignedToUser()->create()))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testAssetCanBeCheckedIn()
|
||||
{
|
||||
Event::fake([CheckoutableCheckedIn::class]);
|
||||
|
|
|
@ -22,6 +22,13 @@ class ComponentCheckinTest extends TestCase
|
|||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('components.checkin.show', Component::factory()->checkedOutToAsset()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testComponentCheckinPagePostIsRedirectedIfRedirectSelectionIsIndex()
|
||||
{
|
||||
$component = Component::factory()->checkedOutToAsset()->create();
|
||||
|
|
|
@ -17,5 +17,10 @@ class LicenseCheckinTest extends TestCase
|
|||
->assertForbidden();
|
||||
}
|
||||
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('licenses.checkin', LicenseSeat::factory()->assignedToUser()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,13 @@ class AccessoryCheckoutTest extends TestCase
|
|||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('accessories.checkout.show', Accessory::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testValidationWhenCheckingOutAccessory()
|
||||
{
|
||||
$accessory = Accessory::factory()->create();
|
||||
|
|
|
@ -118,6 +118,12 @@ class AssetCheckoutTest extends TestCase
|
|||
Event::assertNotDispatched(CheckoutableCheckedOut::class);
|
||||
}
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('hardware.checkout.create', Asset::factory()->create()))
|
||||
->assertOk();
|
||||
}
|
||||
/**
|
||||
* This data provider contains checkout targets along with the
|
||||
* asset's expected location after the checkout process.
|
||||
|
|
|
@ -21,6 +21,13 @@ class ComponentsCheckoutTest extends TestCase
|
|||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('components.checkout.show', Component::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function test_cannot_checkout_across_companies_when_full_company_support_enabled()
|
||||
{
|
||||
Event::fake([CheckoutableCheckedOut::class]);
|
||||
|
|
|
@ -22,6 +22,12 @@ class ConsumableCheckoutTest extends TestCase
|
|||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('consumables.checkout.show', Consumable::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
public function testValidationWhenCheckingOutConsumable()
|
||||
{
|
||||
$this->actingAs(User::factory()->checkoutConsumables()->create())
|
||||
|
|
|
@ -10,6 +10,13 @@ use Tests\TestCase;
|
|||
|
||||
class LicenseCheckoutTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('licenses.checkout', License::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testNotesAreStoredInActionLogOnCheckoutToAsset()
|
||||
{
|
||||
$admin = User::factory()->superuser()->create();
|
||||
|
|
16
tests/Feature/Companies/Ui/CompanyIndexTest.php
Normal file
16
tests/Feature/Companies/Ui/CompanyIndexTest.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Companies\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CompanyIndexTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('companies.index'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
17
tests/Feature/Companies/Ui/EditCompanyTest.php
Normal file
17
tests/Feature/Companies/Ui/EditCompanyTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Companies\Ui;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class EditCompanyTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('companies.edit', Company::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
17
tests/Feature/Companies/Ui/ShowCompanyTest.php
Normal file
17
tests/Feature/Companies/Ui/ShowCompanyTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Companies\Ui;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ShowCompanyTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('companies.show', Company::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
17
tests/Feature/Components/Ui/EditComponentTest.php
Normal file
17
tests/Feature/Components/Ui/EditComponentTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Components\Ui;
|
||||
|
||||
use App\Models\Component;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class EditComponentTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('components.edit', Component::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
17
tests/Feature/Components/Ui/ShowComponentTest.php
Normal file
17
tests/Feature/Components/Ui/ShowComponentTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Components\Ui;
|
||||
|
||||
use App\Models\Component;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ShowComponentTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('components.show', Component::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
|
@ -16,7 +16,7 @@ class ConsumableViewTest extends TestCase
|
|||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testUserCanListConsumables()
|
||||
public function testUserCanViewAConsumable()
|
||||
{
|
||||
$consumable = Consumable::factory()->create();
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
|
|
16
tests/Feature/Consumables/Ui/CreateConsumableTest.php
Normal file
16
tests/Feature/Consumables/Ui/CreateConsumableTest.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Consumables\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CreateConsumableTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('consumables.create'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
17
tests/Feature/Consumables/Ui/EditConsumableTest.php
Normal file
17
tests/Feature/Consumables/Ui/EditConsumableTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Consumables\Ui;
|
||||
|
||||
use App\Models\Consumable;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class EditConsumableTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('consumables.show', Consumable::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Tests\Feature\Departments\Ui;
|
||||
|
||||
use App\Models\Component;
|
||||
use App\Models\Department;
|
||||
use App\Models\Company;
|
||||
use App\Models\User;
|
||||
|
@ -9,6 +10,13 @@ use Tests\TestCase;
|
|||
|
||||
class CreateDepartmentsTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('departments.create'))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testPermissionRequiredToCreateDepartment()
|
||||
{
|
||||
$this->actingAs(User::factory()->create())
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Tests\Feature\Departments\Ui;
|
||||
|
||||
use App\Models\Component;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
|
@ -14,6 +15,13 @@ class IndexDepartmentsTest extends TestCase
|
|||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('components.index'))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testUserCanListDepartments()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
|
|
17
tests/Feature/Departments/Ui/ShowDepartmentTest.php
Normal file
17
tests/Feature/Departments/Ui/ShowDepartmentTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Departments\Ui;
|
||||
|
||||
use App\Models\Department;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ShowDepartmentTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('departments.show', Department::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
|
@ -19,6 +19,12 @@ class UpdateDepartmentsTest extends TestCase
|
|||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('departments.edit', Department::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testUserCanEditDepartments()
|
||||
{
|
||||
|
|
16
tests/Feature/Depreciations/Ui/CreateDepreciationTest.php
Normal file
16
tests/Feature/Depreciations/Ui/CreateDepreciationTest.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Depreciations\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CreateDepreciationTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('depreciations.create'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Categories\Ui;
|
||||
namespace Tests\Feature\Depreciations\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
|
17
tests/Feature/Depreciations/Ui/ShowDepreciationTest.php
Normal file
17
tests/Feature/Depreciations/Ui/ShowDepreciationTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Depreciations\Ui;
|
||||
|
||||
use App\Models\Depreciation;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ShowDepreciationTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('depreciations.show', Depreciation::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
17
tests/Feature/Depreciations/Ui/UpdateDepreciationTest.php
Normal file
17
tests/Feature/Depreciations/Ui/UpdateDepreciationTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Depreciations\Ui;
|
||||
|
||||
use App\Models\Depreciation;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class UpdateDepreciationTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('depreciations.edit', Depreciation::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
16
tests/Feature/Groups/Ui/CreateGroupTest.php
Normal file
16
tests/Feature/Groups/Ui/CreateGroupTest.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Groups\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CreateGroupTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('groups.create'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
17
tests/Feature/Groups/Ui/ShowGroupTest.php
Normal file
17
tests/Feature/Groups/Ui/ShowGroupTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Groups\Ui;
|
||||
|
||||
use App\Models\Group;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ShowGroupTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('groups.show', Group::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
17
tests/Feature/Groups/Ui/UpdateGroupTest.php
Normal file
17
tests/Feature/Groups/Ui/UpdateGroupTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Groups\Ui;
|
||||
|
||||
use App\Models\Group;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class UpdateGroupTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('groups.edit', Group::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
16
tests/Feature/Importing/Ui/ImportTest.php
Normal file
16
tests/Feature/Importing/Ui/ImportTest.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Importing\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ImportTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('imports.index'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
|
@ -19,7 +19,12 @@ class CreateLicenseTest extends TestCase
|
|||
->assertForbidden();
|
||||
}
|
||||
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('licenses.create'))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testLicenseWithoutPurchaseDateFailsValidation()
|
||||
{
|
||||
|
|
|
@ -16,6 +16,13 @@ class LicenseViewTest extends TestCase
|
|||
->get(route('licenses.show', $license))
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('licenses.show', License::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testLicenseWithPurchaseDateDepreciatesCorrectly()
|
||||
{
|
||||
|
|
17
tests/Feature/Licenses/Ui/UpdateLicenseTest.php
Normal file
17
tests/Feature/Licenses/Ui/UpdateLicenseTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Licenses\Ui;
|
||||
|
||||
use App\Models\License;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class UpdateLicenseTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('licenses.update', License::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
|
@ -19,6 +19,13 @@ class CreateLocationsTest extends TestCase
|
|||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('locations.create'))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testUserCanCreateLocations()
|
||||
{
|
||||
$this->assertFalse(Location::where('name', 'Test Location')->exists());
|
||||
|
|
17
tests/Feature/Locations/Ui/ShowLocationTest.php
Normal file
17
tests/Feature/Locations/Ui/ShowLocationTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Locations\Ui;
|
||||
|
||||
use App\Models\Location;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ShowLocationTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('locations.show', Location::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
|
@ -18,6 +18,12 @@ class UpdateLocationsTest extends TestCase
|
|||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('locations.update', Location::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testUserCanEditLocations()
|
||||
{
|
||||
|
|
16
tests/Feature/Manufacturers/Ui/CreateManufacturerTest.php
Normal file
16
tests/Feature/Manufacturers/Ui/CreateManufacturerTest.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Manufacturers\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CreateManufacturerTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('manufacturers.create'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
16
tests/Feature/Manufacturers/Ui/IndexManufacturersTest.php
Normal file
16
tests/Feature/Manufacturers/Ui/IndexManufacturersTest.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Manufacturers\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class IndexManufacturersTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('manufacturers.index'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
17
tests/Feature/Manufacturers/Ui/ShowManufacturerTest.php
Normal file
17
tests/Feature/Manufacturers/Ui/ShowManufacturerTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Manufacturers\Ui;
|
||||
|
||||
use App\Models\Manufacturer;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ShowManufacturerTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('manufacturers.show', Manufacturer::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
17
tests/Feature/Manufacturers/Ui/UpdateManufacturerTest.php
Normal file
17
tests/Feature/Manufacturers/Ui/UpdateManufacturerTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Manufacturers\Ui;
|
||||
|
||||
use App\Models\Manufacturer;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class UpdateManufacturerTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('manufacturers.edit', Manufacturer::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
16
tests/Feature/PredefinedKits/Ui/CreatePredefinedKitTest.php
Normal file
16
tests/Feature/PredefinedKits/Ui/CreatePredefinedKitTest.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\PredefinedKits\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CreatePredefinedKitTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('kits.create'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
16
tests/Feature/PredefinedKits/Ui/IndexPredefinedKitsTest.php
Normal file
16
tests/Feature/PredefinedKits/Ui/IndexPredefinedKitsTest.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\PredefinedKits\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class IndexPredefinedKitsTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('kits.index'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
17
tests/Feature/PredefinedKits/Ui/ShowPredefinedKitTest.php
Normal file
17
tests/Feature/PredefinedKits/Ui/ShowPredefinedKitTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\PredefinedKits\Ui;
|
||||
|
||||
use App\Models\PredefinedKit;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ShowPredefinedKitTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('kits.show', PredefinedKit::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
17
tests/Feature/PredefinedKits/Ui/UpdatePredefinedKitTest.php
Normal file
17
tests/Feature/PredefinedKits/Ui/UpdatePredefinedKitTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\PredefinedKits\Ui;
|
||||
|
||||
use App\Models\PredefinedKit;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class UpdatePredefinedKitTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('kits.edit', PredefinedKit::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
16
tests/Feature/StatusLabels/Ui/CreateStatusLabelTest.php
Normal file
16
tests/Feature/StatusLabels/Ui/CreateStatusLabelTest.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\StatusLabels\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CreateStatusLabelTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('statuslabels.create'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
16
tests/Feature/StatusLabels/Ui/IndexStatusLabelsTest.php
Normal file
16
tests/Feature/StatusLabels/Ui/IndexStatusLabelsTest.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\StatusLabels\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class IndexStatusLabelsTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('statuslabels.index'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
17
tests/Feature/StatusLabels/Ui/ShowStatusLabelTest.php
Normal file
17
tests/Feature/StatusLabels/Ui/ShowStatusLabelTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\StatusLabels\Ui;
|
||||
|
||||
use App\Models\Statuslabel;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ShowStatusLabelTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('statuslabels.show', Statuslabel::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
17
tests/Feature/StatusLabels/Ui/UpdateStatusLabelTest.php
Normal file
17
tests/Feature/StatusLabels/Ui/UpdateStatusLabelTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\StatusLabels\Ui;
|
||||
|
||||
use App\Models\Statuslabel;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class UpdateStatusLabelTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('statuslabels.edit', Statuslabel::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
16
tests/Feature/Suppliers/Ui/CreateSupplierTest.php
Normal file
16
tests/Feature/Suppliers/Ui/CreateSupplierTest.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Suppliers\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CreateSupplierTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('suppliers.create'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
16
tests/Feature/Suppliers/Ui/IndexSuppliersTest.php
Normal file
16
tests/Feature/Suppliers/Ui/IndexSuppliersTest.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Suppliers\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class IndexSuppliersTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('suppliers.index'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
17
tests/Feature/Suppliers/Ui/ShowSupplierTest.php
Normal file
17
tests/Feature/Suppliers/Ui/ShowSupplierTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Suppliers\Ui;
|
||||
|
||||
use App\Models\Supplier;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ShowSupplierTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('suppliers.show', Supplier::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
17
tests/Feature/Suppliers/Ui/UpdateSupplierTest.php
Normal file
17
tests/Feature/Suppliers/Ui/UpdateSupplierTest.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Suppliers\Ui;
|
||||
|
||||
use App\Models\Supplier;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class UpdateSupplierTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('suppliers.edit', Supplier::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
16
tests/Feature/Users/Ui/CreateUserTest.php
Normal file
16
tests/Feature/Users/Ui/CreateUserTest.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Users\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CreateUserTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('users.create'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
16
tests/Feature/Users/Ui/IndexUsersTest.php
Normal file
16
tests/Feature/Users/Ui/IndexUsersTest.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Users\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class IndexUsersTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('users.index'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
|
@ -9,6 +9,13 @@ use Tests\TestCase;
|
|||
|
||||
class UpdateUserTest extends TestCase
|
||||
{
|
||||
public function testPageRenders()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('users.edit', User::factory()->create()->id))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testUsersCanBeActivatedWithNumber()
|
||||
{
|
||||
$admin = User::factory()->superuser()->create();
|
||||
|
|
Loading…
Reference in a new issue