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

19 lines
519 B
Ruby
Raw Normal View History

2018-10-22 19:27:52 +02:00
describe Champs::CarteChampSerializer do
describe '#attributes' do
subject { Champs::CarteChampSerializer.new(champ).serializable_hash }
context 'when type champ is carte' do
let(:geo_area) { create(:geo_area) }
let(:champ) { create(:type_de_champ_carte).champ.create(geo_areas: [geo_area]) }
it {
expect(subject[:geo_areas].first).to include(
source: GeoArea.sources.fetch(:cadastre),
numero: '42',
feuille: 'A11'
)
}
end
end
end