create(); // public + approved Artwork::factory()->private()->create(); Artwork::factory()->unapproved()->create(); expect(Artwork::public()->count())->toBe(1); }); test('slug-based route generation produces SEO friendly url', function () { $art = Artwork::factory()->create(['slug' => 'my-unique-art']); $url = route('artworks.show', [ 'contentTypeSlug' => 'photography', 'categoryPath' => 'abstract', 'artwork' => $art->slug, ]); expect($url)->toContain('/photography/abstract/my-unique-art'); }); test('soft delete hides artwork from public scope', function () { $art = Artwork::factory()->create(); $art->delete(); expect(Artwork::public()->where('id', $art->id)->exists())->toBeFalse(); }); test('approval filtering works via approved scope', function () { Artwork::factory()->create(); Artwork::factory()->unapproved()->create(); expect(Artwork::approved()->count())->toBe(1); }); test('admin routes are protected from unauthenticated users', function () { $this->get('/admin/artworks')->assertRedirect('/login'); });