specs: properly use xhr: true
in javascript requests
This avoids an unexpected `ActionController::InvalidCrossOriginRequest` exception to be raised when the forgery protection is disabled.
This commit is contained in:
parent
c20b8183a9
commit
5908b8019a
4 changed files with 26 additions and 28 deletions
|
@ -12,7 +12,7 @@ describe AttachmentsController, type: :controller do
|
|||
|
||||
subject do
|
||||
request.headers['HTTP_REFERER'] = dossier_url(dossier)
|
||||
get :show, params: { id: attachment.id, signed_id: signed_id }, format: format
|
||||
get :show, params: { id: attachment.id, signed_id: signed_id }, format: format, xhr: (format == :js)
|
||||
end
|
||||
|
||||
context 'when authenticated' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue