Commit 7000e76a authored by Robert Speicher's avatar Robert Speicher

Simplify the various Snippet factories

parent e8cd04e8
FactoryGirl.define do
factory :personal_snippet, parent: :snippet, class: :PersonalSnippet do
trait :public do
visibility_level PersonalSnippet::PUBLIC
end
trait :internal do
visibility_level PersonalSnippet::INTERNAL
end
trait :private do
visibility_level PersonalSnippet::PRIVATE
end
end
end
FactoryGirl.define do
factory :project_snippet do
factory :project_snippet, parent: :snippet, class: :ProjectSnippet do
project
author
title
content
file_name
end
end
......@@ -12,5 +12,17 @@ FactoryGirl.define do
title
content
file_name
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
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment