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:
authorRémy Coutable <remy@rymai.me>2018-04-06 15:40:33 +0300
committerRobert Speicher <rspeicher@gmail.com>2018-04-10 02:04:09 +0300
commit2d54dfb25134cbdf5b4f506b69d13241130bc132 (patch)
tree3ba70e41da756ad6f0e9a17925ff5dd9beaa9b8c /spec/features/projects/files/user_browses_lfs_files_spec.rb
parentffc9a470a8bf02d6ac97ea1bb00a0a4fab664314 (diff)
Migrate features/project/project.feature to RSpec and reorganize several Project feature specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/features/projects/files/user_browses_lfs_files_spec.rb')
-rw-r--r--spec/features/projects/files/user_browses_lfs_files_spec.rb58
1 files changed, 58 insertions, 0 deletions
diff --git a/spec/features/projects/files/user_browses_lfs_files_spec.rb b/spec/features/projects/files/user_browses_lfs_files_spec.rb
new file mode 100644
index 00000000000..f321d7f322e
--- /dev/null
+++ b/spec/features/projects/files/user_browses_lfs_files_spec.rb
@@ -0,0 +1,58 @@
+require 'spec_helper'
+
+describe 'Projects > Files > User browses LFS files' do
+ let(:project) { create(:project, :repository) }
+ let(:user) { project.creator }
+
+ before do
+ project.add_master(user)
+ sign_in(user)
+ end
+
+ context 'when LFS is disabled', :js do
+ before do
+ allow_any_instance_of(Project).to receive(:lfs_enabled?).and_return(false)
+ visit project_tree_path(project, 'lfs')
+ end
+
+ it 'is possible to see raw content of LFS pointer' do
+ click_link 'files'
+ click_link 'lfs'
+ click_link 'lfs_object.iso'
+
+ 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'
+ expect(page).not_to have_content 'Download (1.5 MB)'
+ end
+ end
+
+ context 'when LFS is enabled' do
+ before do
+ allow_any_instance_of(Project).to receive(:lfs_enabled?).and_return(true)
+ visit project_tree_path(project, 'lfs')
+ end
+
+ it 'shows an LFS object' do
+ click_link('files')
+ click_link('lfs')
+ click_link('lfs_object.iso')
+
+ expect(page).to have_content('Download (1.5 MB)')
+ expect(page).not_to have_content('version https://git-lfs.github.com/spec/v1')
+ expect(page).not_to have_content('oid sha256:91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897')
+ expect(page).not_to have_content('size 1575078')
+
+ page.within('.content') do
+ expect(page).to have_content('Delete')
+ expect(page).to have_content('History')
+ expect(page).to have_content('Permalink')
+ expect(page).to have_content('Replace')
+ expect(page).not_to have_content('Annotate')
+ expect(page).not_to have_content('Blame')
+ expect(page).not_to have_content('Edit')
+ expect(page).to have_link('Download')
+ end
+ end
+ end
+end