twilio-test-toolkit 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,6 +49,12 @@ module TwilioTestToolkit
49
49
  return false
50
50
  end
51
51
 
52
+ #Matches the specified action with action attribute on the dial element
53
+ def has_action_on_dial?(action)
54
+ action_on_dial = @xml.xpath("Dial").attribute("action")
55
+ !!action_on_dial && action_on_dial.value == action
56
+ end
57
+
52
58
  # Stuff for hangups
53
59
  def has_redirect?
54
60
  return !(@xml.at_xpath("Redirect").nil?)
@@ -1,3 +1,3 @@
1
1
  module TwilioTestToolkit
2
- VERSION = "3.1.0"
2
+ VERSION = "3.2.0"
3
3
  end
@@ -0,0 +1,3 @@
1
+ <Dial action="http://example.org:3000/call_me_back">
2
+ 18001234567
3
+ </Dial>
@@ -0,0 +1,3 @@
1
+ <Dial>
2
+ 18001234567
3
+ </Dial>
@@ -3,10 +3,10 @@ Dummy::Application.routes.draw do
3
3
  get "test_start", :on => :collection
4
4
  post "test_start", :on => :collection
5
5
  post "test_action", :on => :collection
6
-
7
6
  post "test_gather_finish_on_asterisk", :on => :collection
8
7
  post "test_hangup", :on => :collection
9
- post "test_dial", :on => :collection
8
+ post "test_dial_with_no_action", :on => :collection
9
+ post "test_dial_with_action", :on => :collection
10
10
  post "test_redirect", :on => :collection
11
11
  post "test_say", :on => :collection
12
12
  post "test_play", :on => :collection
@@ -1742,3 +1742,217 @@ Started GET "/twilio/test_start?format=xml&CallSid=1234567&From=2065551212&Digit
1742
1742
  Processing by TwilioController#test_start as XML
1743
1743
  Parameters: {"CallSid"=>"1234567", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"machine"}
1744
1744
  Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1745
