Class: Shoulda::Matchers::ActionController::FilterParamMatcher
- Inherits:
-
Object
- Object
- Shoulda::Matchers::ActionController::FilterParamMatcher
- Defined in:
- lib/shoulda/matchers/action_controller/filter_param_matcher.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(key) ⇒ FilterParamMatcher
constructor
A new instance of FilterParamMatcher.
- #matches?(_controller) ⇒ Boolean
Constructor Details
#initialize(key) ⇒ FilterParamMatcher
Returns a new instance of FilterParamMatcher.
30 31 32 |
# File 'lib/shoulda/matchers/action_controller/filter_param_matcher.rb', line 30 def initialize(key) @key = key end |
Instance Method Details
#description ⇒ Object
47 48 49 |
# File 'lib/shoulda/matchers/action_controller/filter_param_matcher.rb', line 47 def description "filter #{@key}" end |
#failure_message ⇒ Object
38 39 40 41 |
# File 'lib/shoulda/matchers/action_controller/filter_param_matcher.rb', line 38 def "Expected #{@key} to be filtered; filtered keys:"\ " #{filtered_keys.join(', ')}" end |
#failure_message_when_negated ⇒ Object
43 44 45 |
# File 'lib/shoulda/matchers/action_controller/filter_param_matcher.rb', line 43 def "Did not expect #{@key} to be filtered" end |
#matches?(_controller) ⇒ Boolean
34 35 36 |
# File 'lib/shoulda/matchers/action_controller/filter_param_matcher.rb', line 34 def matches?(_controller) filters_key? end |