This commit is contained in:
kara Diaby 2021-04-16 11:22:37 +02:00
parent 6524b6bcb7
commit 5982660c37
2 changed files with 16 additions and 19 deletions

View file

@ -37,4 +37,20 @@ describe 'new_administrateur/experts_procedures/index.html.haml', type: :view do
expect(@invited_experts).to match_array([avis.experts_procedure, avis2.experts_procedure])
end
end
context 'when the experts_require_administrateur_invitation is false' do
it 'authorize instructors to invite any expert' do
expect(rendered).not_to have_content "Affecter des experts à la démarche"
end
end
context 'when the experts_require_administrateur_invitation is true' do
let!(:procedure) { create(:procedure, :published, experts_require_administrateur_invitation: true) }
before do
subject
end
it 'does not authorize instructors to invite any expert but only those presents in admin list' do
expect(rendered).to have_content "Affecter des experts à la démarche"
end
end
end

View file

@ -55,24 +55,5 @@ describe 'new_administrateur/procedures/show.html.haml', type: :view do
it { expect(rendered).to have_css('#publish-procedure-link') }
it { expect(rendered).to have_content('Réactiver') }
end
describe 'When procedure.allow_expert_review is true, the expert list card must be visible' do
before do
render
end
it { expect(procedure.allow_expert_review).to be_truthy }
it { expect(rendered).to have_content('Liste des experts invités par les instructeurs') }
end
describe 'When procedure.allow_expert_review is false, the expert list card must not be visible' do
before do
procedure.update!(allow_expert_review: false)
procedure.reload
render
end
it { expect(procedure.allow_expert_review).to be_falsy }
it { expect(rendered).not_to have_content('Liste des experts invités par les instructeurs') }
end
end
end