Class: Shoulda::Matchers::ActionController::RespondWithMatcher
- Inherits:
-
Object
- Object
- Shoulda::Matchers::ActionController::RespondWithMatcher
- Defined in:
- lib/shoulda/matchers/action_controller/respond_with_matcher.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(status) ⇒ RespondWithMatcher
constructor
A new instance of RespondWithMatcher.
- #matches?(controller) ⇒ Boolean
Constructor Details
#initialize(status) ⇒ RespondWithMatcher
Returns a new instance of RespondWithMatcher.
93 94 95 |
# File 'lib/shoulda/matchers/action_controller/respond_with_matcher.rb', line 93 def initialize(status) @status = symbol_to_status_code(status) end |
Instance Method Details
#description ⇒ Object
110 111 112 |
# File 'lib/shoulda/matchers/action_controller/respond_with_matcher.rb', line 110 def description "respond with #{@status}" end |
#failure_message ⇒ Object
102 103 104 |
# File 'lib/shoulda/matchers/action_controller/respond_with_matcher.rb', line 102 def "Expected #{expectation}" end |
#failure_message_when_negated ⇒ Object
106 107 108 |
# File 'lib/shoulda/matchers/action_controller/respond_with_matcher.rb', line 106 def "Did not expect #{expectation}" end |
#matches?(controller) ⇒ Boolean
97 98 99 100 |
# File 'lib/shoulda/matchers/action_controller/respond_with_matcher.rb', line 97 def matches?(controller) @controller = controller correct_status_code? || correct_status_code_range? end |