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
Boxiang Sun
gitlab-ce
Commits
e48ce632
Commit
e48ce632
authored
Oct 25, 2018
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add factory for MergeRequestDiff and MergeRequestDiffFile
parent
ea6fa653
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
0 deletions
+60
-0
spec/factories/merge_request_diff_files.rb
spec/factories/merge_request_diff_files.rb
+47
-0
spec/factories/merge_request_diffs.rb
spec/factories/merge_request_diffs.rb
+13
-0
No files found.
spec/factories/merge_request_diff_files.rb
0 → 100644
View file @
e48ce632
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:merge_request_diff_file
do
association
:merge_request_diff
relative_order
0
new_file
true
renamed_file
false
deleted_file
false
too_large
false
a_mode
0
b_mode
100644
new_path
'foo'
old_path
'foo'
diff
''
binary
false
trait
:new_file
do
relative_order
0
new_file
true
renamed_file
false
deleted_file
false
too_large
false
a_mode
0
b_mode
100644
new_path
'foo'
old_path
'foo'
diff
''
binary
false
end
trait
:renamed_file
do
relative_order
662
new_file
false
renamed_file
true
deleted_file
false
too_large
false
a_mode
100644
b_mode
100644
new_path
'bar'
old_path
'baz'
diff
''
binary
false
end
end
end
spec/factories/merge_request_diffs.rb
0 → 100644
View file @
e48ce632
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:merge_request_diff
do
association
:merge_request
state
:collected
commits_count
1
base_commit_sha
{
Digest
::
SHA1
.
hexdigest
(
SecureRandom
.
hex
)
}
head_commit_sha
{
Digest
::
SHA1
.
hexdigest
(
SecureRandom
.
hex
)
}
start_commit_sha
{
Digest
::
SHA1
.
hexdigest
(
SecureRandom
.
hex
)
}
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