Test message.*ImageUrl methods.
FREEBIE
This commit is contained in:
parent
27dc620566
commit
e07e3a53c9
1 changed files with 19 additions and 0 deletions
|
@ -18,10 +18,29 @@
|
|||
attachments: [],
|
||||
received_at: new Date().getTime() };
|
||||
|
||||
var attachment = { data: 'datasaurus',
|
||||
contentType: 'plain/text' };
|
||||
|
||||
describe('MessageCollection', function() {
|
||||
before(clear);
|
||||
after(clear);
|
||||
|
||||
it('has no image url', function() {
|
||||
var messages = new Whisper.MessageCollection();
|
||||
var message = messages.add(attributes);
|
||||
assert.isNull(message.getImageUrl());
|
||||
});
|
||||
|
||||
it('updates image url', function() {
|
||||
var messages = new Whisper.MessageCollection();
|
||||
var message = messages.add({ attachments: [attachment] });
|
||||
|
||||
var firstUrl = message.getImageUrl();
|
||||
message.updateImageUrl();
|
||||
var secondUrl = message.getImageUrl();
|
||||
assert.notEqual(secondUrl, firstUrl);
|
||||
});
|
||||
|
||||
it('adds without saving', function() {
|
||||
var messages = new Whisper.MessageCollection();
|
||||
var message = messages.add(attributes);
|
||||
|
|
Loading…
Reference in a new issue