Merge branch 'dev'

This commit is contained in:
Mathieu Magnin 2018-12-04 12:02:11 +01:00
commit 8bef3c2a0e
16 changed files with 70 additions and 59 deletions

View file

@ -22,25 +22,25 @@ GEM
specs: specs:
aasm (5.0.1) aasm (5.0.1)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
actioncable (5.2.1) actioncable (5.2.1.1)
actionpack (= 5.2.1) actionpack (= 5.2.1.1)
nio4r (~> 2.0) nio4r (~> 2.0)
websocket-driver (>= 0.6.1) websocket-driver (>= 0.6.1)
actionmailer (5.2.1) actionmailer (5.2.1.1)
actionpack (= 5.2.1) actionpack (= 5.2.1.1)
actionview (= 5.2.1) actionview (= 5.2.1.1)
activejob (= 5.2.1) activejob (= 5.2.1.1)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
actionpack (5.2.1) actionpack (5.2.1.1)
actionview (= 5.2.1) actionview (= 5.2.1.1)
activesupport (= 5.2.1) activesupport (= 5.2.1.1)
rack (~> 2.0) rack (~> 2.0)
rack-test (>= 0.6.3) rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2) rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.1) actionview (5.2.1.1)
activesupport (= 5.2.1) activesupport (= 5.2.1.1)
builder (~> 3.1) builder (~> 3.1)
erubi (~> 1.4) erubi (~> 1.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
@ -53,24 +53,24 @@ GEM
activemodel (>= 4.1, < 6) activemodel (>= 4.1, < 6)
case_transform (>= 0.2) case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3) jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (5.2.1) activejob (5.2.1.1)
activesupport (= 5.2.1) activesupport (= 5.2.1.1)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (5.2.1) activemodel (5.2.1.1)
activesupport (= 5.2.1) activesupport (= 5.2.1.1)
activemodel-serializers-xml (1.0.2) activemodel-serializers-xml (1.0.2)
activemodel (> 5.x) activemodel (> 5.x)
activesupport (> 5.x) activesupport (> 5.x)
builder (~> 3.1) builder (~> 3.1)
activerecord (5.2.1) activerecord (5.2.1.1)
activemodel (= 5.2.1) activemodel (= 5.2.1.1)
activesupport (= 5.2.1) activesupport (= 5.2.1.1)
arel (>= 9.0) arel (>= 9.0)
activestorage (5.2.1) activestorage (5.2.1.1)
actionpack (= 5.2.1) actionpack (= 5.2.1.1)
activerecord (= 5.2.1) activerecord (= 5.2.1.1)
marcel (~> 0.3.1) marcel (~> 0.3.1)
activesupport (5.2.1) activesupport (5.2.1.1)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2) i18n (>= 0.7, < 2)
minitest (~> 5.1) minitest (~> 5.1)
@ -115,17 +115,18 @@ GEM
browser (2.5.3) browser (2.5.3)
builder (3.2.3) builder (3.2.3)
byebug (10.0.2) byebug (10.0.2)
capybara (2.18.0) capybara (3.11.0)
addressable addressable
mini_mime (>= 0.1.3) mini_mime (>= 0.1.3)
nokogiri (>= 1.3.3) nokogiri (~> 1.8)
rack (>= 1.0.0) rack (>= 1.6.0)
rack-test (>= 0.5.4) rack-test (>= 0.6.3)
xpath (>= 2.0, < 4.0) regexp_parser (~> 1.2)
xpath (~> 3.2)
capybara-email (3.0.1) capybara-email (3.0.1)
capybara (>= 2.4, < 4.0) capybara (>= 2.4, < 4.0)
mail mail
capybara-screenshot (1.0.21) capybara-screenshot (1.0.22)
capybara (>= 1.0, < 4) capybara (>= 1.0, < 4)
launchy launchy
capybara-selenium (0.0.6) capybara-selenium (0.0.6)
@ -332,13 +333,13 @@ GEM
crass (~> 1.0.2) crass (~> 1.0.2)
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
lumberjack (1.0.13) lumberjack (1.0.13)
mail (2.7.0) mail (2.7.1)
mini_mime (>= 0.1.1) mini_mime (>= 0.1.1)
mailjet (1.5.4) mailjet (1.5.4)
activesupport (>= 3.1.0) activesupport (>= 3.1.0)
rack (>= 1.4.0) rack (>= 1.4.0)
rest-client rest-client
marcel (0.3.2) marcel (0.3.3)
mimemagic (~> 0.3.2) mimemagic (~> 0.3.2)
method_source (0.9.2) method_source (0.9.2)
mime-types (3.2.2) mime-types (3.2.2)
@ -416,7 +417,7 @@ GEM
pry-byebug (3.6.0) pry-byebug (3.6.0)
byebug (~> 10.0) byebug (~> 10.0)
pry (~> 0.10) pry (~> 0.10)
public_suffix (3.0.2) public_suffix (3.0.3)
puma (3.12.0) puma (3.12.0)
rack (2.0.6) rack (2.0.6)
rack-handlers (0.7.3) rack-handlers (0.7.3)
@ -435,18 +436,18 @@ GEM
rack rack
rack-test (1.1.0) rack-test (1.1.0)
rack (>= 1.0, < 3) rack (>= 1.0, < 3)
rails (5.2.1) rails (5.2.1.1)
actioncable (= 5.2.1) actioncable (= 5.2.1.1)
actionmailer (= 5.2.1) actionmailer (= 5.2.1.1)
actionpack (= 5.2.1) actionpack (= 5.2.1.1)
actionview (= 5.2.1) actionview (= 5.2.1.1)
activejob (= 5.2.1) activejob (= 5.2.1.1)
activemodel (= 5.2.1) activemodel (= 5.2.1.1)
activerecord (= 5.2.1) activerecord (= 5.2.1.1)
activestorage (= 5.2.1) activestorage (= 5.2.1.1)
activesupport (= 5.2.1) activesupport (= 5.2.1.1)
bundler (>= 1.3.0) bundler (>= 1.3.0)
railties (= 5.2.1) railties (= 5.2.1.1)
sprockets-rails (>= 2.0.0) sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.2) rails-controller-testing (1.0.2)
actionpack (~> 5.x, >= 5.0.1) actionpack (~> 5.x, >= 5.0.1)
@ -460,9 +461,9 @@ GEM
rails-i18n (5.1.2) rails-i18n (5.1.2)
i18n (>= 0.7, < 2) i18n (>= 0.7, < 2)
railties (>= 5.0, < 6) railties (>= 5.0, < 6)
railties (5.2.1) railties (5.2.1.1)
actionpack (= 5.2.1) actionpack (= 5.2.1.1)
activesupport (= 5.2.1) activesupport (= 5.2.1.1)
method_source method_source
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0) thor (>= 0.19.0, < 2.0)
@ -476,6 +477,7 @@ GEM
ffi ffi
rbnacl-libsodium (1.0.16) rbnacl-libsodium (1.0.16)
rbnacl (>= 3.0.1) rbnacl (>= 3.0.1)
regexp_parser (1.3.0)
request_store (1.4.1) request_store (1.4.1)
rack (>= 1.4) rack (>= 1.4)
responders (2.4.0) responders (2.4.0)
@ -643,7 +645,7 @@ GEM
websocket-driver (0.7.0) websocket-driver (0.7.0)
websocket-extensions (>= 0.1.0) websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3) websocket-extensions (0.1.3)
xpath (3.0.0) xpath (3.2.0)
nokogiri (~> 1.8) nokogiri (~> 1.8)
xray-rails (0.3.1) xray-rails (0.3.1)
rails (>= 3.1.0) rails (>= 3.1.0)

