mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 11:14:06 +00:00
149 - Viewing Used or Invalid Invitations
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
use App\User;
|
||||
use App\Invitation;
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
@@ -17,6 +18,7 @@ class AcceptInvitationTest extends TestCase
|
||||
$this->withoutExceptionHandling();
|
||||
|
||||
$invitation = factory(Invitation::class)->create([
|
||||
'user_id' => null,
|
||||
'code' => 'TESTCODE1234',
|
||||
]);
|
||||
|
||||
@@ -26,4 +28,25 @@ class AcceptInvitationTest extends TestCase
|
||||
$response->assertViewIs('invitations.show');
|
||||
$this->assertTrue($response->data('invitation')->is($invitation));
|
||||
}
|
||||
|
||||
/** @test */
|
||||
function viewing_a_used_invitation()
|
||||
{
|
||||
$invitation = factory(Invitation::class)->create([
|
||||
'user_id' => factory(User::class)->create(),
|
||||
'code' => 'TESTCODE1234',
|
||||
]);
|
||||
|
||||
$response = $this->get('/invitations/TESTCODE1234');
|
||||
|
||||
$response->assertStatus(404);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
function viewing_an_invitation_that_does_not_exist()
|
||||
{
|
||||
$response = $this->get('/invitations/TESTCODE1234');
|
||||
|
||||
$response->assertStatus(404);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user