Add regression test for #270

// FREEBIE
This commit is contained in:
lilia 2015-11-08 11:01:39 -08:00
parent f0dcf44b9f
commit 717108d17f

View file

@ -38,6 +38,12 @@ describe('MessageView', function() {
view.render();
assert.match(view.$el.html(), /hour ago/);
});
it('should not imply messages are from the future', function() {
var view = new Whisper.MessageView({model: message});
message.set({'sent_at': Date.now() + 60000});
view.render();
assert.match(view.$el.html(), /seconds ago/);
});
it('should go away when the model is destroyed', function() {
var view = new Whisper.MessageView({model: message});