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

Make it easier/possible to test REST API-initiated calls #12

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

pgib
Copy link
Contributor

@pgib pgib commented Jun 7, 2014

Calls originating from the Twilio REST API include a Called parameter. (It seems the same as To, but it's only there in that sort of call.) The Direction is also outbound-api, and so we can now run tests that include both of these parameters:

ttt_call('/path', '+16045551234', '+16045556789', :called => '+16045556789', :direction => 'outbound-api')

It's also now possible to pass in a different :call_status in order to test on changes there.

pgib added 9 commits June 6, 2014 17:37
…ST API, we should be able to see the Direction and Called parameters coming through. :called and :direction have been added as recognized options for ttt_call.
…the `method` attribute are `GET` and `POST`; however, if you generate TwiML with these exact strings, like:

    Twilio::TwiML::Response.new do |r|
      r.Dial :method => 'GET', :action => '...'

 you'll end up with the following error when testing:

    undefined method `GET' for #<Capybara::RackTest::Driver:0x007fc95e819758>

While you could go and rewrite everything to be :method => 'get', we'll just make things easier on ourselves by catching this before we send it to the Capybara driver.
…l! Some were lost in CallInProgress (i.e. :call_status).
@pgib
Copy link
Contributor Author

pgib commented Nov 9, 2014

Any chance this could be looked at to be incorporated?

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

Successfully merging this pull request may close these issues.

1 participant