Class: Shoulda::ActionController::Matchers::RespondWithMatcher
- Inherits:
-
Object
- Object
- Shoulda::ActionController::Matchers::RespondWithMatcher
- Defined in:
- lib/shoulda/action_controller/matchers/respond_with_matcher.rb
Overview
:nodoc:
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(status) ⇒ RespondWithMatcher
constructor
A new instance of RespondWithMatcher.
- #matches?(controller) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(status) ⇒ RespondWithMatcher
Returns a new instance of RespondWithMatcher.
24 25 26 |
# File 'lib/shoulda/action_controller/matchers/respond_with_matcher.rb', line 24 def initialize(status) @status = symbol_to_status_code(status) end |
Instance Method Details
#description ⇒ Object
41 42 43 |
# File 'lib/shoulda/action_controller/matchers/respond_with_matcher.rb', line 41 def description "respond with #{@status}" end |
#failure_message ⇒ Object
33 34 35 |
# File 'lib/shoulda/action_controller/matchers/respond_with_matcher.rb', line 33 def "Expected #{expectation}" end |
#matches?(controller) ⇒ Boolean
28 29 30 31 |
# File 'lib/shoulda/action_controller/matchers/respond_with_matcher.rb', line 28 def matches?(controller) @controller = controller correct_status_code? || correct_status_code_range? end |
#negative_failure_message ⇒ Object
37 38 39 |
# File 'lib/shoulda/action_controller/matchers/respond_with_matcher.rb', line 37 def "Did not expect #{expectation}" end |