diff --git a/spec/javascripts/stream-spec.js b/spec/javascripts/stream-spec.js
index 19b6e71e6..4b0a16275 100644
--- a/spec/javascripts/stream-spec.js
+++ b/spec/javascripts/stream-spec.js
@@ -6,31 +6,7 @@
describe("Stream", function() {
beforeEach(function() {
jasmine.Clock.useMock();
- $('#jasmine_content').html(
- '
' +
- '
' +
- '' +
- '
' +
- '' +
- '
' +
- '' +
- '
' +
- '' +
- '
'
- );
+ spec.loadFixture('aspects_index_with_posts');
});
describe("initialize", function() {
@@ -48,16 +24,17 @@ describe("Stream", function() {
Stream.initialize();
});
it("toggles class hidden on the comment block", function () {
- expect(jQuery('ul.comments')).toHaveClass("hidden");
+ expect(jQuery('ul.comments')).not.toHaveClass("hidden");
$("a.show_post_comments").click();
jasmine.Clock.tick(200);
- expect(jQuery('ul.comments')).not.toHaveClass("hidden");
+ expect(jQuery('ul.comments')).toHaveClass("hidden");
});
it("changes the text on the show comments link", function() {
+ expect($("a.show_post_comments").text()).toEqual("hide comments (1)");
$("a.show_post_comments").click();
jasmine.Clock.tick(200);
- expect($("a.show_post_comments").text()).toEqual("hide comments (0)");
+ expect($("a.show_post_comments").text()).toEqual("show comments (1)");
});
});
});