add empty to piece_jointe

This commit is contained in:
Tanguy PATTE 2015-08-18 16:51:57 +02:00
parent f49477dee7
commit bda3a410c4
2 changed files with 15 additions and 8 deletions

View file

@ -27,4 +27,17 @@ describe PieceJointe do
end
end
end
describe '#empty?' do
let(:piece_jointe) { create(:piece_jointe, content: content) }
subject { piece_jointe.empty? }
context 'when content is nil' do
let(:content) { nil }
it { is_expected.to be_truthy }
end
context 'when content exist' do
let(:content) { File.open('./spec/support/files/piece_jointe_388.pdf') }
it { is_expected.to be_falsey }
end
end
end