diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /spec/lib/gitlab/blob_helper_spec.rb | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'spec/lib/gitlab/blob_helper_spec.rb')
-rw-r--r-- | spec/lib/gitlab/blob_helper_spec.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/lib/gitlab/blob_helper_spec.rb b/spec/lib/gitlab/blob_helper_spec.rb index 65fa5bf0120..a2f20dcd4fc 100644 --- a/spec/lib/gitlab/blob_helper_spec.rb +++ b/spec/lib/gitlab/blob_helper_spec.rb @@ -7,6 +7,7 @@ RSpec.describe Gitlab::BlobHelper do let(:project) { create(:project) } let(:blob) { fake_blob(path: 'file.txt') } + let(:webp_blob) { fake_blob(path: 'file.webp') } let(:large_blob) { fake_blob(path: 'test.pdf', size: 2.megabytes, binary: true) } describe '#extname' do @@ -62,8 +63,15 @@ RSpec.describe Gitlab::BlobHelper do end describe '#image?' do - it 'returns false' do - expect(blob.image?).to be_falsey + context 'with a .txt file' do + it 'returns false' do + expect(blob.image?).to be_falsey + end + end + context 'with a .webp file' do + it 'returns true' do + expect(webp_blob.image?).to be_truthy + end end end |