BigW Consortium Gitlab

snippets.rb 453 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
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
15 16 17 18 19 20 21 22 23 24 25 26

    trait :public do
      visibility_level Snippet::PUBLIC
    end

    trait :internal do
      visibility_level Snippet::INTERNAL
    end

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