diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-05-12 22:43:06 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-05-13 19:46:10 +0300 |
commit | acffc062133e5793ac08b9529ab54689557766d4 (patch) | |
tree | 019482c4b8af8fcd4a0dabf89a4c47c389e37730 /spec/models/blob_viewer/base_spec.rb | |
parent | 4328bc1769c52393580cb777d34dbd6ebff089cf (diff) |
Specify explicitly whether a blob viewer should be loaded asynchronously
Diffstat (limited to 'spec/models/blob_viewer/base_spec.rb')
-rw-r--r-- | spec/models/blob_viewer/base_spec.rb | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/spec/models/blob_viewer/base_spec.rb b/spec/models/blob_viewer/base_spec.rb index a6641970e1b..b3dc3252963 100644 --- a/spec/models/blob_viewer/base_spec.rb +++ b/spec/models/blob_viewer/base_spec.rb @@ -7,11 +7,12 @@ describe BlobViewer::Base, model: true do let(:viewer_class) do Class.new(described_class) do + include BlobViewer::ServerSide + self.extensions = %w(pdf) self.binary = true self.max_size = 1.megabyte self.absolute_max_size = 5.megabytes - self.client_side = false end end @@ -38,10 +39,10 @@ describe BlobViewer::Base, model: true do context 'when the file type is supported' do before do - viewer_class.file_type = :license + viewer_class.file_types = %i(license) viewer_class.binary = false end - + context 'when the binaryness matches' do let(:blob) { fake_blob(path: 'LICENSE', binary: false) } @@ -172,19 +173,5 @@ describe BlobViewer::Base, model: true do end end end - - context 'when the viewer is server side but the blob is stored externally' do - let(:project) { build(:empty_project, lfs_enabled: true) } - - let(:blob) { fake_blob(path: 'file.pdf', lfs: true) } - - before do - allow(Gitlab.config.lfs).to receive(:enabled).and_return(true) - end - - it 'return :server_side_but_stored_externally' do - expect(viewer.render_error).to eq(:server_side_but_stored_externally) - end - end end end |