From 304e560e43aa62caa0aa1506e1d34e5d263d18a1 Mon Sep 17 00:00:00 2001 From: Florian Staudacher Date: Wed, 19 Mar 2014 23:14:07 +0100 Subject: [PATCH] use new jasmine async code --- .../javascripts/app/views/header_view_spec.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/spec/javascripts/app/views/header_view_spec.js b/spec/javascripts/app/views/header_view_spec.js index 3b8d76ca0..dfa055d5a 100644 --- a/spec/javascripts/app/views/header_view_spec.js +++ b/spec/javascripts/app/views/header_view_spec.js @@ -82,20 +82,23 @@ describe("app.views.Header", function() { }); describe("focus", function() { - it("adds the class 'active' when the user focuses the text field", function() { + beforeEach(function(done){ input.trigger('focusin'); - waitsFor(function() { - return input.is('.active'); - }); - runs(function() { - expect(input).toHaveClass("active"); - }); + done(); + }); + + it("adds the class 'active' when the user focuses the text field", function() { + expect(input).toHaveClass("active"); }); }); describe("blur", function() { - it("removes the class 'active' when the user blurs the text field", function() { + beforeEach(function(done) { input.trigger('focusin').trigger('focusout'); + done(); + }); + + it("removes the class 'active' when the user blurs the text field", function() { expect(input).not.toHaveClass("active"); }); });