mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-03 11:48:25 +00:00
154 - Sending Promoters an Invitation Email
This commit is contained in:
@@ -4,7 +4,9 @@ namespace Tests\Feature;
|
||||
|
||||
use App\Invitation;
|
||||
use Tests\TestCase;
|
||||
use App\Mail\InvitationEmail;
|
||||
use App\Facades\InvitationCode;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
@@ -15,6 +17,7 @@ class InvitePromoterTest extends TestCase
|
||||
/** @test */
|
||||
function inviting_a_promoter_via_the_cli()
|
||||
{
|
||||
Mail::fake();
|
||||
InvitationCode::shouldReceive('generate')->andReturn('TESTCODE1234');
|
||||
|
||||
$this->artisan('invite-promoter', ['email' => 'john@example.com']);
|
||||
@@ -23,5 +26,10 @@ class InvitePromoterTest extends TestCase
|
||||
$invitation = Invitation::first();
|
||||
$this->assertEquals('john@example.com', $invitation->email);
|
||||
$this->assertEquals('TESTCODE1234', $invitation->code);
|
||||
|
||||
Mail::assertSent(InvitationEmail::class, function ($mail) use ($invitation) {
|
||||
return $mail->hasTo('john@example.com')
|
||||
&& $mail->invitation->is($invitation);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user