spec/twilio/verb_spec.rb in twilio-3.1.0 vs spec/twilio/verb_spec.rb in twilio-3.1.1
- old
+ new
@@ -1,9 +1,9 @@
require 'spec_helper'
describe "Verb" do
-
+
context "Say" do
it "says 'hi'" do
Twilio::Verb.say('hi').should match %r{<Say( loop="1"| language="en"| voice="man"){3}>hi</Say>}
end
@@ -26,22 +26,22 @@
it "says 'hi' with pause and say 'bye'" do
verb = Twilio::Verb.new { |v|
v.say 'hi', :loop => 1
v.pause
v.say 'bye'
- }.response.should match %r{<Say( loop="1"| language="en"| voice="man"){3}>hi</Say><Pause></Pause><Say( loop="1"| language="en"| voice="man"){3}>bye</Say>}
+ }.response.should match %r{<Say( loop="1"| language="en"| voice="man"){3}>hi</Say><Pause/><Say( loop="1"| language="en"| voice="man"){3}>bye</Say>}
end
it "says 'hi' with 2 second pause and say 'bye'" do
verb = Twilio::Verb.new { |v|
v.say 'hi'
v.pause :length => 2
v.say 'bye'
}.response.should match %r{<Say( loop="1"| language="en"| voice="man"){3}>hi</Say><Pause length="2"/><Say( loop="1"| language="en"| voice="man"){3}>bye</Say>}
- end
+ end
end
-
+
context "Play" do
it "plays mp3 response" do
Twilio::Verb.play('http://foo.com/cowbell.mp3').should == verb_response(:play_mp3)
end
@@ -51,11 +51,11 @@
it "plays mp3 response two times with pause" do
Twilio::Verb.play('http://foo.com/cowbell.mp3', :loop => 2, :pause => true).should == verb_response(:play_mp3_two_times_with_pause)
end
end
-
+
context "Gather" do
it "gathers" do
Twilio::Verb.gather.should == verb_response(:gather)
end
@@ -208,11 +208,11 @@
v.conference 'MyRoom', :mute => :true
}
}.response.should == verb_response(:dial_muted_conference)
end
end
-
+
context "Hang Up" do
it "hangs up" do
Twilio::Verb.hangup.should == verb_response(:hangup)
end
@@ -221,11 +221,11 @@
v.say 'hi'
v.hangup
}.response.should match %r{<Say( loop="1"| language="en"| voice="man"){3}>hi</Say><Hangup/>}
end
end
-
+
context "Reject" do
it "rejects" do
Twilio::Verb.reject.should == verb_response(:reject)
end
@@ -239,10 +239,10 @@
verb = Twilio::Verb.new { |v|
v.reject :reason => 'busy'
}.response.should match %r{<Reject reason="busy"/>}
end
end
-
+
context "SMS" do
it "sends a simple SMS message" do
verb = Twilio::Verb.new { |v|
v.sms 'Join us at the bar', :to => "8005554321", :from => "9006661111", :action => "/smsService", :method => "GET"
}.response.should match %r{<Sms( to="8005554321"| from="9006661111"| action="/smsService"| method="GET"){4}>Join us at the bar</Sms>}