1
0
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:
Dan Brown
2021-03-03 22:11:00 +00:00
parent 382f155f76
commit 4d4a57d1bf
7 changed files with 170 additions and 192 deletions

View 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' => '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', [