demarches-normaliennes/spec/models/dossier_spec.rb
Tanguy PATTE 107b11d510 rename ref_demarche into demarche_id
fix association between formulaire and type_piece_jointe
fix association between formulaire and evenement_vie
2015-08-14 15:02:11 +02:00

30 lines
No EOL
729 B
Ruby

require 'spec_helper'
describe Dossier do
let(:dossier) { create(:dossier, :with_entreprise) }
let(:entreprise) { dossier.entreprise }
let(:etablissement) { dossier.etablissement }
subject { dossier }
describe '#siren' do
it 'returns entreprise siren' do
expect(subject.siren).to eq(entreprise.siren)
end
end
describe '#siret' do
it 'returns etablissement siret' do
expect(subject.siret).to eq(etablissement.siret)
end
end
describe '#liste_piece_justificative' do
subject { dossier.types_piece_jointe }
it 'returns list of required piece justificative' do
expect(subject.size).to eq(7)
expect(subject).to include(TypePieceJointe.find(103))
end
end
end