Merge branch 'develop' into staging
This commit is contained in:
commit
8c5875a36c
10 changed files with 31 additions and 22 deletions
2
Gemfile
2
Gemfile
|
@ -50,7 +50,7 @@ gem 'will_paginate-bootstrap'
|
|||
gem 'draper'
|
||||
|
||||
#Gestion des comptes utilisateurs
|
||||
gem 'devise'
|
||||
gem 'devise', '~> 3.0'
|
||||
gem 'openid_connect'
|
||||
|
||||
gem 'rest-client'
|
||||
|
|
19
Gemfile.lock
19
Gemfile.lock
|
@ -62,7 +62,7 @@ GEM
|
|||
autoprefixer-rails (5.2.1)
|
||||
execjs
|
||||
json
|
||||
bcrypt (3.1.10)
|
||||
bcrypt (3.1.11)
|
||||
bindata (2.1.0)
|
||||
binding_of_caller (0.7.2)
|
||||
debug_inspector (>= 0.0.1)
|
||||
|
@ -119,7 +119,7 @@ GEM
|
|||
debug_inspector (0.0.2)
|
||||
deep_cloneable (2.2.1)
|
||||
activerecord (>= 3.1.0, < 5.2.0)
|
||||
devise (3.4.1)
|
||||
devise (3.5.10)
|
||||
bcrypt (~> 3.0)
|
||||
orm_adapter (~> 0.1)
|
||||
railties (>= 3.2.6, < 5)
|
||||
|
@ -141,7 +141,7 @@ GEM
|
|||
erubis (2.7.0)
|
||||
eventmachine (1.0.8)
|
||||
excon (0.49.0)
|
||||
execjs (2.5.2)
|
||||
execjs (2.7.0)
|
||||
factory_girl (4.5.0)
|
||||
activesupport (>= 3.0.0)
|
||||
faraday (0.9.1)
|
||||
|
@ -461,8 +461,8 @@ GEM
|
|||
json (~> 1.4)
|
||||
ref (2.0.0)
|
||||
request_store (1.1.0)
|
||||
responders (2.1.0)
|
||||
railties (>= 4.2.0, < 5)
|
||||
responders (2.3.0)
|
||||
railties (>= 4.2.0, < 5.1)
|
||||
rest-client (1.8.0)
|
||||
http-cookie (>= 1.0.2, < 2.0)
|
||||
mime-types (>= 1.16, < 3.0)
|
||||
|
@ -574,9 +574,8 @@ GEM
|
|||
coffee-rails
|
||||
tzinfo (1.2.2)
|
||||
thread_safe (~> 0.1)
|
||||
uglifier (2.7.1)
|
||||
execjs (>= 0.3.0)
|
||||
json (>= 1.8.0)
|
||||
uglifier (3.0.2)
|
||||
execjs (>= 0.3.0, < 3)
|
||||
unf (0.1.4)
|
||||
unf_ext
|
||||
unf_ext (0.0.7.1)
|
||||
|
@ -592,7 +591,7 @@ GEM
|
|||
activemodel (>= 3.0.0)
|
||||
addressable
|
||||
vcr (3.0.1)
|
||||
warden (1.2.3)
|
||||
warden (1.2.6)
|
||||
rack (>= 1.0)
|
||||
web-console (2.2.1)
|
||||
activemodel (>= 4.0)
|
||||
|
@ -636,7 +635,7 @@ DEPENDENCIES
|
|||
coffee-rails (~> 4.1.0)
|
||||
database_cleaner
|
||||
deep_cloneable (~> 2.2.1)
|
||||
devise
|
||||
devise (~> 3.0)
|
||||
draper
|
||||
factory_girl
|
||||
fog
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -21,4 +21,5 @@
|
|||
|
||||
- unless @facade.procedure.lien_site_web.blank?
|
||||
.center
|
||||
=link_to 'En savoir plus ...', @facade.procedure.lien_site_web, {target: '_blank'}
|
||||
%a{href: "#{@facade.procedure.lien_site_web.html_safe}", target: '_blank'}
|
||||
En savoir plus ...
|
|
@ -1 +1 @@
|
|||
<%= (MailTemplate.replace_tags @dossier.procedure.mail_received.body, @dossier).html_safe %>
|
||||
<%= escape_once (MailTemplate.replace_tags @dossier.procedure.mail_received.body, @dossier).html_safe %>
|
|
@ -1 +1 @@
|
|||
remote_storage: false
|
||||
remote_storage: true
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -285,7 +285,7 @@ shared_examples 'description_controller_spec_POST_piece_justificatives_for_owner
|
|||
'piece_justificative_'+all_pj_type[0].to_s => piece_justificative_0,
|
||||
'piece_justificative_'+all_pj_type[1].to_s => piece_justificative_1} }
|
||||
|
||||
context 'when user is the owner' do
|
||||
context 'when user is the owner', vcr: {cassette_name: 'controllers_users_description_controller_pieces_justificatives'} do
|
||||
before do
|
||||
sign_in user
|
||||
end
|
||||
|
|
|
@ -7,7 +7,7 @@ describe SIADE::EtablissementAdapter do
|
|||
|
||||
before do
|
||||
stub_request(:get, "https://api-dev.apientreprise.fr/v2/etablissements/#{siret}?token=#{SIADETOKEN}")
|
||||
.to_return(body: File.read('spec/support/files/etablissement.json', status: 200))
|
||||
.to_return(body: File.read('spec/support/files/etablissement.json', status: 200))
|
||||
end
|
||||
|
||||
it '#to_params class est une Hash ?' do
|
||||
|
@ -74,11 +74,9 @@ describe SIADE::EtablissementAdapter do
|
|||
|
||||
before do
|
||||
stub_request(:get, "https://api-dev.apientreprise.fr/v2/etablissements/#{bad_siret}?token=#{SIADETOKEN}")
|
||||
.to_return(body: 'Fake body', status: 404)
|
||||
.to_return(body: 'Fake body', status: 404)
|
||||
end
|
||||
|
||||
it 'raises exception RestClient::ResourceNotFound' do
|
||||
expect { subject }.to raise_error(RestClient::ResourceNotFound)
|
||||
end
|
||||
it { expect(subject).to be_nil }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue