Object
@private
# File lib/shoulda/matchers/action_controller/respond_with_matcher.rb, line 112 def description "respond with #{@status}" end
# File lib/shoulda/matchers/action_controller/respond_with_matcher.rb, line 102 def failure_message "Expected #{expectation}" end
# File lib/shoulda/matchers/action_controller/respond_with_matcher.rb, line 107 def failure_message_when_negated "Did not expect #{expectation}" end
# File lib/shoulda/matchers/action_controller/respond_with_matcher.rb, line 118 def correct_status_code? response_code == @status end
# File lib/shoulda/matchers/action_controller/respond_with_matcher.rb, line 122 def correct_status_code_range? @status.is_a?(Range) && @status.include?(response_code) end
# File lib/shoulda/matchers/action_controller/respond_with_matcher.rb, line 148 def expectation "response to be a #{@status}, but was #{response_code}" end
# File lib/shoulda/matchers/action_controller/respond_with_matcher.rb, line 127 def response_code @controller.response.response_code end
# File lib/shoulda/matchers/action_controller/respond_with_matcher.rb, line 131 def symbol_to_status_code(potential_symbol) case potential_symbol when :success then 200 when :redirect then 300..399 when :missing then 404 when :error then 500..599 when Symbol if defined?(::Rack::Utils::SYMBOL_TO_STATUS_CODE) ::Rack::Utils::SYMBOL_TO_STATUS_CODE[potential_symbol] else ::ActionController::Base::SYMBOL_TO_STATUS_CODE[potential_symbol] end else potential_symbol end end
Generated with the Darkfish Rdoc Generator 2.