X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/8e3f8de6278c455d529f14e8dfb245dd81e3d1aa..refs/pull/5280/head:/tests/Api/UsersApiTest.php diff --git a/tests/Api/UsersApiTest.php b/tests/Api/UsersApiTest.php index 6ad727257..a0c67d0d2 100644 --- a/tests/Api/UsersApiTest.php +++ b/tests/Api/UsersApiTest.php @@ -143,6 +143,23 @@ class UsersApiTest extends TestCase Notification::assertSentTo($user, UserInviteNotification::class); } + public function test_create_with_send_invite_works_with_value_of_1() + { + $this->actingAsApiAdmin(); + Notification::fake(); + + $resp = $this->postJson($this->baseEndpoint, [ + 'name' => 'Benny Boris', + 'email' => 'bboris@example.com', + 'send_invite' => '1', // Submissions via x-www-form-urlencoded/form-data may use 1 instead of boolean + ]); + + $resp->assertStatus(200); + /** @var User $user */ + $user = User::query()->where('email', '=', 'bboris@example.com')->first(); + Notification::assertSentTo($user, UserInviteNotification::class); + } + public function test_create_name_and_email_validation() { $this->actingAsApiAdmin();