A free open source IT asset/license management system
Updated tests for new RMB behavior
snipe54cc427ef5d5
diff --git a/tests/Feature/Accessories/Ui/ShowAccessoryTest.php b/tests/Feature/Accessories/Ui/ShowAccessoryTest.phpindex 56d8fb42c8..288ec9a50c 100644--- a/tests/Feature/Accessories/Ui/ShowAccessoryTest.php+++ b/tests/Feature/Accessories/Ui/ShowAccessoryTest.php@@ -26,7 +26,7 @@ class ShowAccessoryTest extends TestCase$this->actingAs($userForCompanyB)->get(route('accessories.show', $accessoryForCompanyA))- ->assertForbidden();+ ->assertStatus(302);}public function testCanViewAccessory()diff --git a/tests/Feature/Consumables/Ui/UpdateConsumableTest.php b/tests/Feature/Consumables/Ui/UpdateConsumableTest.phpindex e885daa598..dbb13b9ce7 100644--- a/tests/Feature/Consumables/Ui/UpdateConsumableTest.php+++ b/tests/Feature/Consumables/Ui/UpdateConsumableTest.php@@ -54,7 +54,7 @@ class UpdateConsumableTest extends TestCase->put(route('consumables.update', $consumableForCompanyA), [//])- ->assertForbidden();+ ->assertStatus(302);}public function testCannotSetQuantityToAmountLowerThanWhatIsCheckedOut()diff --git a/tests/Feature/ReportTemplates/DeleteReportTemplateTest.php b/tests/Feature/ReportTemplates/DeleteReportTemplateTest.phpindex 2b108443a3..cebc8156ad 100644--- a/tests/Feature/ReportTemplates/DeleteReportTemplateTest.php+++ b/tests/Feature/ReportTemplates/DeleteReportTemplateTest.php@@ -17,7 +17,7 @@ class DeleteReportTemplateTest extends TestCase implements TestsPermissionsRequi$this->actingAs(User::factory()->create())->post(route('report-templates.destroy', $reportTemplate->id))- ->assertNotFound();+ ->assertStatus(302);$this->assertModelExists($reportTemplate);}@@ -28,7 +28,7 @@ class DeleteReportTemplateTest extends TestCase implements TestsPermissionsRequi$this->actingAs(User::factory()->canViewReports()->create())->delete(route('report-templates.destroy', $reportTemplate->id))- ->assertNotFound();+ ->assertStatus(302);$this->assertModelExists($reportTemplate);}diff --git a/tests/Feature/ReportTemplates/EditReportTemplateTest.php b/tests/Feature/ReportTemplates/EditReportTemplateTest.phpindex 88363ec8b1..d359baddde 100644--- a/tests/Feature/ReportTemplates/EditReportTemplateTest.php+++ b/tests/Feature/ReportTemplates/EditReportTemplateTest.php@@ -15,7 +15,7 @@ class EditReportTemplateTest extends TestCase implements TestsPermissionsRequire{$this->actingAs(User::factory()->create())->get(route('report-templates.edit', ReportTemplate::factory()->create()))- ->assertNotFound();+ ->assertStatus(302);}public function testCannotLoadEditPageForAnotherUsersReportTemplate()@@ -25,7 +25,7 @@ class EditReportTemplateTest extends TestCase implements TestsPermissionsRequire$this->actingAs($user)->get(route('report-templates.edit', $reportTemplate))- ->assertNotFound();+ ->assertStatus(302);}public function testCanLoadEditReportTemplatePage()diff --git a/tests/Feature/ReportTemplates/ShowReportTemplateTest.php b/tests/Feature/ReportTemplates/ShowReportTemplateTest.phpindex 3e57db898a..748df288b5 100644--- a/tests/Feature/ReportTemplates/ShowReportTemplateTest.php+++ b/tests/Feature/ReportTemplates/ShowReportTemplateTest.php@@ -15,7 +15,7 @@ class ShowReportTemplateTest extends TestCase implements TestsPermissionsRequire{$this->actingAs(User::factory()->create())->get(route('report-templates.show', ReportTemplate::factory()->create()))- ->assertNotFound();+ ->assertStatus(302);}public function testCanLoadASavedReportTemplate()@@ -38,6 +38,6 @@ class ShowReportTemplateTest extends TestCase implements TestsPermissionsRequire$this->actingAs(User::factory()->canViewReports()->create())->get(route('report-templates.show', $reportTemplate))- ->assertNotFound();+ ->assertStatus(302);}}diff --git a/tests/Feature/ReportTemplates/UpdateReportTemplateTest.php b/tests/Feature/ReportTemplates/UpdateReportTemplateTest.phpindex 9afecb0849..09c168b27e 100644--- a/tests/Feature/ReportTemplates/UpdateReportTemplateTest.php+++ b/tests/Feature/ReportTemplates/UpdateReportTemplateTest.php@@ -15,14 +15,14 @@ class UpdateReportTemplateTest extends TestCase implements TestsPermissionsRequi{$this->actingAs(User::factory()->create())->post(route('report-templates.update', ReportTemplate::factory()->create()))- ->assertNotFound();+ ->assertStatus(302);}public function testCannotUpdateAnotherUsersReportTemplate(){$this->actingAs(User::factory()->canViewReports()->create())->post(route('report-templates.update', ReportTemplate::factory()->create()))- ->assertNotFound();+ ->assertStatus(302);}public function testUpdatingReportTemplateRequiresValidFields()diff --git a/tests/Feature/Users/Ui/ViewUserTest.php b/tests/Feature/Users/Ui/ViewUserTest.phpindex 6b85d32ffe..cb21a1e9e2 100644--- a/tests/Feature/Users/Ui/ViewUserTest.php+++ b/tests/Feature/Users/Ui/ViewUserTest.php@@ -21,7 +21,7 @@ class ViewUserTest extends TestCase$this->actingAs(User::factory()->editUsers()->for($companyA)->create())->get(route('users.show', $user))- ->assertStatus(403);+ ->assertStatus(302);$this->actingAs($superuser)->get(route('users.show', $user))