spec/pushpop-twilio_spec.rb in pushpop-twilio-0.1.1 vs spec/pushpop-twilio_spec.rb in pushpop-twilio-0.1.2
- old
+ new
@@ -41,38 +41,31 @@
step = Pushpop::Twilio.new do
to '+18555555555'
from '+18555555556'
end
step.configure
- step.stub(:send_message).and_return(5)
- expect {
- step.run(365)
- }.to raise_error /Please configure/
+ expect(step).not_to receive(:send_message)
+ step.run(365)
end
it 'should not send a message if to not specified' do
step = Pushpop::Twilio.new do |response|
from '+18555555556'
body "The response is #{response}"
end
step.configure
- step.stub(:send_message).and_return(5)
- expect {
- step.run(365)
- }.to raise_error /Please configure/
-
+ expect(step).not_to receive(:send_message)
+ step.run(365)
end
it 'should not send a message if from not specified' do
step = Pushpop::Twilio.new do |response|
to '+18555555556'
body "The response is #{response}"
end
step.configure
- step.stub(:send_message).and_return(5)
- expect {
- step.run(365)
- }.to raise_error /Please configure/
+ expect(step).not_to receive(:send_message)
+ step.run(365)
end
end
end