demarches-normaliennes/spec/serializers/champs/siret_champ_serializer_spec.rb

17 lines
642 B
Ruby
Raw Normal View History

2018-10-22 19:27:33 +02:00
describe Champs::SiretChampSerializer do
describe '#attributes' do
subject { Champs::SiretChampSerializer.new(champ).serializable_hash }
context 'when type champ is siret' do
let(:etablissement) { create(:etablissement) }
let(:champ) { create(:type_de_champ_siret).champ.create(etablissement: etablissement, value: etablissement.siret) }
it {
is_expected.to include(value: etablissement.siret)
expect(subject[:etablissement]).to include(siret: etablissement.siret)
expect(subject[:entreprise]).to include(capital_social: etablissement.entreprise_capital_social)
}
end
end
end