demarches-normaliennes/spec/models/cerfa_spec.rb

23 lines
575 B
Ruby
Raw Normal View History

2015-08-18 13:52:00 +02:00
require 'spec_helper'
describe Cerfa do
describe 'database columns' do
it { is_expected.to have_db_column(:content)}
end
describe 'associations' do
it { is_expected.to belong_to(:dossier) }
end
2015-08-18 16:30:57 +02:00
describe 'empty?' do
subject { create(:cerfa, content: content)}
context 'when content exist' do
let(:content) { File.open('./spec/support/files/piece_jointe_388.pdf') }
it { expect(subject).not_to be_empty }
end
context 'when content is nil' do
let(:content) { nil }
it { expect(subject).to be_empty }
end
end
2015-08-18 13:52:00 +02:00
end