View file

@ -3,3 +3,7 @@ import { toggle } from '@utils';
export function toggleCondidentielExplanation() { export function toggleCondidentielExplanation() {
toggle(document.querySelector('.confidentiel-explanation')); toggle(document.querySelector('.confidentiel-explanation'));
} }
export function replaceSemicolonByComma(event) {
event.target.value = event.target.value.replace(/;/g, ',');
}

View file

@ -25,6 +25,7 @@ import { toggleCondidentielExplanation } from '../new_design/avis';
import { scrollMessagerie } from '../new_design/messagerie'; import { scrollMessagerie } from '../new_design/messagerie';
import { showMotivation, motivationCancel } from '../new_design/state-button'; import { showMotivation, motivationCancel } from '../new_design/state-button';
import { toggleChart } from '../new_design/toggle-chart'; import { toggleChart } from '../new_design/toggle-chart';
import { replaceSemicolonByComma } from '../new_design/avis';
// This is the global application namespace where we expose helpers used from rails views // This is the global application namespace where we expose helpers used from rails views
const DS = { const DS = {
@ -32,7 +33,8 @@ const DS = {
scrollMessagerie, scrollMessagerie,
showMotivation, showMotivation,
motivationCancel, motivationCancel,
toggleChart toggleChart,
replaceSemicolonByComma
}; };
// Start Rails helpers // Start Rails helpers

View file

@ -146,7 +146,7 @@
%h4 Options avancées %h4 Options avancées
%label{ for: :auto_archive_on } Archivage automatique le %label{ for: :auto_archive_on } Archivage automatique le
= f.text_field :auto_archive_on, id: 'auto_archive_on', value: @procedure.auto_archive_on.try{ |d| d.strftime("%d-%m-%Y") }, data: { provide: 'datepicker', 'date-language' => 'fr', 'date-format' => 'dd/mm/yyyy' } = f.date_field :auto_archive_on, id: 'auto_archive_on', value: @procedure.auto_archive_on
(à 00h00) (à 00h00)
%p.help-block %p.help-block
%i.fa.fa-info-circle %i.fa.fa-info-circle

View file

@ -1,5 +1,5 @@
= render partial: 'new_administrateur/breadcrumbs', = render partial: 'new_administrateur/breadcrumbs',
locals: { steps: [link_to('Procedures', admin_procedures_path), locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)), link_to(@procedure.libelle, admin_procedure_path(@procedure)),
link_to('choix du service', services_path(procedure_id: @procedure.id)), link_to('choix du service', services_path(procedure_id: @procedure.id)),
'modifier le service'] } 'modifier le service'] }

