# 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