summaryrefslogtreecommitdiffstats
path: root/test/api/openSpec.js
diff options
context:
space:
mode:
authorVladislav Zarakovsky <vlad.zar@gmail.com>2015-11-25 16:05:25 +0300
committerVladislav Zarakovsky <vlad.zar@gmail.com>2015-11-25 16:05:25 +0300
commitf4cef99ffa3671d6e52d42309e412cca7902a2ad (patch)
tree370b8ef3dc8d0854b0d9fe72e09b9b5b31d2147c /test/api/openSpec.js
parentdf992f790d8b46c445ee83a637f7fdb5e647c93f (diff)
downloadawesomplete-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.js7
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 () {