Skip to content

Commit

Permalink
change update test
Browse files Browse the repository at this point in the history
Signed-off-by: Valentin Sickert <[email protected]>
  • Loading branch information
Lapotor committed Dec 13, 2023
1 parent 61f323a commit 34e70fc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/Feature/Http/Controllers/UserControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,19 @@ public function test_users_update(): void
'email' => '[email protected]',
];

$newUserData = array_merge($user->toArray(), $userData);

// Send a PATCH request to the update endpoint
$response = $this->put('/api/v1/users/' . $user->id, $userData);

// Assert that the response has a successful status code
$response->assertStatus(200);

$this->assertDatabaseHas('users', [
'name' => $userData['name'],
'email' => $userData['email'],
]);

// Assert that the response contains the updated user data
$response->assertJsonFragment($newUserData);
$response->assertJsonFragment($userData);
}

/**
Expand Down

0 comments on commit 34e70fc

Please sign in to comment.