+ Connecting to database specified by database.yml
1746
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1747
+ Processing by TwilioController#test_start as XML
1748
+ Parameters: {"CallSid"=>"8e3e2397-3ca5-48d7-b5fa-eceee4b7cecf", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1749
+ Rendered twilio/test_start.xml.erb within layouts/twilio.layout (3.1ms)
1750
+ Completed 200 OK in 34ms (Views: 33.9ms | ActiveRecord: 0.0ms)
1751
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1752
+ Processing by TwilioController#test_start as XML
1753
+ Parameters: {"CallSid"=>"4ea55118-c7b7-4e25-a2c3-82f48bb5cc6a", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1754
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
1755
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1756
+ Processing by TwilioController#test_start as XML
1757
+ Parameters: {"CallSid"=>"66fc5369-e315-4733-86fd-baaa89b589d3", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1758
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
1759
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1760
+ Processing by TwilioController#test_start as XML
1761
+ Parameters: {"CallSid"=>"9e193433-9e91-4d9b-914a-999f1232aa49", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1762
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1763
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1764
+ Processing by TwilioController#test_start as XML
1765
+ Parameters: {"CallSid"=>"49b9396c-9ea9-4ea1-9b54-d02295ca2ba4", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1766
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1767
+ Started POST "/twilio/test_redirect" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1768
+ Processing by TwilioController#test_redirect as XML
1769
+ Parameters: {"CallSid"=>"78aeed47-33be-4bc9-9083-3a2bbb7e34a8", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1770
+ Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)
1771
+ Started POST "/twilio/test_redirect" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1772
+ Processing by TwilioController#test_redirect as XML
1773
+ Parameters: {"CallSid"=>"1bbda9d4-1942-41b6-9834-76be981c953a", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1774
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1775
+ Started POST "/twilio/test_redirect" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1776
+ Processing by TwilioController#test_redirect as XML
1777
+ Parameters: {"CallSid"=>"475e2c22-fd0c-446f-918d-1b93a812d27a", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1778
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1779
+ Started POST "/twilio/test_redirect" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1780
+ Processing by TwilioController#test_redirect as XML
1781
+ Parameters: {"CallSid"=>"e2f73a8a-59fa-43b5-bdcb-1493b62ad27d", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1782
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1783
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1784
+ Processing by TwilioController#test_start as XML
1785
+ Parameters: {"CallSid"=>"e2f73a8a-59fa-43b5-bdcb-1493b62ad27d", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1786
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1787
+ Started POST "/twilio/test_redirect" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1788
+ Processing by TwilioController#test_redirect as XML
1789
+ Parameters: {"CallSid"=>"84e7247e-5488-4c21-b69d-504417c13e3d", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1790
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1791
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1792
+ Processing by TwilioController#test_start as XML
1793
+ Parameters: {"CallSid"=>"84e7247e-5488-4c21-b69d-504417c13e3d", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1794
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1795
+ Started POST "/twilio/test_say" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1796
+ Processing by TwilioController#test_say as XML
1797
+ Parameters: {"CallSid"=>"470724f3-8871-4e9f-8226-5472637174b3", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1798
+ Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)
1799
+ Started POST "/twilio/test_say" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1800
+ Processing by TwilioController#test_say as XML
1801
+ Parameters: {"CallSid"=>"3e7bf3eb-3975-48d5-9529-368d9fb4489c", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1802
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1803
+ Started POST "/twilio/test_say" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1804
+ Processing by TwilioController#test_say as XML
1805
+ Parameters: {"CallSid"=>"82bcf0d5-8be7-49f9-9538-89c78c252bde", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1806
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1807
+ Started POST "/twilio/test_say" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1808
+ Processing by TwilioController#test_say as XML
1809
+ Parameters: {"CallSid"=>"881094ff-aa57-4248-b795-f652de3e2f06", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1810
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1811
+ Started POST "/twilio/test_say" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1812
+ Processing by TwilioController#test_say as XML
1813
+ Parameters: {"CallSid"=>"d31190a8-33c1-4ead-88e3-921c018fc996", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1814
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1815
+ Started POST "/twilio/test_say" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1816
+ Processing by TwilioController#test_say as XML
1817
+ Parameters: {"CallSid"=>"f48d442c-90cc-4ff0-b079-620676babe3c", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1818
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1819
+ Started POST "/twilio/test_play" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1820
+ Processing by TwilioController#test_play as XML
1821
+ Parameters: {"CallSid"=>"035c3906-50d7-455d-ba03-5dc4c7598879", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1822
+ Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)
1823
+ Started POST "/twilio/test_play" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1824
+ Processing by TwilioController#test_play as XML
1825
+ Parameters: {"CallSid"=>"8a40afc9-f928-407b-909e-4aa4ef653815", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1826
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1827
+ Started POST "/twilio/test_dial_with_action" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1828
+ Processing by TwilioController#test_dial_with_action as XML
1829
+ Parameters: {"CallSid"=>"6d62311a-894c-42af-8b1f-220036044fda", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1830
+ Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)
1831
+ Started POST "/twilio/test_dial_with_action" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1832
+ Processing by TwilioController#test_dial_with_action as XML
1833
+ Parameters: {"CallSid"=>"4e5974c0-516e-49b4-9474-858b3222f65b", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1834
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1835
+ Started POST "/twilio/test_dial_with_action" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1836
+ Processing by TwilioController#test_dial_with_action as XML
1837
+ Parameters: {"CallSid"=>"4161ba58-07ae-4b04-8ad8-3a23d393d6ef", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1838
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1839
+ Started POST "/twilio/test_dial_with_no_action" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1840
+ Processing by TwilioController#test_dial_with_no_action as XML
1841
+ Parameters: {"CallSid"=>"e914febc-82a8-4c01-ba41-69af139a7c0d", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1842
+ Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)
1843
+ Started POST "/twilio/test_dial_with_action" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1844
+ Processing by TwilioController#test_dial_with_action as XML
1845
+ Parameters: {"CallSid"=>"66374e12-c8eb-4f05-a3e0-1b03b45d9b7e", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1846
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1847
+ Started POST "/twilio/test_dial_with_action" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1848
+ Processing by TwilioController#test_dial_with_action as XML
1849
+ Parameters: {"CallSid"=>"09967e46-4166-41d7-87ca-305990d8fdec", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1850
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1851
+ Started POST "/twilio/test_hangup" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1852
+ Processing by TwilioController#test_hangup as XML
1853
+ Parameters: {"CallSid"=>"4685ef62-7b29-4eb3-ab6d-3eb90213854c", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1854
+ Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)
1855
+ Started POST "/twilio/test_hangup" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1856
+ Processing by TwilioController#test_hangup as XML
1857
+ Parameters: {"CallSid"=>"f847c44e-d741-43df-a58c-a4da13e30bbc", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1858
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1859
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1860
+ Processing by TwilioController#test_start as XML
1861
+ Parameters: {"CallSid"=>"1590edd9-0a3a-4f35-9a14-630759937498", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1862
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1863
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1864
+ Processing by TwilioController#test_start as XML
1865
+ Parameters: {"CallSid"=>"27078cf8-6257-4bbe-add4-0deffc23a38f", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1866
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1867
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1868
+ Processing by TwilioController#test_start as XML
1869
+ Parameters: {"CallSid"=>"aae11f63-66d2-419f-a07c-5c1106623ca5", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1870
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
1871
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1872
+ Processing by TwilioController#test_start as XML
1873
+ Parameters: {"CallSid"=>"b1723dc8-c836-47fc-a063-1ed6475172a3", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1874
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1875
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1876
+ Processing by TwilioController#test_start as XML
1877
+ Parameters: {"CallSid"=>"7fd0ea3d-1b06-47a6-96b6-2de7dc1aef22", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1878
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1879
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1880
+ Processing by TwilioController#test_start as XML
1881
+ Parameters: {"CallSid"=>"fa05c127-3746-48ae-9e84-904f5cffc001", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1882
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1883
+ Started POST "/twilio/test_action" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1884
+ Processing by TwilioController#test_action as XML
1885
+ Parameters: {"CallSid"=>"fa05c127-3746-48ae-9e84-904f5cffc001", "From"=>"2065551212", "Digits"=>"98765", "To"=>"2065553434", "AnsweredBy"=>"human"}
1886
+ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
1887
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1888
+ Processing by TwilioController#test_start as XML
1889
+ Parameters: {"CallSid"=>"af48f9bb-20dd-4e73-a478-902dea137a6a", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1890
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1891
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1892
+ Processing by TwilioController#test_start as XML
1893
+ Parameters: {"CallSid"=>"a0943ecf-a89d-4650-86b3-9b067ffc87ae", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1894
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1895
+ Started POST "/twilio/test_action" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1896
+ Processing by TwilioController#test_action as XML
1897
+ Parameters: {"CallSid"=>"a0943ecf-a89d-4650-86b3-9b067ffc87ae", "From"=>"2065551212", "Digits"=>"98765", "To"=>"2065553434", "AnsweredBy"=>"human"}
1898
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1899
+ Started POST "/twilio/test_gather_finish_on_asterisk" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1900
+ Processing by TwilioController#test_gather_finish_on_asterisk as XML
1901
+ Parameters: {"CallSid"=>"b4c1948c-3fcc-4bff-bdd5-3dd75c93a963", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1902
+ Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)
1903
+ Started POST "/twilio/test_action" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1904
+ Processing by TwilioController#test_action as XML
1905
+ Parameters: {"CallSid"=>"b4c1948c-3fcc-4bff-bdd5-3dd75c93a963", "From"=>"2065551212", "Digits"=>"98765", "To"=>"2065553434", "AnsweredBy"=>"human"}
1906
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1907
+ Started POST "/twilio/test_gather_finish_on_asterisk" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1908
+ Processing by TwilioController#test_gather_finish_on_asterisk as XML
1909
+ Parameters: {"CallSid"=>"09f93971-1eae-4c37-aedb-3dbd1c2e5e1a", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1910
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1911
+ Started POST "/twilio/test_action" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1912
+ Processing by TwilioController#test_action as XML
1913
+ Parameters: {"CallSid"=>"09f93971-1eae-4c37-aedb-3dbd1c2e5e1a", "From"=>"2065551212", "Digits"=>"98765", "To"=>"2065553434", "AnsweredBy"=>"human"}
1914
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1915
+ Started POST "/twilio/test_say" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1916
+ Processing by TwilioController#test_say as XML
1917
+ Parameters: {"CallSid"=>"db83ad85-ce1b-4f0c-922c-52404d339e46", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1918
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1919
+ Started POST "/twilio/test_say" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1920
+ Processing by TwilioController#test_say as XML
1921
+ Parameters: {"CallSid"=>"95dc6fca-03e7-4a08-83ad-8fa1a617b6fd", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1922
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1923
+ Started POST "/twilio/test_say" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1924
+ Processing by TwilioController#test_say as XML
1925
+ Parameters: {"CallSid"=>"2c8ea44a-d3e2-4a69-8837-4fe25cf5c742", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1926
+ Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
1927
+ Started POST "/twilio/test_say" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1928
+ Processing by TwilioController#test_say as XML
1929
+ Parameters: {"CallSid"=>"7a1c452e-5f17-4f84-9a43-aa4927a2336a", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1930
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1931
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1932
+ Processing by TwilioController#test_start as XML
1933
+ Parameters: {"CallSid"=>"2924db81-b913-45d0-a897-de14b13755e6", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1934
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1935
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1936
+ Processing by TwilioController#test_start as XML
1937
+ Parameters: {"CallSid"=>"bb4bd8ad-875c-4978-9bf7-967c81dcb460", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1938
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1939
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1940
+ Processing by TwilioController#test_start as XML
1941
+ Parameters: {"CallSid"=>"015abf00-9795-44de-86c7-27495c4cec41", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1942
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1943
+ Started POST "/twilio/test_start" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1944
+ Processing by TwilioController#test_start as XML
1945
+ Parameters: {"CallSid"=>"11509894-72b9-477c-9d05-37468a03fd2b", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"human"}
1946
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1947
+ Started GET "/twilio/test_start?format=xml&CallSid=1234567&From=2065551212&Digits=&To=2065553434&AnsweredBy=machine" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1948
+ Processing by TwilioController#test_start as XML
1949
+ Parameters: {"CallSid"=>"1234567", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"machine"}
1950
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1951
+ Started GET "/twilio/test_start?format=xml&CallSid=1234567&From=2065551212&Digits=&To=2065553434&AnsweredBy=machine" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1952
+ Processing by TwilioController#test_start as XML
1953
+ Parameters: {"CallSid"=>"1234567", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"machine"}
1954
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
1955
+ Started GET "/twilio/test_start?format=xml&CallSid=1234567&From=2065551212&Digits=&To=2065553434&AnsweredBy=machine" for 127.0.0.1 at 2013-06-18 08:45:54 -0700
1956
+ Processing by TwilioController#test_start as XML
1957
+ Parameters: {"CallSid"=>"1234567", "From"=>"2065551212", "Digits"=>"", "To"=>"2065553434", "AnsweredBy"=>"machine"}
1958
+ Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)
@@ -142,7 +142,7 @@ describe TwilioTestToolkit::CallScope do
142
142
 
143
143
  describe "dial" do
144
144
  before(:each) do
145
- @call = ttt_call(test_dial_twilio_index_path, @our_number, @their_number)
145
+ @call = ttt_call(test_dial_with_action_twilio_index_path, @our_number, @their_number)
146
146
  end
147
147
 
148
148
  it "should have the expected dial methods" do
@@ -154,8 +154,22 @@ describe TwilioTestToolkit::CallScope do
154
154
  @call.has_dial?("18001234567").should be_true
155
155
  @call.has_dial?("12345").should be_true # Partial match
156
156
  end
157
+
158
+ it "should not match the dial action if there isn't one" do
159
+ @call = ttt_call(test_dial_with_no_action_twilio_index_path, @our_number, @their_number)
160
+
161
+ @call.has_action_on_dial?("http://example.org:3000/call_me_back").should eq false
162
+ end
163
+
164
+ it "should match the action on dial if there is one" do
165
+ @call.has_action_on_dial?("http://example.org:3000/call_me_back").should be_true
166
+ end
167
+
168
+ it "should not match the action on dial if it's different than the one specified" do
169
+ @call.has_action_on_dial?("http://example.org:3000/dont_call").should be_false
170
+ end
157
171
  end
158
-
172
+
159
173
  describe "hangup" do
160
174
  describe "success" do
161
175
  before(:each) do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twilio-test-toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-13 00:00:00.000000000 Z
12
+ date: 2013-06-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capybara
@@ -162,7 +162,8 @@ files:
162
162
  - spec/dummy/app/views/layouts/application.html.erb
163
163
  - spec/dummy/app/views/layouts/twilio.layout.xml.erb
164
164
  - spec/dummy/app/views/twilio/test_action.xml.erb
165
- - spec/dummy/app/views/twilio/test_dial.xml.erb
165
+ - spec/dummy/app/views/twilio/test_dial_with_action.xml.erb
166
+ - spec/dummy/app/views/twilio/test_dial_with_no_action.xml.erb
166
167
  - spec/dummy/app/views/twilio/test_gather_finish_on_asterisk.xml.erb
167
168
  - spec/dummy/app/views/twilio/test_hangup.xml.erb
168
169
  - spec/dummy/app/views/twilio/test_play.xml.erb
@@ -232,7 +233,8 @@ test_files:
232
233
  - spec/dummy/app/views/layouts/application.html.erb
233
234
  - spec/dummy/app/views/layouts/twilio.layout.xml.erb
234
235
  - spec/dummy/app/views/twilio/test_action.xml.erb
235
- - spec/dummy/app/views/twilio/test_dial.xml.erb
236
+ - spec/dummy/app/views/twilio/test_dial_with_action.xml.erb
237
+ - spec/dummy/app/views/twilio/test_dial_with_no_action.xml.erb
236
238
  - spec/dummy/app/views/twilio/test_gather_finish_on_asterisk.xml.erb
237
239
  - spec/dummy/app/views/twilio/test_hangup.xml.erb
238
240
  - spec/dummy/app/views/twilio/test_play.xml.erb
@@ -1 +0,0 @@
1
- <Dial>18001234567</Dial>