Ensure seeded listings are valid (#14784)

This matches the same change made to the db/seeds.rb file at
https://github.com/forem/forem/blob/main/db/seeds.rb#L515

Since there's a validation that Listings are only 12 lines or
shorter, and no technical limit on the length of
`Faker::Markdown.random`'s output, take the first 10 lines only.
This commit is contained in:
Daniel Uber 2021-09-21 10:31:54 -05:00 committed by GitHub
parent 234156de7d
commit 3e5d399d82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -465,7 +465,7 @@ seeder.create_if_none(Listing) do
Listing.create!(
user: admin_user,
title: "Listing title",
body_markdown: Faker::Markdown.random,
body_markdown: Faker::Markdown.random.lines.take(10).join,
location: Faker::Address.city,
organization_id: admin_user.organizations.first&.id,
listing_category_id: ListingCategory.first.id,