From 3e5d399d82fe200cfa45ace182c25e2be7f41a79 Mon Sep 17 00:00:00 2001 From: Daniel Uber Date: Tue, 21 Sep 2021 10:31:54 -0500 Subject: [PATCH] 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. --- spec/support/seeds/seeds_e2e.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/seeds/seeds_e2e.rb b/spec/support/seeds/seeds_e2e.rb index 9c9a3ce0e..33a97aaf9 100644 --- a/spec/support/seeds/seeds_e2e.rb +++ b/spec/support/seeds/seeds_e2e.rb @@ -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,