Fix test INSEE v2 get etablissement view

This commit is contained in:
Xavier J 2016-09-16 17:08:50 +02:00
parent 9332c0f6ed
commit bd89688346
3 changed files with 13 additions and 2 deletions

View file

@ -23,7 +23,12 @@ function the_terms() {
}
function error_form_siret(invalid_siret){
$("input[type='submit']").removeClass('btn-success').addClass('btn-danger').val('Erreur SIRET');
setTimeout(function(){
$("input[type='submit']").val('Erreur SIRET');
}, 10);
$("input[type='submit']").removeClass('btn-success').addClass('btn-danger');
$("#dossier_siret").addClass('input-error').val(invalid_siret).on('input', reset_form_siret);
}

View file

@ -13,9 +13,13 @@ class DossierService
raise RestClient::ResourceNotFound
end
@dossier.create_entreprise(@entreprise_adapter.to_params)
@etablissement_adapter = SIADE::EtablissementAdapter.new(@siret)
if @etablissement_adapter.to_params.nil?
raise RestClient::ResourceNotFound
end
@dossier.create_entreprise(@entreprise_adapter.to_params)
@dossier.create_etablissement(@etablissement_adapter.to_params)
@rna_adapter = SIADE::RNAAdapter.new(@siret)

View file

@ -18,6 +18,8 @@ class SIADE::EtablissementAdapter
params[k] = v if address_attribut_to_fetch.include?(k)
end
params
rescue
nil
end
def attr_to_fetch