2018-03-17 18:26:18 +05:30
|
|
|
FactoryBot.define do
|
2016-06-02 11:05:42 +05:30
|
|
|
factory :snippet do
|
|
|
|
author
|
2017-08-17 22:00:37 +05:30
|
|
|
title { generate(:title) }
|
|
|
|
content { generate(:title) }
|
2017-09-10 17:25:29 +05:30
|
|
|
description { generate(:title) }
|
2017-08-17 22:00:37 +05:30
|
|
|
file_name { generate(:filename) }
|
2016-06-02 11:05:42 +05:30
|
|
|
|
|
|
|
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
|
2017-09-10 17:25:29 +05:30
|
|
|
|
|
|
|
factory :project_snippet, parent: :snippet, class: :ProjectSnippet do
|
|
|
|
project
|
2018-03-17 18:26:18 +05:30
|
|
|
author { project.creator }
|
2017-09-10 17:25:29 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
factory :personal_snippet, parent: :snippet, class: :PersonalSnippet do
|
|
|
|
end
|
2016-06-02 11:05:42 +05:30
|
|
|
end
|