X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/a6633642232efd164d4708967ab59e498fbff896..refs/pull/2700/head:/tests/Auth/UserInviteTest.php diff --git a/tests/Auth/UserInviteTest.php b/tests/Auth/UserInviteTest.php index f2a1d0e78..b6f521eaa 100644 --- a/tests/Auth/UserInviteTest.php +++ b/tests/Auth/UserInviteTest.php @@ -18,13 +18,15 @@ class UserInviteTest extends TestCase Notification::fake(); $admin = $this->getAdmin(); - $this->actingAs($admin)->post('/settings/users/create', [ + $email = Str::random(16) . '@example.com'; + $resp = $this->actingAs($admin)->post('/settings/users/create', [ 'name' => 'Barry', - 'email' => 'tester@example.com', + 'email' => $email, 'send_invite' => 'true', ]); + $resp->assertRedirect('/settings/users'); - $newUser = User::query()->where('email', '=', 'tester@example.com')->orderBy('id', 'desc')->first(); + $newUser = User::query()->where('email', '=', $email)->orderBy('id', 'desc')->first(); Notification::assertSentTo($newUser, UserInvite::class); $this->assertDatabaseHas('user_invites', [