diff options
Diffstat (limited to 'test/api/closeSpec.js')
-rw-r--r-- | test/api/closeSpec.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/test/api/closeSpec.js b/test/api/closeSpec.js index 6661af6..b1de6bc 100644 --- a/test/api/closeSpec.js +++ b/test/api/closeSpec.js @@ -4,8 +4,6 @@ describe("awesomplete.close", function () { subject(function () { return new Awesomplete("#plain") }); - def("events", function () { return { closed: $.noop } }); - beforeEach(function () { this.subject.open(); this.subject.next(); @@ -24,10 +22,9 @@ describe("awesomplete.close", function () { }); it("fires awesomplete-close event", function () { - spyOn(this.events, "closed") - $.on(this.subject.input, "awesomplete-close", this.events.closed); - + var handler = $.spyOnEvent(this.subject.input, "awesomplete-close"); this.subject.close(); - expect(this.events.closed).toHaveBeenCalled(); + + expect(handler).toHaveBeenCalled(); }); }); |