aboutsummaryrefslogtreecommitdiffstats
path: root/spec/factories/blog_comments.rb
blob: 9818c072cc878a9cf605b5fbe6d2d93c33e5dbad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FactoryGirl.define do
  factory :blog_comment, :class => Refinery::BlogComment do
    name "Joe Commenter"
    sequence(:email) { |n| "person#{n}@example.com" }
    body "Which one is the best for picking up new shoes?"
    association :post, :factory => :blog_post
  
    trait :approved do
      state 'approved'
    end
  
    trait :rejected do
      state 'rejected'
    end
    
    factory :approved_comment, :traits => [:approved]
    factory :rejected_comment, :traits => [:rejected]
  end
end