We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69009e0 commit 25395e9Copy full SHA for 25395e9
tests/Feature/Users/Api/StoreUsersTest.php
@@ -57,4 +57,22 @@ public function testDepartmentIdNeedsToBeInteger()
57
$json->has('messages.department_id')->etc();
58
});
59
}
60
+
61
+ public function testCanStoreUser()
62
+ {
63
+ $this->actingAsForApi(User::factory()->createUsers()->create())
64
+ ->postJson(route('api.users.store'), [
65
+ 'first_name' => 'Darth',
66
+ 'username' => 'darthvader',
67
+ 'password' => 'darth_password',
68
+ 'password_confirmation' => 'darth_password',
69
+ ])
70
+ ->assertStatusMessageIs('success')
71
+ ->assertOk();
72
73
+ $this->assertDatabaseHas('users', [
74
75
76
+ ]);
77
+ }
78
0 commit comments