* Change models and related files * Update controllers and specs * More renaming * Seek and destroy, I mean search and replace * Round up the stragglers * Ground control to Major Travis... * More fixes * PR feedback * Various fixes * Rename view * Fix list query builder * Unify request specs * Fix some API spec errors * Fix remaining API specs * Make spec conform to API * Fix leftover problems * Fix JS tests * Fix column name in select * Fix API specs * Fix search specs * Paging Mr. Travis
16 lines
423 B
Ruby
16 lines
423 B
Ruby
FactoryBot.define do
|
|
factory :listing do
|
|
user
|
|
title { "#{Faker::Book.title} #{rand(1000)}" }
|
|
body_markdown { Faker::Hipster.paragraph(sentence_count: 2) }
|
|
published { true }
|
|
bumped_at { Time.current }
|
|
|
|
after(:build) do |cl|
|
|
if cl.listing_category.blank?
|
|
category = ListingCategory.first || create(:listing_category)
|
|
cl.listing_category = category
|
|
end
|
|
end
|
|
end
|
|
end
|