Skip to content
Snippets Groups Projects
Commit 7000e76a authored by Robert Speicher's avatar Robert Speicher
Browse files

Simplify the various Snippet factories

parent e8cd04e8
No related branches found
No related tags found
No related merge requests found
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
Loading
Loading
@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment