summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-09-14 13:57:45 +0000
committerDouwe Maan <douwe@gitlab.com>2016-09-14 13:57:45 +0000
commit11a26ab145856e9a9f0d2ccbeda99a0a969436eb (patch)
tree1597b97894a89d3357d0f4ade363260d3b44ce48 /spec/models
parent159616caa2d459d87c3e5b0c9fd9e140aa053314 (diff)
parent0bc443e3b442b49cb6989282601d477c673c4412 (diff)
downloadgitlab-ce-11a26ab145856e9a9f0d2ccbeda99a0a969436eb.tar.gz
Merge branch 'update-gitlab-git' into 'master'
Update gitlab_git to 10.6.6 ## What does this MR do? This updates gitlab_git to version 10.6.6 ## Are there points in the code the reviewer needs to double check? No. ## Why was this MR needed? 10.6.4/10.6.5/10.6.6 contains some changes regarding marking blobs as binary, this can improve page loading times. ## Does this MR meet the acceptance criteria? - [x] ~~[CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added~~ - Tests - [ ] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/22144 See merge request !6279
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/blob_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/models/blob_spec.rb b/spec/models/blob_spec.rb
index cee20234e1f..03d02b4d382 100644
--- a/spec/models/blob_spec.rb
+++ b/spec/models/blob_spec.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
require 'rails_helper'
describe Blob do
@@ -7,6 +8,25 @@ describe Blob do
end
end
+ describe '#data' do
+ context 'using a binary blob' do
+ it 'returns the data as-is' do
+ data = "\n\xFF\xB9\xC3"
+ blob = described_class.new(double(binary?: true, data: data))
+
+ expect(blob.data).to eq(data)
+ end
+ end
+
+ context 'using a text blob' do
+ it 'converts the data to UTF-8' do
+ blob = described_class.new(double(binary?: false, data: "\n\xFF\xB9\xC3"))
+
+ expect(blob.data).to eq("\n���")
+ end
+ end
+ end
+
describe '#svg?' do
it 'is falsey when not text' do
git_blob = double(text?: false)