summaryrefslogtreecommitdiff
path: root/spec/features/projects/files
diff options
context:
space:
mode:
authorChristopher Bartz <bartz@dkrz.de>2017-03-07 18:57:30 +0100
committerChristopher Bartz <bartz@dkrz.de>2017-03-13 18:15:19 +0100
commit7849683766e93cfd91e0c864f3deb08500ea35d9 (patch)
tree75c4bdb8a652902ad4117c48399ed2f304e1bc74 /spec/features/projects/files
parent1585608bdcf932b58d301a7943c01ea824ea524e (diff)
downloadgitlab-ce-7849683766e93cfd91e0c864f3deb08500ea35d9.tar.gz
Do not show LFS object when LFS is disabled
Do not display a 404, when a user tries to retrieve the raw content of an LFS file (pointer) if the config option "lfs_enabled" is set to false. Instead, display the LFS pointer file directly.
Diffstat (limited to 'spec/features/projects/files')
-rw-r--r--spec/features/projects/files/browse_files_spec.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/features/projects/files/browse_files_spec.rb b/spec/features/projects/files/browse_files_spec.rb
index 69295e450d0..d281043caa3 100644
--- a/spec/features/projects/files/browse_files_spec.rb
+++ b/spec/features/projects/files/browse_files_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-feature 'user checks git blame', feature: true do
+feature 'user browses project', feature: true do
let(:project) { create(:project) }
let(:user) { create(:user) }
@@ -18,4 +18,16 @@ feature 'user checks git blame', feature: true do
expect(page).to have_content "Dmitriy Zaporozhets"
expect(page).to have_content "Initial commit"
end
+
+ scenario 'can see raw content of LFS pointer with LFS disabled' do
+ allow_any_instance_of(Project).to receive(:lfs_enabled?).and_return(false)
+ click_link 'files'
+ click_link 'lfs'
+ click_link 'lfs_object.iso'
+
+ expect(page).not_to have_content 'Download (1.5 MB)'
+ expect(page).to have_content 'version https://git-lfs.github.com/spec/v1'
+ expect(page).to have_content 'oid sha256:91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897'
+ expect(page).to have_content 'size 1575078'
+ end
end