update twilio agent spec to ensure proper twilio rest api calls are made

This commit is contained in:
Albert Sun 2016-04-09 10:49:00 -04:00
parent 97d7c799bb
commit 11363b4b03

View file

@ -20,8 +20,8 @@ describe Agents::TwilioAgent do
@event.save!
@sent_messages = []
stub.any_instance_of(Agents::TwilioAgent).send_message { |message| @sent_messages << message}
stub.any_instance_of(Agents::TwilioAgent).make_call {}
stub.any_instance_of(Twilio::REST::Messages).create { |message| @sent_messages << message[:body]}
stub.any_instance_of(Twilio::REST::Calls).create
end
describe '#receive' do
@ -51,7 +51,6 @@ describe Agents::TwilioAgent do
@checker.receive([@event])
expect(@checker.memory[:pending_calls]).not_to eq({})
end
end
describe '#working?' do