attachments: remove the buggy fallback

The fallback would fail on non-champ attachments.
This commit is contained in:
Pierre de La Morinerie 2020-04-08 18:07:28 +02:00
parent 7e19dd2cda
commit 7ff381b6f0
2 changed files with 2 additions and 1 deletions

View file

@ -8,7 +8,7 @@ class AttachmentsController < ApplicationController
respond_to do |format|
format.js
format.html { redirect_back(fallback_location: @attachment.record&.dossier || root_path) }
format.html { redirect_back(fallback_location: root_url) }
end
end

View file

@ -11,6 +11,7 @@ describe AttachmentsController, type: :controller do
let(:format) { :js }
subject do
request.headers['HTTP_REFERER'] = dossier_url(dossier)
get :show, params: { id: attachment.id, signed_id: signed_id }, format: format
end