Created
June 26, 2011 19:38
-
-
Save roykolak/1047902 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('../lib/sender'); | |
describe('Sender', function() { | |
var sender, client, number; | |
beforeEach(function() { | |
number = '805-769-8255'; | |
client = {sendSms: jasmine.createSpy()}; | |
sender = new Sender(client); | |
spyOn(sender, 'send').andCallThrough(); | |
}); | |
describe('#send', function() { | |
it('calls the client with the number and message', function() { | |
var message = 'hello'; | |
sender.send(number, message); | |
expect(client.sendSms).toHaveBeenCalledWith(number, message, null, jasmine.any(Function)); | |
}); | |
}); | |
describe('#emptyQueueSms', function() { | |
it('sends the "empty queue" SMS to the number passed', function() { | |
sender.emptyQueueSms(number); | |
expect(sender.send).toHaveBeenCalledWith(number, sender.messages.emptyQueue); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment