[Fix #3016] Do not crash if PJ has no extension
This commit is contained in:
parent
f1d2def8c8
commit
7c1768e5bb
2 changed files with 16 additions and 2 deletions
14
spec/uploaders/piece_justificative_uploader_spec.rb
Normal file
14
spec/uploaders/piece_justificative_uploader_spec.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe PieceJustificativeUploader do
|
||||
let(:pj) { create(:piece_justificative, :rib) }
|
||||
|
||||
it { expect(pj.content.filename).to eq 'piece_justificative.pdf' }
|
||||
|
||||
context 'when extension is nil' do
|
||||
it do
|
||||
expect(pj.content.file).to receive(:extension).and_return(nil)
|
||||
expect(pj.content.filename).to eq 'piece_justificative.'
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue