assert_response (ActionController::Assertions::ResponseAssertions)

    # File lib/action_controller/assertions/response_assertions.rb, line 27
          def assert_response(type, message = nil)
            clean_backtrace do
              if [ :success, :missing, :redirect, :error ].include?(type) && @response.send("#{type}?")
                assert_block("") { true } # to count the assertion
              elsif type.is_a?(Fixnum) && @response.response_code == type
                assert_block("") { true } # to count the assertion
              elsif type.is_a?(Symbol) && @response.response_code == ActionController::StatusCodes::SYMBOL_TO_STATUS_CODE[type]
                assert_block("") { true } # to count the assertion
              else
                if @response.error?
                  exception = @response.template.instance_variable_get(:@exception)
                  exception_message = exception && exception.message
                  assert_block(build_message(message, "Expected response to be a <?>, but was <?>\n<?>", type, @response.response_code, exception_message.to_s)) { false }
                else
                  assert_block(build_message(message, "Expected response to be a <?>, but was <?>", type, @response.response_code)) { false }
                end
              end
            end
          end