2019-07-25 01:11:48 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-12-13 19:13:44 -05:00
|
|
|
FactoryBot.define do
|
2016-02-16 22:55:24 -05:00
|
|
|
factory :snippet do
|
|
|
|
author
|
2017-03-23 12:37:14 -04:00
|
|
|
title { generate(:title) }
|
|
|
|
content { generate(:title) }
|
2017-05-03 11:26:49 -04:00
|
|
|
description { generate(:title) }
|
2017-03-23 12:37:14 -04:00
|
|
|
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
|
2016-02-16 22:55:24 -05:00
|
|
|
end
|
2017-06-22 10:43:52 -04:00
|
|
|
|
|
|
|
factory :project_snippet, parent: :snippet, class: :ProjectSnippet do
|
2017-08-02 15:55:11 -04:00
|
|
|
project
|
2017-08-04 13:14:04 -04:00
|
|
|
author { project.creator }
|
2017-06-22 10:43:52 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
factory :personal_snippet, parent: :snippet, class: :PersonalSnippet do
|
|
|
|
end
|
2016-02-16 22:55:24 -05:00
|
|
|
end
|