diaspora/spec/javascripts/content-updater-spec.js
MrZYX 73c96ea8f0 Revert "Clean up WSR, add comment processing to ContentUpdater, add comment fixture, update post processing spec"
This reverts commit bd74ab4acc.

This reproducable breaks functionallity (comments). Please do not push WIP/not working stuff to master. To continue work just revert this revert. Thanks
2011-05-11 11:51:51 +02:00

34 lines
1.3 KiB
JavaScript

/* Copyright (c) 2010, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
describe("ContentUpdater", function() {
describe("addPostToStream", function() {
beforeEach(function() {
$("#jasmine_content").empty();
spec.loadFixture("aspects_index");
});
it("adds a post to the stream", function() {
var originalPostCount = $(".stream_element").length;
ContentUpdater.addPostToStream(spec.fixtureHtml("status_message_in_stream"));
expect($(".stream_element").length).toEqual(originalPostCount + 1);
});
it("does not add duplicate posts", function() {
var originalPostCount = $(".stream_element").length;
ContentUpdater.addPostToStream(spec.fixtureHtml("status_message_in_stream"));
expect($(".stream_element").length).toEqual(originalPostCount + 1);
ContentUpdater.addPostToStream(spec.fixtureHtml("status_message_in_stream"));
expect($(".stream_element").length).toEqual(originalPostCount + 1);
});
it("removes the div that says you have no posts if it exists", function() {
expect($("#no_posts").length).toEqual(1);
ContentUpdater.addPostToStream(spec.fixtureHtml("status_message_in_stream"));
expect($("#no_posts").length).toEqual(0);
});
});
});