summaryrefslogtreecommitdiff
path: root/spec/factories/snippets.rb
blob: 365f12a0c952a5ba2ab6757aaa21847c9466a445 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FactoryGirl.define do
  sequence :title, aliases: [:content] do
    FFaker::Lorem.sentence
  end

  sequence :file_name do
    FFaker::Internet.user_name
  end

  factory :snippet do
    author
    title
    content
    file_name

    trait :public do
      visibility_level Snippet::PUBLIC
    end

    trait :internal do
      visibility_level Snippet::INTERNAL
    end

    trait :private do
      visibility_level Snippet::PRIVATE
    end
  end
end