class Shoulda::Matchers::ActionController::FilterParamMatcher
@private
Public Class Methods
Source
# File lib/shoulda/matchers/action_controller/filter_param_matcher.rb, line 30 def initialize(key) @key = key end
Public Instance Methods
Source
# File lib/shoulda/matchers/action_controller/filter_param_matcher.rb, line 47 def description "filter #{@key}" end
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
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
Source
# File lib/shoulda/matchers/action_controller/filter_param_matcher.rb, line 34 def matches?(_controller) filters_key? end
Private Instance Methods
Source
# File lib/shoulda/matchers/action_controller/filter_param_matcher.rb, line 64 def filtered_keys Rails.application.config.filter_parameters end
Source
# File lib/shoulda/matchers/action_controller/filter_param_matcher.rb, line 53 def filters_key? filtered_keys.any? do |filter| case filter when Regexp filter =~ @key else filter == @key end end end