Closed tadast closed 10 years ago
It definitely needs some kind of test, even if it's just a basic one that fail if someone changes this string. Please add that and then I can merge the request (probably won't be able to until Tuesday as I'm out of town).
I like the idea of customizing this as well; I think it would make it more generally useful.
@JMongol I added some tests that are a bit RSpec-magic-heavy :) Not sure if there is a better way to test this. I also added an optional options
parameter that allows to customize some parameters when following redirects.
bump :)
Sorry for the delay on this - I added a few code comments. Can you clarify these?
I've reverted the whitespace changes. There are a lot of trailing whitespaces in the project, do you want me to submit a separate pull request to remove them?
If you like you can submit another request for the whitespaces, but I'm not terribly worried about it. I actually don't see any extra ones, although it might be because I just got a new version of TextMate and haven't found the place to turn it on. :D
I'll merge this and publish the new bits shortly.
Twilio always passes CallStatus parameter when following redirects. I added it too. Didn't find a good place to test it, I think it would involve interrogating Capybara a lot. It would also be nice to customize this option in follow_redirect e.g. if there is a
Play
followed by aRedirect
twilio will still follow the redirect if the person hangs up, but the CallStatus will be "completed" instead of "in-progress". Let me know if you want me to add this.