wblog/spec/factories/posts.rb

13 lines
286 B
Ruby
Raw Permalink Normal View History

2018-05-19 17:07:08 +08:00
FactoryBot.define do
2014-03-31 12:18:40 +08:00
factory :post do
2019-04-22 22:07:17 +08:00
title { 'this is a post title' }
content { 'content' * 10 }
2014-03-31 12:18:40 +08:00
end
factory :post_list, class: Post do
sequence(:title) { |n| "#{n}: post title" }
2019-04-22 22:07:17 +08:00
content { 'content' * 10 }
2014-03-31 12:18:40 +08:00
sequence(:created_at) { |n| n.days.ago }
end
end