lib/mock/twilio/decorator.rb in mock-twilio-0.1.0 vs lib/mock/twilio/decorator.rb in mock-twilio-0.2.0

- old
+ new

@@ -9,12 +9,18 @@ } class << self def call(body, request) body = JSON.parse(body) + + case body["status"] + when 400..600 + return body + end + schema = url_from(body, request) - # return body decorataor if needed - return ENDPOINTS[schema].decorate(body) if schema + # return body decorate if needed + return ENDPOINTS[schema].decorate(body, request) if schema body end def url_from(body, request)