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
diff options
context:
space:
mode:
authorFrancisco Javier López <fjlopez@gitlab.com>2018-12-13 20:49:05 +0300
committerFrancisco Javier López <fjlopez@gitlab.com>2018-12-27 18:51:07 +0300
commit5a3e6fdff96f50cb293a8c9fe64ccbf59619936f (patch)
tree2a5d109ec7bfc07336ad7a155f3234ba4e0f6580 /spec/models/blob_spec.rb
parent77909a88460bbc864a5f95f3fa66053eb6cab5a8 (diff)
Fixing image lfs bug and also displaying text lfs
This commit, introduced in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23812, fixes a problem creating a displaying image diff notes when the image is stored in LFS. The main problem was that `Gitlab::Diff::File` was returning an invalid valid in `text?` for this kind of files. It also fixes a rendering problem with other LFS files, like text ones. They LFS pointer shouldn't be shown when LFS is enabled for the project, but they were.
Diffstat (limited to 'spec/models/blob_spec.rb')
-rw-r--r--spec/models/blob_spec.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/models/blob_spec.rb b/spec/models/blob_spec.rb
index e8c03b587e2..05cf242e84d 100644
--- a/spec/models/blob_spec.rb
+++ b/spec/models/blob_spec.rb
@@ -122,14 +122,14 @@ describe Blob do
end
end
- describe '#raw_binary?' do
+ describe '#binary?' do
context 'if the blob is stored externally' do
context 'if the extension has a rich viewer' do
context 'if the viewer is binary' do
it 'returns true' do
blob = fake_blob(path: 'file.pdf', lfs: true)
- expect(blob.raw_binary?).to be_truthy
+ expect(blob.binary?).to be_truthy
end
end
@@ -137,7 +137,7 @@ describe Blob do
it 'return false' do
blob = fake_blob(path: 'file.md', lfs: true)
- expect(blob.raw_binary?).to be_falsey
+ expect(blob.binary?).to be_falsey
end
end
end
@@ -148,7 +148,7 @@ describe Blob do
it 'returns false' do
blob = fake_blob(path: 'file.txt', lfs: true)
- expect(blob.raw_binary?).to be_falsey
+ expect(blob.binary?).to be_falsey
end
end
@@ -156,7 +156,7 @@ describe Blob do
it 'returns false' do
blob = fake_blob(path: 'file.ics', lfs: true)
- expect(blob.raw_binary?).to be_falsey
+ expect(blob.binary?).to be_falsey
end
end
end
@@ -166,7 +166,7 @@ describe Blob do
it 'returns false' do
blob = fake_blob(path: 'file.rb', lfs: true)
- expect(blob.raw_binary?).to be_falsey
+ expect(blob.binary?).to be_falsey
end
end
@@ -174,7 +174,7 @@ describe Blob do
it 'returns true' do
blob = fake_blob(path: 'file.exe', lfs: true)
- expect(blob.raw_binary?).to be_truthy
+ expect(blob.binary?).to be_truthy
end
end
end
@@ -184,7 +184,7 @@ describe Blob do
it 'returns false' do
blob = fake_blob(path: 'file.ini', lfs: true)
- expect(blob.raw_binary?).to be_falsey
+ expect(blob.binary?).to be_falsey
end
end
@@ -192,7 +192,7 @@ describe Blob do
it 'returns true' do
blob = fake_blob(path: 'file.wtf', lfs: true)
- expect(blob.raw_binary?).to be_truthy
+ expect(blob.binary?).to be_truthy
end
end
end
@@ -204,7 +204,7 @@ describe Blob do
it 'returns true' do
blob = fake_blob(path: 'file.pdf', binary: true)
- expect(blob.raw_binary?).to be_truthy
+ expect(blob.binary?).to be_truthy
end
end
@@ -212,7 +212,7 @@ describe Blob do
it 'return false' do
blob = fake_blob(path: 'file.md')
- expect(blob.raw_binary?).to be_falsey
+ expect(blob.binary?).to be_falsey
end
end
end