Fix destroy document specs
We were linking to the document url itself, which does not have a route associated and so the specs fails With this commit we are using the correct path to the destroy action of the DocumentsController. We are also using the referrer instead of a params[:from] attribute, as it avoids having to pass an extra parameter, making the code prettier and it works the same way
This commit is contained in:
@@ -11,7 +11,7 @@ class DocumentsController < ApplicationController
|
||||
else
|
||||
flash[:alert] = t "documents.actions.destroy.alert"
|
||||
end
|
||||
redirect_to params[:from]
|
||||
redirect_to request.referer
|
||||
end
|
||||
format.js do
|
||||
if @document.destroy
|
||||
|
||||
Reference in New Issue
Block a user