Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2017-06-22 02:51:46 +0300
committerAhmad Sherif <me@ahmadsherif.com>2017-06-22 04:12:23 +0300
commit5b092d21cca71dde8f032dfcb9b7b41612a8727f (patch)
tree5a7873b2d04643a161835f824232c38ba18ee7cf /spec
parentdb9a8f4e3257104937d4558cd25ccbd345914a73 (diff)
Encode Gitaly diff patches properly
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/git/diff_spec.rb8
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 5627562abfb..d50ccb0df30 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