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/openSpec.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/openSpec.js')
-rw-r--r-- | test/api/openSpec.js | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/test/api/openSpec.js b/test/api/openSpec.js index e79c721..848b960 100644 --- a/test/api/openSpec.js +++ b/test/api/openSpec.js @@ -4,8 +4,6 @@ describe("awesomplete.open", function () { subject(function () { return new Awesomplete("#plain", this.options) }); - def("events", function () { return { opened: $.noop } }); - it("opens completer", function () { this.subject.open(); expect(this.subject.ul.hasAttribute("hidden")).toBe(false); @@ -22,11 +20,10 @@ describe("awesomplete.open", function () { }); it("fires awesomplete-open event", function () { - spyOn(this.events, "opened") - $.on(this.subject.input, "awesomplete-open", this.events.opened); + var handler = $.spyOnEvent(this.subject.input, "awesomplete-open"); this.subject.open(); - expect(this.events.opened).toHaveBeenCalled(); + expect(handler).toHaveBeenCalled(); }); describe("with autoFirst: true", function () { |