View file

@ -1,5 +1,5 @@
= render partial: 'new_administrateur/breadcrumbs', = render partial: 'new_administrateur/breadcrumbs',
locals: { steps: [link_to('Procedures', admin_procedures_path), locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)), link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'choix du service'] } 'choix du service'] }

View file

@ -1,5 +1,5 @@
= render partial: 'new_administrateur/breadcrumbs', = render partial: 'new_administrateur/breadcrumbs',
locals: { steps: [link_to('Procedures', admin_procedures_path), locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)), link_to(@procedure.libelle, admin_procedure_path(@procedure)),
link_to('choix du service', services_path(procedure_id: @procedure.id)), link_to('choix du service', services_path(procedure_id: @procedure.id)),
'nouveau service'] } 'nouveau service'] }

View file

@ -3,7 +3,7 @@
%p.avis-notice Les invités pourront consulter, donner un avis sur le dossier et contribuer au fil de messagerie, mais ils ne pourront pas le modifier. %p.avis-notice Les invités pourront consulter, donner un avis sur le dossier et contribuer au fil de messagerie, mais ils ne pourront pas le modifier.
= form_for avis, url: url, html: { class: 'form' } do |f| = form_for avis, url: url, html: { class: 'form' } do |f|
= f.email_field :emails, placeholder: 'Adresses email, séparées par des virgules', required: true, multiple: true = f.email_field :emails, placeholder: 'Adresses email, séparées par des virgules', required: true, multiple: true, onchange: "javascript:DS.replaceSemicolonByComma(event);"
= f.text_area :introduction, rows: 3, value: avis.introduction || 'Bonjour, merci de me donner votre avis sur ce dossier.', required: true = f.text_area :introduction, rows: 3, value: avis.introduction || 'Bonjour, merci de me donner votre avis sur ce dossier.', required: true
.flex.justify-between.align-baseline .flex.justify-between.align-baseline
- if must_be_confidentiel - if must_be_confidentiel

View file

@ -111,7 +111,7 @@ describe SupportController, type: :controller do
get :index get :index
expect(response.status).to eq(200) expect(response.status).to eq(200)
expect(response.body).to have_content("Email *") expect(response.body).to have_text("Email")
end end
end end

View file

