Browse Source

Prepend check_enabled_deletion to Settings::DeletesController (#229)

The specs for Settings::DeletesController include an example that
sets Settings.open_deletion to false and expects the "if deletion is not
available, redirect to root" logic to run.  However, this spec does not
set up a user, which means that the spec (intentionally or otherwise)
expects this redirection to work with unauthenticated access.

We should preserve that behavior.  To do so, we prepend the deletion
check to the action chain set up by Settings::BaseController, so that
said check occurs before the authenticate_user! check.
closed-social-glitch-2
David Yip 7 years ago
parent
commit
017fc81caf
No known key found for this signature in database GPG Key ID: 7DA0036508FCC0CC
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/controllers/settings/deletes_controller.rb

+ 1
- 1
app/controllers/settings/deletes_controller.rb View File

@ -2,7 +2,7 @@
class Settings::DeletesController < Settings::BaseController class Settings::DeletesController < Settings::BaseController
before_action :check_enabled_deletion
prepend_before_action :check_enabled_deletion
def show def show
@confirmation = Form::DeleteConfirmation.new @confirmation = Form::DeleteConfirmation.new

Loading…
Cancel
Save