diff options
author | Vladislav Zarakovsky <vlad.zar@gmail.com> | 2015-11-25 16:05:25 +0300 |
---|---|---|
committer | Vladislav Zarakovsky <vlad.zar@gmail.com> | 2015-11-25 16:05:25 +0300 |
commit | f4cef99ffa3671d6e52d42309e412cca7902a2ad (patch) | |
tree | 370b8ef3dc8d0854b0d9fe72e09b9b5b31d2147c /test/api/gotoSpec.js | |
parent | df992f790d8b46c445ee83a637f7fdb5e647c93f (diff) | |
download | awesomplete-f4cef99ffa3671d6e52d42309e412cca7902a2ad.zip awesomplete-f4cef99ffa3671d6e52d42309e412cca7902a2ad.tar.gz awesomplete-f4cef99ffa3671d6e52d42309e412cca7902a2ad.tar.bz2 |
Simplify tests by inlining and using $.spyOnEvent helper
Diffstat (limited to 'test/api/gotoSpec.js')
-rw-r--r-- | test/api/gotoSpec.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/test/api/gotoSpec.js b/test/api/gotoSpec.js index 9e382c0..da96cf0 100644 --- a/test/api/gotoSpec.js +++ b/test/api/gotoSpec.js @@ -31,12 +31,10 @@ describe("awesomplete.goto", function () { }); it("fires awesomplete-highlight event", function () { - var events = { highlight: $.noop}; - spyOn(events, "highlight"); - $.on(this.subject.input, "awesomplete-highlight", events.highlight); + var handler = $.spyOnEvent(this.subject.input, "awesomplete-highlight"); this.subject.goto(1); - expect(events.highlight).toHaveBeenCalled(); + expect(handler).toHaveBeenCalled(); }); describe("with item index > -1", function () { |