Add guest policy settings
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Tests\Feature;
|
||||
|
||||
use App\Models\Event;
|
||||
use App\Models\EventPackage;
|
||||
use App\Models\GuestPolicySetting;
|
||||
use App\Models\MediaStorageTarget;
|
||||
use App\Models\Package;
|
||||
use App\Models\Photo;
|
||||
@@ -206,6 +207,25 @@ class GuestJoinTokenFlowTest extends TestCase
|
||||
->assertJsonPath('error.code', 'invalid_token');
|
||||
}
|
||||
|
||||
public function test_gallery_defaults_use_guest_policy_settings(): void
|
||||
{
|
||||
GuestPolicySetting::flushCache();
|
||||
GuestPolicySetting::query()->create([
|
||||
'id' => 1,
|
||||
'guest_downloads_enabled' => false,
|
||||
'guest_sharing_enabled' => false,
|
||||
]);
|
||||
|
||||
$event = $this->createPublishedEvent();
|
||||
$token = $this->tokenService->createToken($event);
|
||||
|
||||
$response = $this->getJson("/api/v1/gallery/{$token->token}");
|
||||
|
||||
$response->assertOk()
|
||||
->assertJsonPath('event.guest_downloads_enabled', false)
|
||||
->assertJsonPath('event.guest_sharing_enabled', false);
|
||||
}
|
||||
|
||||
public function test_guest_cannot_access_event_with_revoked_token(): void
|
||||
{
|
||||
$event = $this->createPublishedEvent();
|
||||
|
||||
Reference in New Issue
Block a user