BigW Consortium Gitlab

snippets.rb 589 Bytes
Newer Older
1 2 3
FactoryGirl.define do
  factory :snippet do
    author
Rémy Coutable committed
4 5
    title { generate(:title) }
    content { generate(:title) }
6
    description { generate(:title) }
Rémy Coutable committed
7
    file_name { generate(:filename) }
8 9 10 11 12 13 14 15 16 17 18 19

    trait :public do
      visibility_level Snippet::PUBLIC
    end

    trait :internal do
      visibility_level Snippet::INTERNAL
    end

    trait :private do
      visibility_level Snippet::PRIVATE
    end
20
  end
21 22

  factory :project_snippet, parent: :snippet, class: :ProjectSnippet do
23
    project
24 25 26 27
  end

  factory :personal_snippet, parent: :snippet, class: :PersonalSnippet do
  end
28
end