Merge branch 'dev'
This commit is contained in:
commit
40d03de2f8
4 changed files with 39 additions and 4 deletions
|
@ -1,5 +1,9 @@
|
||||||
.tab-title= "Envoyer ce dossier à un autre accompagnateur"
|
.tab-title= "Envoyer ce dossier à un autre accompagnateur"
|
||||||
|
|
||||||
|
- if potential_recipients.empty?
|
||||||
|
%p.tab-paragraph
|
||||||
|
Vous êtes le seul accompagnateur assigné sur cette procédure
|
||||||
|
- else
|
||||||
= form_for dossier, url: envoyer_a_accompagnateur_dossier_path(dossier.procedure, dossier), method: :post, html: { class: 'form' } do |f|
|
= form_for dossier, url: envoyer_a_accompagnateur_dossier_path(dossier.procedure, dossier), method: :post, html: { class: 'form' } do |f|
|
||||||
.flex.justify-start.align-baseline
|
.flex.justify-start.align-baseline
|
||||||
= select_tag(:recipient, options_from_collection_for_select(potential_recipients, :id, :email))
|
= select_tag(:recipient, options_from_collection_for_select(potential_recipients, :id, :email))
|
||||||
|
|
|
@ -20,6 +20,7 @@ module TPS
|
||||||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
||||||
config.i18n.default_locale = :fr
|
config.i18n.default_locale = :fr
|
||||||
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
|
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
|
||||||
|
config.i18n.available_locales = [:fr]
|
||||||
|
|
||||||
config.autoload_paths += %W(#{config.root}/lib #{config.root}/app/validators #{config.root}/app/facades)
|
config.autoload_paths += %W(#{config.root}/lib #{config.root}/app/validators #{config.root}/app/facades)
|
||||||
config.assets.paths << Rails.root.join('app', 'assets', 'javascript')
|
config.assets.paths << Rails.root.join('app', 'assets', 'javascript')
|
||||||
|
|
|
@ -9,6 +9,9 @@ Apipie.configure do |config|
|
||||||
config.namespaced_resources = true
|
config.namespaced_resources = true
|
||||||
config.show_all_examples = true
|
config.show_all_examples = true
|
||||||
|
|
||||||
|
config.languages = ['fr']
|
||||||
|
config.default_locale = 'fr'
|
||||||
|
|
||||||
config.app_info = <<~EOS
|
config.app_info = <<~EOS
|
||||||
Description
|
Description
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
describe 'new_gestionnaire/dossiers/envoyer_dossier_block.html.haml', type: :view do
|
||||||
|
let(:dossier) { create(:dossier) }
|
||||||
|
|
||||||
|
subject do
|
||||||
|
render(
|
||||||
|
'new_gestionnaire/dossiers/envoyer_dossier_block.html.haml',
|
||||||
|
dossier: dossier,
|
||||||
|
potential_recipients: potential_recipients,
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
context "there are other gestionnaires for the procedure" do
|
||||||
|
let(:gestionnaire) { create(:gestionnaire, email: 'yop@totomail.fr') }
|
||||||
|
let(:potential_recipients) { [gestionnaire] }
|
||||||
|
|
||||||
|
it { is_expected.to have_css("select > option[value='#{gestionnaire.id}']") }
|
||||||
|
it { is_expected.to have_css(".button.send") }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "there is no other gestionnaire for the procedure" do
|
||||||
|
let(:potential_recipients) { [] }
|
||||||
|
|
||||||
|
it { is_expected.not_to have_css("select") }
|
||||||
|
it { is_expected.not_to have_css(".button.send") }
|
||||||
|
it { is_expected.to have_content("Vous êtes le seul accompagnateur assigné sur cette procédure") }
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue