class Shoulda::Matchers::ActionController::CallbackMatcher
@private
def callbacks
def callbacks controller_class._process_action_callbacks.select do |callback| callback.kind == kind end end
def description
def description "have :#{method_name} as a #{kind}_#{callback_type}" end
def failure_message
def failure_message "Expected that #{controller_class.name} would have :#{method_name} as a #{kind}_#{callback_type}" end
def failure_message_when_negated
def failure_message_when_negated "Expected that #{controller_class.name} would not have :#{method_name} as a #{kind}_#{callback_type}" end
def initialize(method_name, kind, callback_type)
def initialize(method_name, kind, callback_type) @method_name = method_name @kind = kind @callback_type = callback_type end
def matches?(controller)
def matches?(controller) @controller = controller @controller_class = controller.class callbacks.map(&:filter).include?(method_name) end