module ActionDispatch::Assertions::ResponseAssertions

def code_with_name(code_or_name)

def code_with_name(code_or_name)
  if RESPONSE_PREDICATES.values.include?("#{code_or_name}?".to_sym)
    code_or_name = RESPONSE_PREDICATES.invert["#{code_or_name}?".to_sym]
  end
  AssertionResponse.new(code_or_name).code_and_name
end