lib/fdoc/endpoint.rb in fdoc-0.2.7 vs lib/fdoc/endpoint.rb in fdoc-0.3.0

- old
+ new

@@ -20,11 +20,15 @@ end end def consume_response(params, status_code, successful=true) response_code = response_codes.find do |rc| - rc["status"] == status_code && rc["successful"] == successful + rc["successful"] == successful && ( + rc["status"] == status_code || # 200 + rc["status"].to_i == status_code # "200 OK" + ) end + if !response_code raise Fdoc::UndocumentedResponseCode, 'Undocumented response: %s, successful: %s' % [ status_code, successful