' +
'show comments (0)' +
'
' +
'' +
'/* Copyright (c) 2010, Diaspora Inc. This file is * licensed under the Affero General Public License version 3 or later. See * the COPYRIGHT file. */ describe("Stream", function() { describe("initialize", function() { it("attaches a click event to show_post_comments links", function() { spyOn($.fn, "delegate"); Stream.initialize(); expect($.fn.delegate).toHaveBeenCalledWith( "a.show_post_comments", "click", Stream.toggleComments); }); }); describe("toggleComments", function() { beforeEach(function() { $('#jasmine_content').html( '
' ); }); it("toggles class hidden on the comment block", function () { expect($('ul.comments')).toHaveClass("hidden"); $("a.show_post_comments").click(); setTimeout(function() { expect($('ul.comments')).not.toHaveClass("hidden"); }, 250); }); it("changes the text on the show comments link", function() { $("a.show_post_comments").click(); setTimeout(function() { expect($("a.show_post_comments").text()).toEqual("hide comments (0)"); }, 250); }) }); });