Sha256: 4a95f1b58b0e384234a67bc05b022b79c87a401567664c975e60310c7f373361
Contents?: true
Size: 1.15 KB
Versions: 25
Compression:
Stored size: 1.15 KB
Contents
FactoryBot.define do sequence(:slug) {|n| "#{n}-a-sample-blog-post-title" } factory :unpublished_blog_post, class: Dhatu::BlogPost do title "A Sample Blog Post Title" author "Some Author Name" slug meta_description "Blog post meta description which explain the essence of the post." description "Some Blog Post Description which is not less than 10 characters." association :category, factory: :published_blog_post_category posted_at { Time.now - 4.hours } tags {{key1: "val1", key2: "val2"}} end factory :published_blog_post, parent: :unpublished_blog_post do after :build do |e| e.publish end end factory :removed_blog_post, parent: :unpublished_blog_post do after :build do |e| e.remove end end factory :archived_blog_post, parent: :unpublished_blog_post do after :build do |e| e.archive end end factory :featured_blog_post, parent: :published_blog_post do after :build do |e| e.mark_as_featured end end factory :non_featured_blog_post, parent: :published_blog_post do after :build do |e| e.remove_from_featured end end end
Version data entries
25 entries across 25 versions & 1 rubygems