refactor tests

This commit is contained in:
Tanguy PATTE 2015-08-20 14:24:26 +02:00
parent 4d728962d0
commit 1e385655a1

View file

@ -26,6 +26,12 @@ describe Dossier do
it { is_expected.to have_one(:entreprise) }
end
describe "delegation" do
it { is_expected.to delegate_method(:siren).to(:entreprise) }
it { is_expected.to delegate_method(:siret).to(:etablissement) }
it { is_expected.to delegate_method(:types_piece_jointe).to(:formulaire) }
end
let(:dossier) { create(:dossier, :with_entreprise) }
let(:entreprise) { dossier.entreprise }
@ -33,18 +39,6 @@ describe Dossier do
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 '#types_piece_jointe' do
subject { dossier.types_piece_jointe }
it 'returns list of required piece justificative' do