5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-24 14:16:22 +00:00
panel/test/factories/document.rb

28 lines
458 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
FactoryBot.define do
factory :document, class: Jekyll::Document do
site do
build(:jekyll)
end
collection do
build(:collection, site: site)
end
path do
'2023-01-01-document.markdown'
end
date do
Date.today.to_time
end
initialize_with do
new(path, site: site, collection: collection).tap do |doc|
doc.data['date'] = date
end
end
end
end