spec: cleanup exercices_adapter_spec

This commit is contained in:
Pierre de La Morinerie 2019-04-30 16:18:56 +02:00
parent 67158e8660
commit fd95ea2871

View file

@ -10,25 +10,15 @@ describe ApiEntreprise::ExercicesAdapter do
.to_return(body: File.read('spec/fixtures/files/api_entreprise/exercices.json', status: 200)) .to_return(body: File.read('spec/fixtures/files/api_entreprise/exercices.json', status: 200))
end end
it '#to_params class est un Hash ?' do it { is_expected.to be_an_instance_of(Hash) }
expect(subject).to be_an_instance_of(Hash)
end
it 'have 3 exercices' do it 'contains several exercices attributes' do
expect(subject[:exercices_attributes].size).to eq(3) expect(subject[:exercices_attributes].size).to eq(3)
end end
context 'Attributs Exercices' do it 'contains informations in each exercices_attributes' do
it 'L\'exercice contient bien un ca' do expect(subject[:exercices_attributes][0][:ca]).to eq('21009417')
expect(subject[:exercices_attributes][0][:ca]).to eq('21009417') expect(subject[:exercices_attributes][0][:date_fin_exercice]).to eq("2013-12-31T00:00:00+01:00")
end expect(subject[:exercices_attributes][0][:date_fin_exercice_timestamp]).to eq(1388444400)
it 'L\'exercice contient bien une date de fin d\'exercice' do
expect(subject[:exercices_attributes][0][:date_fin_exercice]).to eq("2013-12-31T00:00:00+01:00")
end
it 'L\'exercice contient bien une date_fin_exercice_timestamp' do
expect(subject[:exercices_attributes][0][:date_fin_exercice_timestamp]).to eq(1388444400)
end
end end
end end