From aa4fbfbe1a58155d6096c012aa408fc5ec5271eb Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Sun, 8 May 2011 19:01:26 -0700 Subject: [PATCH] Use a fixture in stream-spec --- spec/javascripts/stream-spec.js | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) 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( - '
' + - '
  • ' + - '
    ' + - '
    ' + - 'show comments (0)' + - '
    ' + - '' + - '
    ' + - '
  • ' + - '
    ' - ); + 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)"); }); }); });