mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Removed duplicate tests
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
0a7e053985
commit
16d65631aa
|
@ -19,23 +19,7 @@ class UpdateAssetModelsTest extends TestCase
|
|||
->assertStatus(403)
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testUserCanCreateAssetModels()
|
||||
{
|
||||
$this->assertFalse(AssetModel::where('name', 'Test Model')->exists());
|
||||
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->post(route('models.store'), [
|
||||
'name' => 'Test Model',
|
||||
'category_id' => Category::factory()->create()->id
|
||||
])
|
||||
->assertStatus(302)
|
||||
->assertSessionHasNoErrors()
|
||||
->assertRedirect(route('models.index'));
|
||||
|
||||
$this->assertTrue(AssetModel::where('name', 'Test Model')->exists());
|
||||
}
|
||||
|
||||
|
||||
public function testUserCanEditAssetModels()
|
||||
{
|
||||
$category = Category::factory()->forAssets()->create();
|
||||
|
|
|
@ -14,38 +14,20 @@ class UpdateDepartmentsTest extends TestCase
|
|||
$this->actingAs(User::factory()->create())
|
||||
->post(route('departments.store'), [
|
||||
'name' => 'Test Department',
|
||||
'category_id' => Category::factory()->create()->id
|
||||
])
|
||||
->assertStatus(403)
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testUserCanCreateDepartments()
|
||||
{
|
||||
$this->assertFalse(Department::where('name', 'Test Department')->exists());
|
||||
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->post(route('departments.store'), [
|
||||
'name' => 'Test Department',
|
||||
'category_id' => Category::factory()->create()->id
|
||||
])
|
||||
->assertStatus(302)
|
||||
->assertSessionHasNoErrors()
|
||||
->assertRedirect(route('departments.index'));
|
||||
|
||||
$this->assertTrue(Department::where('name', 'Test Department')->exists());
|
||||
}
|
||||
|
||||
public function testUserCanEditDepartments()
|
||||
{
|
||||
$category = Category::factory()->forAssets()->create();
|
||||
$department = Department::factory()->create(['name' => 'Test Department']);
|
||||
$this->assertTrue(Department::where('name', 'Test Department')->exists());
|
||||
|
||||
$response = $this->actingAs(User::factory()->superuser()->create())
|
||||
->put(route('departments.update', ['department' => $department]), [
|
||||
'name' => 'Test Department Edited',
|
||||
'category_id' => $department->category_id,
|
||||
])
|
||||
->assertStatus(302)
|
||||
->assertSessionHasNoErrors()
|
||||
|
|
Loading…
Reference in a new issue