spec/twilio/verb_spec.rb in twilio-3.0.1 vs spec/twilio/verb_spec.rb in twilio-3.1.0
- old
+ new
@@ -222,14 +222,32 @@
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
+
+ it "just rejects incoming call" do
+ verb = Twilio::Verb.new { |v|
+ v.reject
+ }.response.should match %r{<Reject/>}
+ end
+
+ it "just rejects incoming call with 'busy' status" do
+ 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>}
end
end
-end
\ No newline at end of file
+end