From 69a1718d089985958620ffb8751edec8a2f4b1a7 Mon Sep 17 00:00:00 2001 From: Florian Staudacher Date: Tue, 18 Feb 2014 11:14:02 +0100 Subject: [PATCH] fix comment spec, jasmine should be ok now --- spec/javascripts/app/views/comment_stream_view_spec.js | 2 +- spec/javascripts/app/views/header_view_spec.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/spec/javascripts/app/views/comment_stream_view_spec.js b/spec/javascripts/app/views/comment_stream_view_spec.js index 22b2db68d..e9b1750cf 100644 --- a/spec/javascripts/app/views/comment_stream_view_spec.js +++ b/spec/javascripts/app/views/comment_stream_view_spec.js @@ -53,7 +53,7 @@ describe("app.views.CommentStream", function(){ }); it("adds the comment to the view", function() { - this.request.response({status: 200}); + this.request.response({status: 200, responseText: '[]'}); expect(this.view.$(".comment-content p").text()).toEqual("a new comment"); }); diff --git a/spec/javascripts/app/views/header_view_spec.js b/spec/javascripts/app/views/header_view_spec.js index 8535464ad..39778c436 100644 --- a/spec/javascripts/app/views/header_view_spec.js +++ b/spec/javascripts/app/views/header_view_spec.js @@ -84,7 +84,12 @@ describe("app.views.Header", function() { describe("focus", function() { it("adds the class 'active' when the user focuses the text field", function() { input.trigger('focus'); - expect(input).toHaveClass("active"); + waitsFor(function() { + return input.is('.active'); + }); + runs(function() { + expect(input).toHaveClass("active"); + }); }); });