fix likes spec

This commit is contained in:
Florian Staudacher 2014-02-17 23:32:09 +01:00
parent b27edcb2d1
commit e3b22ed95c
3 changed files with 4 additions and 4 deletions

View file

@ -9,7 +9,7 @@ app.views.LikesInfo = app.views.Base.extend({
tooltipSelector : ".avatar", tooltipSelector : ".avatar",
initialize : function() { initialize : function() {
this.model.interactions.bind('change', this.render, this) this.model.interactions.bind('change', this.render, this);
}, },
presenter : function() { presenter : function() {

View file

@ -90,7 +90,7 @@ describe("app.views.Header", function() {
describe("blur", function() { describe("blur", function() {
it("removes the class 'active' when the user blurs the text field", function() { it("removes the class 'active' when the user blurs the text field", function() {
input.focus().blur(); input.trigger('focus').trigger('blur');
expect(input).not.toHaveClass("active"); expect(input).not.toHaveClass("active");
}); });
}); });

View file

@ -58,13 +58,13 @@ describe("app.views.StreamPost", function(){
context("likes", function(){ context("likes", function(){
it("displays a like count", function(){ it("displays a like count", function(){
this.statusMessage.set({likes_count : 1}) this.statusMessage.interactions.set({likes_count : 1})
var view = new this.PostViewClass({model : this.statusMessage}).render(); var view = new this.PostViewClass({model : this.statusMessage}).render();
expect($(view.el).html()).toContain(Diaspora.I18n.t('stream.likes', {count: 1})) expect($(view.el).html()).toContain(Diaspora.I18n.t('stream.likes', {count: 1}))
}) })
it("does not display a like count for 'zero'", function(){ it("does not display a like count for 'zero'", function(){
this.statusMessage.set({likes_count : 0}) this.statusMessage.interactions.set({likes_count : 0})
var view = new this.PostViewClass({model : this.statusMessage}).render(); var view = new this.PostViewClass({model : this.statusMessage}).render();
expect($(view.el).html()).not.toContain("0 Likes") expect($(view.el).html()).not.toContain("0 Likes")