Keep generated blog cover URLs within the featured_image VARCHAR(255) limit
Deploy Backend / deploy (push) Successful in 2m48s
Deploy Backend / deploy (push) Successful in 2m48s
Persian covers are percent-encoded into og-image URLs and several long Persian titles produced URLs over 255 chars, failing the prod seeder with a data-too-long error. Shorten Persian cover text so every featured_image fits the column; guard with a seeder test asserting all 24 images are non-empty and under 256 chars.
This commit is contained in:
1 parent
65415beae7
commit
d659c5d325
2 files changed
+13
-6
No files matched your search
@@ -50,6 +50,13 @@ class RealBlogContentSeederTest extends TestCase
|
||||
$this->assertDatabaseHas('posts', ['slug' => $slug.'-fa']);
|
||||
}
|
||||
|
||||
// featured_image is a VARCHAR(255) column; the generated og-image URLs
|
||||
// must never overrun it, or the seeder fails in production.
|
||||
foreach (Post::pluck('featured_image') as $image) {
|
||||
$this->assertLessThanOrEqual(255, strlen($image));
|
||||
$this->assertNotSame('', $image);
|
||||
}
|
||||
|
||||
// Related posts stay inside the reader's language: the English version
|
||||
// of a post never offers a Persian card and vice versa.
|
||||
$this->assertGreaterThan(0, $post->relatedPosts()->count());
|
||||
|
||||
Reference in new issue
Block a user