Updated tests for new RMB behavior

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2025-02-20 18:28:46 +00:00
parent e0beed0fa3
commit 54cc427ef5
7 changed files with 11 additions and 11 deletions

View file

@ -26,7 +26,7 @@ class ShowAccessoryTest extends TestCase
$this->actingAs($userForCompanyB) $this->actingAs($userForCompanyB)
->get(route('accessories.show', $accessoryForCompanyA)) ->get(route('accessories.show', $accessoryForCompanyA))
->assertForbidden(); ->assertStatus(302);
} }
public function testCanViewAccessory() public function testCanViewAccessory()

View file

@ -54,7 +54,7 @@ class UpdateConsumableTest extends TestCase
->put(route('consumables.update', $consumableForCompanyA), [ ->put(route('consumables.update', $consumableForCompanyA), [
// //
]) ])
->assertForbidden(); ->assertStatus(302);
} }
public function testCannotSetQuantityToAmountLowerThanWhatIsCheckedOut() public function testCannotSetQuantityToAmountLowerThanWhatIsCheckedOut()

View file

@ -17,7 +17,7 @@ class DeleteReportTemplateTest extends TestCase implements TestsPermissionsRequi
$this->actingAs(User::factory()->create()) $this->actingAs(User::factory()->create())
->post(route('report-templates.destroy', $reportTemplate->id)) ->post(route('report-templates.destroy', $reportTemplate->id))
->assertNotFound(); ->assertStatus(302);
$this->assertModelExists($reportTemplate); $this->assertModelExists($reportTemplate);
} }
@ -28,7 +28,7 @@ class DeleteReportTemplateTest extends TestCase implements TestsPermissionsRequi
$this->actingAs(User::factory()->canViewReports()->create()) $this->actingAs(User::factory()->canViewReports()->create())
->delete(route('report-templates.destroy', $reportTemplate->id)) ->delete(route('report-templates.destroy', $reportTemplate->id))
->assertNotFound(); ->assertStatus(302);
$this->assertModelExists($reportTemplate); $this->assertModelExists($reportTemplate);
} }

View file

@ -15,7 +15,7 @@ class EditReportTemplateTest extends TestCase implements TestsPermissionsRequire
{ {
$this->actingAs(User::factory()->create()) $this->actingAs(User::factory()->create())
->get(route('report-templates.edit', ReportTemplate::factory()->create())) ->get(route('report-templates.edit', ReportTemplate::factory()->create()))
->assertNotFound(); ->assertStatus(302);
} }
public function testCannotLoadEditPageForAnotherUsersReportTemplate() public function testCannotLoadEditPageForAnotherUsersReportTemplate()
@ -25,7 +25,7 @@ class EditReportTemplateTest extends TestCase implements TestsPermissionsRequire
$this->actingAs($user) $this->actingAs($user)
->get(route('report-templates.edit', $reportTemplate)) ->get(route('report-templates.edit', $reportTemplate))
->assertNotFound(); ->assertStatus(302);
} }
public function testCanLoadEditReportTemplatePage() public function testCanLoadEditReportTemplatePage()

View file

@ -15,7 +15,7 @@ class ShowReportTemplateTest extends TestCase implements TestsPermissionsRequire
{ {
$this->actingAs(User::factory()->create()) $this->actingAs(User::factory()->create())
->get(route('report-templates.show', ReportTemplate::factory()->create())) ->get(route('report-templates.show', ReportTemplate::factory()->create()))
->assertNotFound(); ->assertStatus(302);
} }
public function testCanLoadASavedReportTemplate() public function testCanLoadASavedReportTemplate()
@ -38,6 +38,6 @@ class ShowReportTemplateTest extends TestCase implements TestsPermissionsRequire
$this->actingAs(User::factory()->canViewReports()->create()) $this->actingAs(User::factory()->canViewReports()->create())
->get(route('report-templates.show', $reportTemplate)) ->get(route('report-templates.show', $reportTemplate))
->assertNotFound(); ->assertStatus(302);
} }
} }

View file

@ -15,14 +15,14 @@ class UpdateReportTemplateTest extends TestCase implements TestsPermissionsRequi
{ {
$this->actingAs(User::factory()->create()) $this->actingAs(User::factory()->create())
->post(route('report-templates.update', ReportTemplate::factory()->create())) ->post(route('report-templates.update', ReportTemplate::factory()->create()))
->assertNotFound(); ->assertStatus(302);
} }
public function testCannotUpdateAnotherUsersReportTemplate() public function testCannotUpdateAnotherUsersReportTemplate()
{ {
$this->actingAs(User::factory()->canViewReports()->create()) $this->actingAs(User::factory()->canViewReports()->create())
->post(route('report-templates.update', ReportTemplate::factory()->create())) ->post(route('report-templates.update', ReportTemplate::factory()->create()))
->assertNotFound(); ->assertStatus(302);
} }
public function testUpdatingReportTemplateRequiresValidFields() public function testUpdatingReportTemplateRequiresValidFields()

View file

@ -21,7 +21,7 @@ class ViewUserTest extends TestCase
$this->actingAs(User::factory()->editUsers()->for($companyA)->create()) $this->actingAs(User::factory()->editUsers()->for($companyA)->create())
->get(route('users.show', $user)) ->get(route('users.show', $user))
->assertStatus(403); ->assertStatus(302);
$this->actingAs($superuser) $this->actingAs($superuser)
->get(route('users.show', $user)) ->get(route('users.show', $user))