use new jasmine async code

This commit is contained in:
Florian Staudacher 2014-03-19 23:14:07 +01:00 committed by Jonne Haß
parent d4aca571ac
commit 304e560e43

View file

@ -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");
});
});