class Shoulda::Matchers::ActionController::FilterParamMatcher
@private
Public Class Methods
new(key)
click to toggle source
# File lib/shoulda/matchers/action_controller/filter_param_matcher.rb, line 30 def initialize(key) @key = key.to_s end
Public Instance Methods
description()
click to toggle source
# File lib/shoulda/matchers/action_controller/filter_param_matcher.rb, line 48 def description "filter #{@key}" end
failure_message()
click to toggle source
# File lib/shoulda/matchers/action_controller/filter_param_matcher.rb, line 38 def failure_message "Expected #{@key} to be filtered; filtered keys: #{filtered_keys.join(', ')}" end
Also aliased as: failure_message_for_should
failure_message_when_negated()
click to toggle source
# File lib/shoulda/matchers/action_controller/filter_param_matcher.rb, line 43 def failure_message_when_negated "Did not expect #{@key} to be filtered" end
Also aliased as: failure_message_for_should_not
matches?(controller)
click to toggle source
# File lib/shoulda/matchers/action_controller/filter_param_matcher.rb, line 34 def matches?(controller) filters_key? end
Private Instance Methods
filtered_keys()
click to toggle source
# File lib/shoulda/matchers/action_controller/filter_param_matcher.rb, line 58 def filtered_keys Rails.application.config.filter_parameters.map(&:to_s) end
filters_key?()
click to toggle source
# File lib/shoulda/matchers/action_controller/filter_param_matcher.rb, line 54 def filters_key? filtered_keys.include?(@key) end