group_update_view_test.js 665 B

12345678910111213141516
  1. describe('GroupUpdateView', function() {
  2. it('should show new group members', function() {
  3. var view = new Whisper.GroupUpdateView({model: {joined: ['Alice', 'Bob']}}).render();
  4. assert.match(view.$el.text(), /Alice.*Bob.*joined the group/);
  5. });
  6. it('should note updates to the title', function() {
  7. var view = new Whisper.GroupUpdateView({model: {name: 'New name'}}).render();
  8. assert.match(view.$el.text(), /Title is now 'New name'/);
  9. });
  10. it('should say "Updated the group"', function() {
  11. var view = new Whisper.GroupUpdateView({model: {avatar: 'New avatar'}}).render();
  12. assert.match(view.$el.text(), /Updated the group/);
  13. });
  14. });