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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
5625b0e4
Commit
5625b0e4
authored
Sep 04, 2017
by
micael.bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add .json_safe_diff spec
parent
c9aa7932
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
spec/lib/gitlab/git/diff_spec.rb
spec/lib/gitlab/git/diff_spec.rb
+19
-0
No files found.
spec/lib/gitlab/git/diff_spec.rb
View file @
5625b0e4
...
@@ -273,6 +273,25 @@ EOT
...
@@ -273,6 +273,25 @@ EOT
end
end
end
end
describe
'.json_safe_diff'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
it
'fake binary message when it detects binary'
do
# Rugged will not detect this as binary, but we can fake it
diff_message
=
"Binary files files/images/icn-time-tracking.pdf and files/images/icn-time-tracking.pdf differ
\n
"
binary_diff
=
described_class
.
between
(
project
.
repository
,
'add-pdf-text-binary'
,
'add-pdf-text-binary^'
).
first
expect
(
binary_diff
.
diff
).
not_to
be_empty
expect
(
binary_diff
.
json_safe_diff
).
to
eq
(
diff_message
)
end
it
'leave non-binary diffs as-is'
do
diff
=
described_class
.
new
(
@rugged_diff
)
expect
(
diff
.
json_safe_diff
).
to
eq
(
diff
.
diff
)
end
end
describe
'#submodule?'
do
describe
'#submodule?'
do
before
do
before
do
commit
=
repository
.
lookup
(
'5937ac0a7beb003549fc5fd26fc247adbce4a52e'
)
commit
=
repository
.
lookup
(
'5937ac0a7beb003549fc5fd26fc247adbce4a52e'
)
...
...
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