Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
7000e76a
Commit
7000e76a
authored
Mar 08, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify the various Snippet factories
parent
e8cd04e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
16 deletions
+13
-16
spec/factories/personal_snippets.rb
spec/factories/personal_snippets.rb
+0
-11
spec/factories/project_snippets.rb
spec/factories/project_snippets.rb
+1
-5
spec/factories/snippets.rb
spec/factories/snippets.rb
+12
-0
No files found.
spec/factories/personal_snippets.rb
View file @
7000e76a
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
spec/factories/project_snippets.rb
View file @
7000e76a
FactoryGirl
.
define
do
factory
:project_snippet
do
factory
:project_snippet
,
parent: :snippet
,
class: :ProjectSnippet
do
project
author
title
content
file_name
end
end
spec/factories/snippets.rb
View file @
7000e76a
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment