Skip to content

Commit

Permalink
Merge pull request #62 from SlovakNationalGallery/fix/test-fake-images
Browse files Browse the repository at this point in the history
fix: fake images in tests
  • Loading branch information
rastislav-chynoransky authored Jul 9, 2024
2 parents ff641d7 + 838be17 commit 7e2b027
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 3 additions & 1 deletion database/factories/PhotoFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public function withMedia(): Factory
{
return $this->afterCreating(function (Photo $photo) {
$photo
->addMediaFromUrl($this->faker->imageUrl())
->addMediaFromBase64(
'R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==',
)
->toMediaCollection('photos');
});
}
Expand Down
6 changes: 2 additions & 4 deletions tests/Feature/SitemapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ public function test_sitemap_lists_static_pages()
->assertSee(route('artworks.index'));
}

public function tests_litsts_presentable_artworks()
public function test_sitemap_lists_presentable_artworks()
{
$privateArtwork = Artwork::factory()->create();
$presentableArtwork = Artwork::factory()
->presentable()
->create();
$presentableArtwork = Artwork::factory()->presentable()->create();

$this->get('/sitemap.xml')
->assertSee(route('artworks.show', $presentableArtwork))
Expand Down

0 comments on commit 7e2b027

Please sign in to comment.