diff options
author | Robert Speicher <robert@gitlab.com> | 2017-06-22 19:50:30 +0300 |
---|---|---|
committer | kushalpandya <kushal@gitlab.com> | 2017-06-26 08:38:13 +0300 |
commit | 7ff357207402e0b473a975002f76bdf5795993d2 (patch) | |
tree | 64beeba976af6394983aa19bdd5d00d327572167 /spec | |
parent | 8eee00c9d4fe62817bc54333724eec453483c596 (diff) |
Merge branch 'fix/properly-encode-gitaly-diffs' into 'master'
Encode Gitaly diff patches properly
See merge request !12368
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/git/diff_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/diff_spec.rb b/spec/lib/gitlab/git/diff_spec.rb index da213f617cc..28816778620 100644 --- a/spec/lib/gitlab/git/diff_spec.rb +++ b/spec/lib/gitlab/git/diff_spec.rb @@ -175,6 +175,14 @@ EOT expect(diff).to be_too_large end end + + context 'when the patch passed is not UTF-8-encoded' do + let(:raw_patch) { @raw_diff_hash[:diff].encode(Encoding::ASCII_8BIT) } + + it 'encodes diff patch to UTF-8' do + expect(diff.diff.encoding).to eq(Encoding::UTF_8) + end + end end end |