gitlab-org--gitlab-foss/spec/factories/snippets.rb

29 lines
588 B
Ruby
Raw Normal View History

FactoryBot.define do
factory :snippet do
author
title { generate(:title) }
content { generate(:title) }
2017-05-03 11:26:49 -04:00
description { generate(:title) }
file_name { generate(:filename) }
2016-03-08 16:39:53 -05:00
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
factory :project_snippet, parent: :snippet, class: :ProjectSnippet do
project
end
factory :personal_snippet, parent: :snippet, class: :PersonalSnippet do
end
end