diff options
author | Stan Hu <stanhu@gmail.com> | 2015-03-20 05:11:12 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-04-02 00:04:08 -0700 |
commit | dfd256f29ee817b5ffc563bb554a02d26ae44502 (patch) | |
tree | c28e943c541df30a2a0ab03905bf5d7bbe61b3ba /spec/services | |
parent | 16a6ea2d1769f68157976b83bf6da468dd38853d (diff) | |
download | gitlab-ce-dfd256f29ee817b5ffc563bb554a02d26ae44502.tar.gz |
Support configurable attachment size via Application Settings
Fix bug where error messages from Dropzone would not be displayed on the issues page
Closes #1258
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/projects/upload_service_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/services/projects/upload_service_spec.rb b/spec/services/projects/upload_service_spec.rb index fc34b456482..e5c47015a03 100644 --- a/spec/services/projects/upload_service_spec.rb +++ b/spec/services/projects/upload_service_spec.rb @@ -67,6 +67,16 @@ describe Projects::UploadService do it { expect(@link_to_file['url']).to match("/#{@project.path_with_namespace}") } it { expect(@link_to_file['url']).to match('doc_sample.txt') } end + + context 'for too large a file' do + before do + txt = fixture_file_upload(Rails.root + 'spec/fixtures/doc_sample.txt', 'text/plain') + allow(txt).to receive(:size) { 1000.megabytes.to_i } + @link_to_file = upload_file(@project.repository, txt) + end + + it { expect(@link_to_file).to eq(nil) } + end end def upload_file(repository, file) |