Supprime la possibilité pour l'expert invité d'envoyer un message à l'usager
This commit is contained in:
parent
f4fa557aca
commit
6636b7f14c
5 changed files with 1 additions and 67 deletions
|
@ -65,14 +65,6 @@ describe Instructeurs::AvisController, type: :controller do
|
|||
it { expect(assigns(:dossier)).to eq(dossier) }
|
||||
end
|
||||
|
||||
describe '#messagerie' do
|
||||
before { get :messagerie, params: { id: avis_without_answer.id, procedure_id: procedure.id } }
|
||||
|
||||
it { expect(response).to have_http_status(:success) }
|
||||
it { expect(assigns(:avis)).to eq(avis_without_answer) }
|
||||
it { expect(assigns(:dossier)).to eq(dossier) }
|
||||
end
|
||||
|
||||
describe '#bilans_bdf' do
|
||||
before { get :bilans_bdf, params: { id: avis_without_answer.id, procedure_id: procedure.id } }
|
||||
|
||||
|
@ -118,40 +110,6 @@ describe Instructeurs::AvisController, type: :controller do
|
|||
end
|
||||
end
|
||||
|
||||
describe '#create_commentaire' do
|
||||
let(:file) { nil }
|
||||
let(:scan_result) { true }
|
||||
let(:now) { Time.zone.parse("14/07/1789") }
|
||||
|
||||
subject { post :create_commentaire, params: { id: avis_without_answer.id, procedure_id: procedure.id, commentaire: { body: 'commentaire body', piece_jointe: file } } }
|
||||
|
||||
before do
|
||||
allow(ClamavService).to receive(:safe_file?).and_return(scan_result)
|
||||
Timecop.freeze(now)
|
||||
end
|
||||
|
||||
after { Timecop.return }
|
||||
|
||||
it do
|
||||
subject
|
||||
|
||||
expect(response).to redirect_to(messagerie_instructeur_avis_path(avis_without_answer.procedure, avis_without_answer))
|
||||
expect(dossier.commentaires.map(&:body)).to match(['commentaire body'])
|
||||
expect(dossier.reload.last_commentaire_updated_at).to eq(now)
|
||||
end
|
||||
|
||||
context "with a file" do
|
||||
let(:file) { fixture_file_upload('spec/fixtures/files/piece_justificative_0.pdf', 'application/pdf') }
|
||||
|
||||
it do
|
||||
subject
|
||||
expect(Commentaire.last.piece_jointe.filename).to eq("piece_justificative_0.pdf")
|
||||
end
|
||||
|
||||
it { expect { subject }.to change(Commentaire, :count).by(1) }
|
||||
end
|
||||
end
|
||||
|
||||
describe '#expert_cannot_invite_another_expert' do
|
||||
let!(:previous_avis) { Avis.create(dossier: dossier, claimant: claimant, instructeur: instructeur, confidentiel: previous_avis_confidentiel) }
|
||||
let(:previous_avis_confidentiel) { false }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue