app: rename new_gestionnaire
to gestionnaires
This commit is contained in:
parent
fb4e59b0fc
commit
30d11e0dac
51 changed files with 53 additions and 53 deletions
21
spec/views/gestionnaire/avis/instruction.html.haml_spec.rb
Normal file
21
spec/views/gestionnaire/avis/instruction.html.haml_spec.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
describe 'gestionnaires/avis/instruction.html.haml', type: :view do
|
||||
let(:avis) { create(:avis, confidentiel: confidentiel) }
|
||||
|
||||
before do
|
||||
assign(:avis, avis)
|
||||
@dossier = create(:dossier, :accepte)
|
||||
allow(view).to receive(:current_gestionnaire).and_return(avis.gestionnaire)
|
||||
end
|
||||
|
||||
subject { render }
|
||||
|
||||
context 'with a confidential avis' do
|
||||
let(:confidentiel) { true }
|
||||
it { is_expected.to have_text("Cet avis est confidentiel et n'est pas affiché aux autres experts consultés") }
|
||||
end
|
||||
|
||||
context 'with a not confidential avis' do
|
||||
let(:confidentiel) { false }
|
||||
it { is_expected.to have_text("Cet avis est partagé avec les autres experts") }
|
||||
end
|
||||
end
|
|
@ -0,0 +1,27 @@
|
|||
describe 'gestionnaires/dossiers/envoyer_dossier_block.html.haml', type: :view do
|
||||
let(:dossier) { create(:dossier) }
|
||||
|
||||
subject do
|
||||
render(
|
||||
'gestionnaires/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 instructeur assigné sur cette démarche") }
|
||||
end
|
||||
end
|
|
@ -0,0 +1,25 @@
|
|||
describe 'gestionnaires/dossiers/state_button_motivation.html.haml', type: :view do
|
||||
let(:dossier) { create(:dossier, :en_instruction) }
|
||||
|
||||
subject! do
|
||||
render(
|
||||
'gestionnaires/dossiers/state_button_motivation.html.haml',
|
||||
dossier: dossier,
|
||||
popup_title: 'Accepter le dossier',
|
||||
placeholder: 'Expliquez au demandeur pourquoi ce dossier est accepté (facultatif)',
|
||||
popup_class: 'accept',
|
||||
process_action: 'accepter',
|
||||
title: 'Accepter',
|
||||
confirm: "Confirmez-vous l'acceptation ce dossier ?"
|
||||
)
|
||||
end
|
||||
|
||||
context 'with an attestation preview' do
|
||||
let(:dossier) { create :dossier, :accepte, :with_attestation }
|
||||
it { expect(rendered).to have_text("Voir l'attestation") }
|
||||
end
|
||||
|
||||
context 'without an attestation preview' do
|
||||
it { expect(rendered).not_to have_text("Voir l'attestation") }
|
||||
end
|
||||
end
|
18
spec/views/gestionnaire/dossiers/print.html.haml_spec.rb
Normal file
18
spec/views/gestionnaire/dossiers/print.html.haml_spec.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
describe 'gestionnaires/dossiers/print.html.haml', type: :view do
|
||||
before { view.extend DossierHelper }
|
||||
|
||||
context "with a dossier" do
|
||||
let(:current_gestionnaire) { create(:gestionnaire) }
|
||||
let(:dossier) { create(:dossier, :en_instruction, :with_commentaires) }
|
||||
|
||||
before do
|
||||
assign(:dossier, dossier)
|
||||
allow(view).to receive(:current_gestionnaire).and_return(current_gestionnaire)
|
||||
|
||||
render
|
||||
end
|
||||
|
||||
it { expect(rendered).to include("Dossier nº #{dossier.id}") }
|
||||
it { expect(rendered).to include(dossier.procedure.libelle) }
|
||||
end
|
||||
end
|
21
spec/views/gestionnaire/dossiers/show.html.haml_spec.rb
Normal file
21
spec/views/gestionnaire/dossiers/show.html.haml_spec.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
describe 'gestionnaires/dossiers/show.html.haml', type: :view do
|
||||
let(:current_gestionnaire) { create(:gestionnaire) }
|
||||
let(:dossier) { create(:dossier, :en_construction) }
|
||||
|
||||
before do
|
||||
sign_in current_gestionnaire
|
||||
assign(:dossier, dossier)
|
||||
end
|
||||
|
||||
subject! { render }
|
||||
|
||||
it 'renders the header' do
|
||||
expect(rendered).to have_text("Dossier nº #{dossier.id}")
|
||||
end
|
||||
|
||||
it 'renders the dossier infos' do
|
||||
expect(rendered).to have_text('Identité')
|
||||
expect(rendered).to have_text('Demande')
|
||||
expect(rendered).to have_text('Pièces jointes')
|
||||
end
|
||||
end
|
|
@ -0,0 +1,20 @@
|
|||
describe 'gestionnaires/procedures/_download_dossiers.html.haml', type: :view do
|
||||
let(:current_gestionnaire) { create(:gestionnaire) }
|
||||
let(:procedure) { create(:procedure) }
|
||||
|
||||
subject { render 'gestionnaires/procedures/download_dossiers.html.haml', procedure: procedure }
|
||||
|
||||
context "when procedure has 0 dossier" do
|
||||
it { is_expected.not_to include("Télécharger tous les dossiers") }
|
||||
end
|
||||
|
||||
context "when procedure has 1 dossier brouillon" do
|
||||
let!(:dossier) { create(:dossier, procedure: procedure) }
|
||||
it { is_expected.not_to include("Télécharger tous les dossiers") }
|
||||
end
|
||||
|
||||
context "when procedure has at least 1 dossier en construction" do
|
||||
let!(:dossier) { create(:dossier, :en_construction, procedure: procedure) }
|
||||
it { is_expected.to include("Télécharger tous les dossiers") }
|
||||
end
|
||||
end
|
20
spec/views/gestionnaire/shared/avis/list.html.haml_spec.rb
Normal file
20
spec/views/gestionnaire/shared/avis/list.html.haml_spec.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
describe 'gestionnaires/shared/avis/_list.html.haml', type: :view do
|
||||
before { view.extend DossierHelper }
|
||||
|
||||
subject { render 'gestionnaires/shared/avis/list.html.haml', avis: avis, avis_seen_at: seen_at, current_gestionnaire: gestionnaire }
|
||||
|
||||
let(:gestionnaire) { create(:gestionnaire) }
|
||||
let(:avis) { [create(:avis, claimant: gestionnaire)] }
|
||||
|
||||
context "with a seen_at after avis created_at" do
|
||||
let(:seen_at) { avis.first.created_at + 1.hour }
|
||||
|
||||
it { is_expected.not_to have_css(".highlighted") }
|
||||
end
|
||||
|
||||
context "with a seen_at after avis created_at" do
|
||||
let(:seen_at) { avis.first.created_at - 1.hour }
|
||||
|
||||
it { is_expected.to have_css(".highlighted") }
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue