Skip to content

Commit d2815a7

Browse files
committed
tests: tidy up user delete test
1 parent 39db963 commit d2815a7

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

tests/dummy/tests/Api/V1/Users/DeleteTest.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,16 @@
1616

1717
class DeleteTest extends TestCase
1818
{
19-
2019
public function test(): void
2120
{
2221
$user = User::factory()->createOne();
2322

24-
$expected = $this->serializer
25-
->user($user);
2623
$response = $this
2724
->actingAs(User::factory()->createOne())
2825
->jsonApi('users')
29-
->delete(url('/api/v1/users', $expected['id']));
26+
->delete(url('/api/v1/users', $user));
3027

31-
$response->assertNotFound()
32-
->assertHasError(404, [
28+
$response->assertNotFound()->assertErrorStatus([
3329
'detail' => 'not found message',
3430
'status' => '404',
3531
'title' => 'Not Found',
@@ -40,14 +36,11 @@ public function testUnauthenticated(): void
4036
{
4137
$user = User::factory()->createOne();
4238

43-
$expected = $this->serializer
44-
->user($user);
4539
$response = $this
4640
->jsonApi('users')
47-
->delete(url('/api/v1/users', $expected['id']));
41+
->delete(url('/api/v1/users', $user));
4842

49-
$response->assertNotFound()
50-
->assertHasError(404, [
43+
$response->assertNotFound()->assertErrorStatus([
5144
'detail' => 'not found message',
5245
'status' => '404',
5346
'title' => 'Not Found',

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy