diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js
index 1c4c62a5..95790af0 100644
--- a/js/views/conversation_view.js
+++ b/js/views/conversation_view.js
@@ -12,6 +12,7 @@ var Whisper = Whisper || {};
this.$el.html(Mustache.render(this.template));
this.view = new Whisper.MessageListView({collection: this.model.messages()});
+ this.model.messages().fetch({reset: true});
this.$el.find('.discussion-container').append(this.view.el);
},
events: {
diff --git a/js/views/list_view.js b/js/views/list_view.js
index 3a39de7b..6d9444cb 100644
--- a/js/views/list_view.js
+++ b/js/views/list_view.js
@@ -9,12 +9,12 @@ var Whisper = Whisper || {};
*/
Whisper.ListView = Backbone.View.extend({
tagName: 'ul',
+ itemView: Backbone.View,
initialize: function() {
this.listenTo(this.collection, 'change', this.render); // auto update
this.listenTo(this.collection, 'add', this.addOne);
this.listenTo(this.collection, 'reset', this.addAll);
this.listenTo(this.collection, 'all', this.render);
- this.collection.fetch({reset: true});
},
addOne: function(model) {
@@ -27,10 +27,6 @@ var Whisper = Whisper || {};
addAll: function() {
this.$el.html('');
this.collection.each(this.addOne, this);
- },
-
- last: function() {
- this.collection.at(this.collection.length - 1);
}
});
})();
diff --git a/test/test.js b/test/test.js
new file mode 100644
index 00000000..593c764b
--- /dev/null
+++ b/test/test.js
@@ -0,0 +1,2 @@
+mocha.setup("bdd");
+window.assert = chai.assert;
diff --git a/test/test_views.html b/test/test_views.html
index a156511d..b86579e2 100644
--- a/test/test_views.html
+++ b/test/test_views.html
@@ -126,26 +126,32 @@
-
+
-
+
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+