]> BookStack Code Mirror - bookstack/blobdiff - tests/Auth/UserInviteTest.php
Added front-end toggle and testing of inline attachments
[bookstack] / tests / Auth / UserInviteTest.php
index f2a1d0e78177e94330515b37eb924e19770c9c95..b6f521eaa23196466114b27a04d5cca41b885115 100644 (file)
@@ -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' => '[email protected]',
+            'email' => $email,
             'send_invite' => 'true',
         ]);
+        $resp->assertRedirect('/settings/users');
 
-        $newUser = User::query()->where('email', '=', '[email protected]')->orderBy('id', 'desc')->first();
+        $newUser = User::query()->where('email', '=', $email)->orderBy('id', 'desc')->first();
 
         Notification::assertSentTo($newUser, UserInvite::class);
         $this->assertDatabaseHas('user_invites', [