summaryrefslogtreecommitdiff
path: root/spec/features/projects/blobs
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-07-19 15:09:10 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-19 15:09:10 +0000
commit9c8e8b5ffc6e11d827fa42f2dce5f90c4dc19493 (patch)
treefef494515627439a22a06addc7ff5f57d418778a /spec/features/projects/blobs
parent690c904b5e340f14c04f93ff688b647b46f7d1a2 (diff)
downloadgitlab-ce-9c8e8b5ffc6e11d827fa42f2dce5f90c4dc19493.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/projects/blobs')
-rw-r--r--spec/features/projects/blobs/blob_show_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/features/projects/blobs/blob_show_spec.rb b/spec/features/projects/blobs/blob_show_spec.rb
index e222f0d34a9..f5cafa2b2ec 100644
--- a/spec/features/projects/blobs/blob_show_spec.rb
+++ b/spec/features/projects/blobs/blob_show_spec.rb
@@ -464,6 +464,20 @@ RSpec.describe 'File blob', :js do
end
end
+ context 'binary file that appears to be text in the first 1024 bytes' do
+ before do
+ visit_blob('encoding/binary-1.bin', ref: 'binary-encoding')
+ end
+
+ it 'displays the blob' do
+ expect(page).to have_link('Download (23.81 KiB)')
+ # does not show a viewer switcher
+ expect(page).not_to have_selector('.js-blob-viewer-switcher')
+ expect(page).not_to have_selector('.js-copy-blob-source-btn:not(.disabled)')
+ expect(page).not_to have_link('Open raw')
+ end
+ end
+
context 'empty file' do
before do
project.add_maintainer(project.creator)