Refactor a test to avoid logging a Sentry error message

This commit is contained in:
gregoirenovel 2017-08-21 16:34:52 +02:00
parent 2908a81a1b
commit af91751e1e

View file

@ -333,8 +333,6 @@ describe Backoffice::DossiersController, type: :controller do
end end
context 'when the dossier has an attestation' do context 'when the dossier has an attestation' do
let(:emailable) { false }
before do before do
attestation = Attestation.new attestation = Attestation.new
allow(attestation).to receive(:pdf).and_return(double(read: 'pdf', size: 2.megabytes)) allow(attestation).to receive(:pdf).and_return(double(read: 'pdf', size: 2.megabytes))
@ -350,6 +348,8 @@ describe Backoffice::DossiersController, type: :controller do
it 'Notification email is sent with the attestation' do it 'Notification email is sent with the attestation' do
subject subject
is_expected.to redirect_to backoffice_dossier_path(id: dossier.id)
end end
end end
@ -361,10 +361,10 @@ describe Backoffice::DossiersController, type: :controller do
expect(controller).to receive(:capture_message) expect(controller).to receive(:capture_message)
subject subject
end
end
it { is_expected.to redirect_to backoffice_dossier_path(id: dossier.id) } is_expected.to redirect_to backoffice_dossier_path(id: dossier.id)
end
end
end end
end end
end end