Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 48 lines (32 sloc) 2.591 kb
c771373 dummy blog posts generator for devel
progressbarsk authored
1 require 'factory_girl_rails'
2
3 FactoryGirl.define do
4 factory :blog_post, :class => Refinery::Blog::Post do
5 sequence(:title) { |n| "Top #{n} Shopping Centers in Chicago" }
6 body "These are the top ten shopping centers in Chicago. You're going to read a long blog post about them. Come to peace with it."
7 draft false
8 tag_list "chicago, shopping, fun times"
9 published_at Time.now
10
11 factory :blog_post_draft do
12 draft true
13 end
14 end
15
16 factory :blog_category, :class => Refinery::Blog::Category do
17 sequence(:title) { |n| "Shopping #{n}" }
18 end
19 end
20
21
22 # source_dates = (-50..400).to_a
23 # (1..500).each do |i|
24
25 # FactoryGirl.build_list(:blog_category, 10)
26
27
28 s = '<p>Granny a-be He had rescued un as they will immediately stand some swart, led the Dudge Pupublick to sultry sabbath afternoon, Hag Chivychas Eve, in full penalty, pending puwsuance, as Gaudio Gambrinus, grim as every soorkabatcha, tum or style, with truant officers, three tommix, soldiers free, cockaleak and yum (not on the sky overreaching the revise mark) stalks all among the fixed residents and then he is all bellical, the request for you. Hou! Gricks may have males; the prankquean swaradid: Am liking it. And that he crashed in Connacht</p>'
29 s += '<p>wanamade singsigns to the All for wilde erthe blothoms followed for fierythroats; sends whispers up most devious of Allprohome and rumble and calls him moult instench of the treepartied ambush was struck, she punched the Wulverulverlord (protect us!) the nights altosonority, shipalone, a host; faced with voluntears, the loo, as the land lies one, Lumproar. His atake is just to open to be Cacao Campbell,he didnt we, fenians? And from there, plainly minus twos. Nevertheless Madams Toshowus waxes largely more krectly lubeen or proclaim him dumb! Hush ye plaine of</p>'
30 s += '<p>dreams, blood and inhabitands, astea as game and (but at the tenderbolts of Mr Shallwesigh or Mr Adams what she on advices, be about the excelsissimost empyrean (bolt, in full lengths or quadrumane or Boghas the owl globe in motions, marching, all his detractors, who, as you Maggy well & hopes till stuffering stage, whaling away and pancrook bespaking the overthrewer to reason the Crossgunn! Up hog and Im tallin ye?) to the ethnarch Humphrey or the jiminy with their mouths, thence your toenail, sir, where indeeth we also an</p>'
31
32 Refinery::Blog::Post.delete_all
33
34 source_dates = (-5..5).to_a
35 (1..5).each do |i|
36
37 p_date = source_dates.sample.days.ago
38
39 FactoryGirl.create(:blog_post,
40 :published_at => p_date,
41 :body => s
42 )
43
44 end
45
46
47
48 p 'done'
Something went wrong with that request. Please try again.