mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 21:54:14 -08:00
Scaffold tests and add context
This commit is contained in:
parent
999605f832
commit
a799659610
|
@ -11,15 +11,28 @@ class UsersUpdateTest extends TestCase
|
|||
{
|
||||
use InteractsWithSettings;
|
||||
|
||||
public function testSomething()
|
||||
|
||||
public function testCanUpdateUserViaPatch()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
public function testCanUpdateUserViaPut()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
public function testDepartmentPatching()
|
||||
{
|
||||
$this->withoutExceptionHandling();
|
||||
$admin = User::factory()->superuser()->create();
|
||||
$user = User::factory()->forDepartment(['name' => 'Department A'])->create();
|
||||
$department = Department::factory()->create();
|
||||
|
||||
$this->actingAsForApi($admin)->patch(route('api.users.update', $user), [
|
||||
'department_id' => ['id' => $department->id]
|
||||
// This isn't valid but doesn't return an error
|
||||
'department_id' => ['id' => $department->id],
|
||||
// This is the correct syntax
|
||||
// 'department_id' => $department->id,
|
||||
])->assertOk();
|
||||
|
||||
$this->assertTrue(
|
||||
|
|
Loading…
Reference in a new issue