mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-24 15:06:22 +00:00
28 lines
458 B
Ruby
28 lines
458 B
Ruby
|
# 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
|