mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Converted some tests from BrowserKit, Updated shared helpers
This commit is contained in:
@@ -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', [
|
||||
|
Reference in New Issue
Block a user