Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return value of "create" does not mimic twilo-ruby's return value #9

Open
Sporky023 opened this issue Jun 25, 2013 · 0 comments
Open

Comments

@Sporky023
Copy link

I have code like the following in my project:

response = @client.account.sms.messages.create(
  from: TWILIO_SMS_FROM_NUMBER,
  to: outgoing_message.to,
  body: outgoing_message.body
)

while response.status == 'queued'
  sleep 0.5
  response.refresh
end

if response.status == 'sent'
  outgoing_message.sent_at = Time.parse(response.date_sent)
end

This breaks when using SmsSpec because the return value of the new monkeypatched Twilio::REST::Client::Messages#create method is an array, not a response object as twilio-ruby normally provides.

The fix will be to create a twilio-ruby response object that mimics a successful send.

If I find time in the next couple of days I'll take a stab at this. Otherwise if you haven't seen anything from me by, say, June 29, 2013 then that means I forgot about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant