Sha256: 746dd3ccb484cf18fe15813b5f64b78c038e77cc7d8a8b038ec89b22d66c71a2
Contents?: true
Size: 810 Bytes
Versions: 3
Compression:
Stored size: 810 Bytes
Contents
Factory.define :page_part, :class => Kuhsaft::PagePart::Content do |p| p.position 1 p.content Kuhsaft::PagePart::Markdown.new(:text => 'h1. Hello world!') p.association :localized_page end Factory.define :localized_page, :class => Kuhsaft::LocalizedPage do |p| p.locale 'en' p.title 'English title' p.published 1 p.body 'hi' p.url '' p.association :page p.after_create do |page| page.page_parts << Factory.build(:page_part, :localized_page => page) end end Factory.define :page, :class => Kuhsaft::Page do |p| p.position 1 p.after_create do |page| page.localized_pages << Factory.create(:localized_page, :page => page) end end Factory.define :asset, :class => Kuhsaft::Asset do |a| a.file File.open("#{Kuhsaft::Engine.root}/spec/dummy/public/images/spec-image.png") end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
kuhsaft-0.0.6 | spec/factories.rb |
kuhsaft-0.0.5 | spec/factories.rb |
kuhsaft-0.0.4 | spec/factories.rb |