This commit is contained in:
2026-03-20 21:17:26 +01:00
parent 1a62fcb81d
commit 29c3ff8572
229 changed files with 13147 additions and 2577 deletions

View File

@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
use App\Models\Artwork;
use App\Models\User;
it('renders the canonical profile gallery page', function () {
$user = User::factory()->create([
'username' => 'gregor',
]);
Artwork::factory()->create([
'user_id' => $user->id,
'title' => 'Gallery Artwork',
'is_public' => true,
'is_approved' => true,
'published_at' => now()->subDay(),
]);
$this->get('/@gregor/gallery')
->assertOk()
->assertSee('http://skinbase26.test/@gregor/gallery', false)
->assertSee('Profile\\/ProfileGallery', false);
});
it('redirects the legacy gallery route to the canonical profile gallery', function () {
$user = User::factory()->create([
'username' => 'gregor',
]);
$this->get('/gallery/' . $user->id . '/Gregor%20Klev%C5%BEe')
->assertRedirect('/@gregor/gallery')
->assertStatus(301);
});
it('redirects mixed-case profile gallery usernames to the lowercase canonical route', function () {
User::factory()->create([
'username' => 'gregor',
]);
$this->get('/@Gregor/gallery')
->assertRedirect('/@gregor/gallery')
->assertStatus(301);
});