Class: Shoulda::ActionController::Matchers::FilterParamMatcher
- Inherits:
-
Object
- Object
- Shoulda::ActionController::Matchers::FilterParamMatcher
- Defined in:
- lib/shoulda/action_controller/matchers/filter_param_matcher.rb
Overview
:nodoc:
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(key) ⇒ FilterParamMatcher
constructor
A new instance of FilterParamMatcher.
- #matches?(controller) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(key) ⇒ FilterParamMatcher
Returns a new instance of FilterParamMatcher.
16 17 18 |
# File 'lib/shoulda/action_controller/matchers/filter_param_matcher.rb', line 16 def initialize(key) @key = key.to_s end |
Instance Method Details
#description ⇒ Object
33 34 35 |
# File 'lib/shoulda/action_controller/matchers/filter_param_matcher.rb', line 33 def description "filter #{@key}" end |
#failure_message ⇒ Object
25 26 27 |
# File 'lib/shoulda/action_controller/matchers/filter_param_matcher.rb', line 25 def "Expected #{@key} to be filtered" end |
#matches?(controller) ⇒ Boolean
20 21 22 23 |
# File 'lib/shoulda/action_controller/matchers/filter_param_matcher.rb', line 20 def matches?(controller) @controller = controller filters_params? && filters_key? end |
#negative_failure_message ⇒ Object
29 30 31 |
# File 'lib/shoulda/action_controller/matchers/filter_param_matcher.rb', line 29 def "Did not expect #{@key} to be filtered" end |