How to disable a before_action in a controller spec?
问题 I've employed the use of this in my controller spec: controller.class.skip_before_action Specifically, in this case: controller.class.skip_before_action :require_authorisation_to_view_materials MaterialsController: class MaterialsController < ApplicationController before_action :set_material, only: [:show, :edit, :update, :destroy] before_action :require_authorisation_to_view_materials, only: [:index, :show] def require_authorisation_to_view_materials # For Materials Page unless user_signed