tests
This commit is contained in:
parent
328c2a8e3c
commit
81f5a5254b
16 changed files with 544 additions and 674 deletions
34
spec/views/experts/avis/instruction.html.haml.spec.rb
Normal file
34
spec/views/experts/avis/instruction.html.haml.spec.rb
Normal file
|
@ -0,0 +1,34 @@
|
|||
describe 'experts/avis/instruction.html.haml', type: :view do
|
||||
let(:expert) { create(:expert) }
|
||||
let(:claimant) { create(:instructeur) }
|
||||
let(:procedure) { create(:procedure) }
|
||||
let!(:avis) { create(:avis, confidentiel: confidentiel, claimant: claimant, experts_procedure: experts_procedure) }
|
||||
let!(:experts_procedure) { ExpertsProcedure.create(expert: expert, procedure: procedure) }
|
||||
|
||||
before do
|
||||
assign(:avis, avis)
|
||||
assign(:new_avis, Avis.new)
|
||||
assign(:dossier, avis.dossier)
|
||||
allow(view).to receive(:current_expert).and_return(avis.expert)
|
||||
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
|
||||
|
||||
context 'when an expert is not allowed to invite another expert' do
|
||||
let(:confidentiel) { false }
|
||||
before do
|
||||
Flipper.enable_actor(:expert_not_allowed_to_invite, avis.procedure)
|
||||
end
|
||||
it { is_expected.to have_no_text("Inviter des personnes à donner leur avis") }
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue