Add lib RNA connect to apientreprise
This commit is contained in:
parent
d49e9fe75a
commit
704e491cd0
8 changed files with 136 additions and 1 deletions
41
spec/lib/siade/rna_adapter_spec.rb
Normal file
41
spec/lib/siade/rna_adapter_spec.rb
Normal file
|
@ -0,0 +1,41 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe SIADE::RNAAdapter do
|
||||
let(:siren) { '418166096' }
|
||||
subject { described_class.new(siren).to_params }
|
||||
|
||||
before do
|
||||
stub_request(:get, /https:\/\/api-dev.apientreprise.fr\/api\/v1\/associations\/.*token=/)
|
||||
.to_return(body: File.read('spec/support/files/rna.json', status: 200))
|
||||
end
|
||||
|
||||
it '#to_params class est une Hash ?' do
|
||||
expect(subject).to be_an_instance_of(Hash)
|
||||
end
|
||||
|
||||
context 'Attributs Associations' do
|
||||
it 'L\'associations contient bien un id' do
|
||||
expect(subject[:id]).to eq('W595001988')
|
||||
end
|
||||
|
||||
it 'L\'associations contient bien un titre' do
|
||||
expect(subject[:titre]).to eq('UN SUR QUATRE')
|
||||
end
|
||||
|
||||
it 'L\'associations contient bien un objet' do
|
||||
expect(subject[:objet]).to eq("valoriser, transmettre et partager auprès des publics les plus larges possibles, les bienfaits de l'immigration, la richesse de la diversité et la curiosité de l'autre autrement")
|
||||
end
|
||||
|
||||
it 'L\'associations contient bien une date de creation' do
|
||||
expect(subject[:date_creation]).to eq('2014-01-23')
|
||||
end
|
||||
|
||||
it 'L\'associations contient bien une date de de declaration' do
|
||||
expect(subject[:date_declaration]).to eq('2014-01-24')
|
||||
end
|
||||
|
||||
it 'L\'associations contient bien une date de publication' do
|
||||
expect(subject[:date_publication]).to eq('2014-02-08')
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue