Sha256: d6f020b0f030a302a67963794762cccc1ab5ccf3d5d65b58d4d95f4bed422081
Contents?: true
Size: 1.6 KB
Versions: 1
Compression:
Stored size: 1.6 KB
Contents
Factory.define :post, :class => Kublog::Post do |f| f.title 'Nuevos features' f.body '<p>Este mes estuvimos trabajando en nuevos features...</p>' f.association :user, :factory => :user end Factory.define :category, :class=> Kublog::Category do |f| f.sequence(:name) { |n| "#{rand(n*1000)} Nuevos Features" } end Factory.define :notification, :class=> Kublog::Notification do |f| f.kind 'fake_kind' f.content 'Awesome post just published' f.association :post, :factory => :post end Factory.define :twitter_notification, :class => Kublog::Notification do |f| f.kind 'twitter' f.content 'tweet content' f.association :post, :factory => :post end Factory.define :facebook_notification, :class => Kublog::Notification do |f| f.kind 'facebook' f.content 'wall post content' f.association :post, :factory => :post end Factory.define :email_notification, :class => Kublog::Notification do |f| f.kind 'email' f.content 'email content for {{user}} with a link to the post {{link}}' f.association :post, :factory => :post end Factory.define :user_comment, :class => Kublog::Comment do |f| f.body 'Great stuff on the blog' f.association :user, :factory => :user f.association :post, :factory => :post end Factory.define :anonymous_comment, :class => Kublog::Comment do |f| f.body 'Great stuff on the site' f.author_name 'Adrian Cuadros' f.author_email 'adrian@innku.com' f.association :post, :factory => :post end Factory.define :user do |f| f.name 'Adrian Cuadros' f.sequence(:email) {|n| "adrian#{n}@innku.com" } f.password 'secret' f.password_confirmation 'secret' end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
kublog-0.9.0 | spec/factories.rb |