Initial Ladill Transfer app — file sharing with QR links.
Scaffolded from the Ladill mini/events extraction pattern: multi-file transfers, retention controls, public landing pages, analytics, and Gitea deploy workflow. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\QrCode;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Str;
|
||||
use Tests\TestCase;
|
||||
|
||||
class SearchTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
private function user(): User
|
||||
{
|
||||
return User::create(['public_id' => (string) Str::uuid(), 'name' => 'A', 'email' => 'a+'.uniqid().'@x.com']);
|
||||
}
|
||||
|
||||
public function test_user_can_search_owned_event_by_label(): void
|
||||
{
|
||||
$user = $this->user();
|
||||
|
||||
QrCode::query()->create([
|
||||
'user_id' => $user->id,
|
||||
'short_code' => 'summit',
|
||||
'type' => QrCode::TYPE_EVENT,
|
||||
'label' => 'NextGen Summit',
|
||||
'destination_url' => 'https://example.com',
|
||||
'is_active' => true,
|
||||
]);
|
||||
|
||||
$response = $this->actingAs($user)
|
||||
->getJson(route('events.search', ['q' => 'NextGen']));
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertJsonPath('results.0.type', 'event');
|
||||
$response->assertJsonPath('results.0.title', 'NextGen Summit');
|
||||
}
|
||||
|
||||
public function test_search_page_renders_for_authenticated_user(): void
|
||||
{
|
||||
$user = $this->user();
|
||||
|
||||
$this->actingAs($user)
|
||||
->get(route('events.search'))
|
||||
->assertOk()
|
||||
->assertSee('Find events and programmes', false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user