demarches-normaliennes/spec/controllers/admin
Pierre de La Morinerie 51cb3a04a3 app: fix JS redirection with Turbolinks disabled
When Turbolinks is enabled, a `redirect_to` in a `format: :js` request
will emit code that instructs Turbolinks to navigate to the page.
Turbolinks will then load the redirection target as HTML, and display
it.

But with Turbolinks disabled, the same `redirect_to` will instead
respond with a standard `302: redirect`. `Rails.ajax` will interpret
this redirect as "Please perform the same call again to the redirected
URL, in the same format" – and request our redirection target, but
using `format: :js`.


This breaks the "Publish procedure" button. In that case, we really want
the page to be navigated to. Add an explicit JS redirect, so that the
redirection occurs in HTML.
2020-05-13 11:04:16 +02:00
..
assigns_controller_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
attestation_templates_controller_spec.rb attestation: fix preview of logos 2020-03-30 14:58:50 +02:00
instructeurs_controller_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
mail_templates_controller_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
procedures_controller_spec.rb app: fix JS redirection with Turbolinks disabled 2020-05-13 11:04:16 +02:00