@ -22,7 +22,7 @@ feature 'The user' do
# fill data # fill data
fill_in('text', with: 'super texte') fill_in('text', with: 'super texte')
fill_in('textarea', with: 'super textarea') fill_in('textarea', with: 'super textarea')
fill_in('date', with: '12/12/2012') fill_in('date', with: '12-12-2012')
select_date_and_time(Time.zone.parse('06/01/1985 7h05'), form_id_for('datetime')) select_date_and_time(Time.zone.parse('06/01/1985 7h05'), form_id_for('datetime'))
fill_in('number', with: '42') fill_in('number', with: '42')
check('checkbox') check('checkbox')

View file

@ -7,7 +7,7 @@ RSpec.describe AvisMailer, type: :mailer do
subject { described_class.avis_invitation(avis) } subject { described_class.avis_invitation(avis) }
it { expect(subject.subject).to eq("Donnez votre avis sur le dossier nº #{avis.dossier.id} (#{avis.dossier.procedure.libelle})") } it { expect(subject.subject).to eq("Donnez votre avis sur le dossier nº #{avis.dossier.id} (#{avis.dossier.procedure.libelle})") }
it { expect(subject.body).to have_text("Vous avez été invité par #{avis.claimant.email} à donner votre avis sur le dossier nº #{avis.dossier.id} de la démarche : #{avis.dossier.procedure.libelle}") } it { expect(subject.body).to have_text("Vous avez été invité par\r\n#{avis.claimant.email}\r\nà donner votre avis sur le dossier nº #{avis.dossier.id} de la démarche :\r\n#{avis.dossier.procedure.libelle}") }
it { expect(subject.body).to include(avis.introduction) } it { expect(subject.body).to include(avis.introduction) }
it { expect(subject.body).to include(gestionnaire_avis_url(avis)) } it { expect(subject.body).to include(gestionnaire_avis_url(avis)) }

View file

@ -48,6 +48,9 @@ Capybara.register_driver :headless_chrome do |app|
desired_capabilities: capabilities desired_capabilities: capabilities
end end
# FIXME: remove this line when https://github.com/rspec/rspec-rails/issues/1897 has been fixed
Capybara.server = :puma, { Silent: true }
Capybara.default_max_wait_time = 2 Capybara.default_max_wait_time = 2
# Save a snapshot of the HTML page when an integration test fails # Save a snapshot of the HTML page when an integration test fails

View file

@ -10,7 +10,7 @@ describe 'new_gestionnaire/dossiers/show.html.haml', type: :view do
subject! { render } subject! { render }
it 'renders the header' do it 'renders the header' do
expect(rendered).to have_text("Dossier nº #{dossier.id}") expect(rendered).to have_text("Dossier nº #{dossier.id}")
end end
it 'renders the dossier infos' do it 'renders the dossier infos' do

View file

@ -12,7 +12,7 @@ describe 'new_user/dossiers/demande.html.haml', type: :view do
subject! { render } subject! { render }
it 'renders the header' do it 'renders the header' do
expect(rendered).to have_text("Dossier nº #{dossier.id}") expect(rendered).to have_text("Dossier nº #{dossier.id}")
end end
it 'renders the dossier infos' do it 'renders the dossier infos' do

View file

@ -11,7 +11,7 @@ describe 'new_user/dossiers/show.html.haml', type: :view do
subject! { render } subject! { render }
it 'renders a summary of the dossier state' do it 'renders a summary of the dossier state' do
expect(rendered).to have_text("Dossier nº #{dossier.id}") expect(rendered).to have_text("Dossier nº #{dossier.id}")
expect(rendered).to have_selector('.status-overview') expect(rendered).to have_selector('.status-overview')
end end

View file

@ -9,7 +9,7 @@ describe 'new_user/dossiers/show/header.html.haml', type: :view do
it 'affiche les informations du dossier' do it 'affiche les informations du dossier' do
expect(rendered).to have_text(dossier.procedure.libelle) expect(rendered).to have_text(dossier.procedure.libelle)
expect(rendered).to have_text("Dossier nº #{dossier.id}") expect(rendered).to have_text("Dossier nº #{dossier.id}")
expect(rendered).to have_text("en construction") expect(rendered).to have_text("en construction")
expect(rendered).to have_selector("ul.tabs") expect(rendered).to have_selector("ul.tabs")