create([ 'username' => 'similarmetaauthor', 'name' => 'Similar Meta Author', ]); $contentType = ContentType::query()->create([ 'name' => 'Skins', 'slug' => 'skins', 'description' => 'Skins content type', ]); $category = Category::query()->create([ 'content_type_id' => $contentType->id, 'name' => 'Internet', 'slug' => 'internet', 'description' => 'Internet skins', 'is_active' => true, 'sort_order' => 1, ]); $artwork = Artwork::factory()->for($author)->create([ 'title' => 'Similar Head Artwork', 'slug' => 'similar-head-artwork', 'published_at' => now()->subHour(), 'is_public' => true, 'is_approved' => true, ]); $artwork->categories()->attach($category->id); $response = $this->get(route('art.similar', ['id' => $artwork->id])); $response->assertOk(); $html = $response->getContent(); expect($html) ->toContain('Similar Artworks') ->toContain('application/ld+json'); expect(substr_count($html, 'toBe(1); expect(substr_count($html, 'toBe(1); expect(substr_count($html, 'property="og:title"'))->toBe(1); expect(substr_count($html, 'name="twitter:title"'))->toBe(1); expect(substr_count($html, 'name="robots"'))->toBe(1); });