diff --git a/tests/Feature/Http/Controllers/UserControllerTest.php b/tests/Feature/Http/Controllers/UserControllerTest.php index 947800ce..a706a7b4 100644 --- a/tests/Feature/Http/Controllers/UserControllerTest.php +++ b/tests/Feature/Http/Controllers/UserControllerTest.php @@ -105,16 +105,19 @@ public function test_users_update(): void 'email' => 'updated.email@example.com', ]; - $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); } /**