2015-08-17 11:51:00 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Etablissement do
|
|
|
|
describe 'database columns' do
|
|
|
|
it { is_expected.to have_db_column(:siret) }
|
|
|
|
it { is_expected.to have_db_column(:siege_social) }
|
|
|
|
it { is_expected.to have_db_column(:naf) }
|
|
|
|
it { is_expected.to have_db_column(:libelle_naf) }
|
|
|
|
it { is_expected.to have_db_column(:adresse) }
|
|
|
|
it { is_expected.to have_db_column(:numero_voie) }
|
|
|
|
it { is_expected.to have_db_column(:type_voie) }
|
|
|
|
it { is_expected.to have_db_column(:nom_voie) }
|
|
|
|
it { is_expected.to have_db_column(:complement_adresse) }
|
|
|
|
it { is_expected.to have_db_column(:code_postal) }
|
|
|
|
it { is_expected.to have_db_column(:localite) }
|
|
|
|
it { is_expected.to have_db_column(:code_insee_localite) }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'associations' do
|
|
|
|
it { is_expected.to belong_to(:dossier) }
|
|
|
|
it { is_expected.to belong_to(:entreprise) }
|
2015-11-16 11:23:29 +01:00
|
|
|
it { is_expected.to have_many(:exercices) }
|
2015-08-17 11:51:00 +02:00
|
|
|
end
|
2016-01-19 17:19:38 +01:00
|
|
|
|
|
|
|
describe '#geo_adresse' do
|
|
|
|
|
|
|
|
let(:etablissement) { create(:etablissement) }
|
|
|
|
|
|
|
|
subject { etablissement.geo_adresse }
|
|
|
|
|
|
|
|
it { is_expected.to eq '6 RUE RAOUL NORDLING IMMEUBLE BORA 92270 BOIS COLOMBES' }
|
|
|
|
end
|
2015-08-17 11:51:00 +02:00
|
|
|
end
|