Spy for appController.showBanner?

10 views
Skip to first unread message

P. Douglas Reeder

unread,
Aug 25, 2010, 5:14:52 PM8/25/10
to jasmine-webos
I'd like to put a spy on appController.showBanner(), but it's not
clear how to do this. When I write a spec:

describe("creating recurring item", function () {
it("should banner recur without leadTime", function () {
spyOn(Mojo.Controller.AppController, 'showBanner');
var item = new Item({summaryText: "recurring item", dueDate:
Date.UTC(2010, 3, 15, 9, 15), recur: "RRULE:FREQ=DAILY", work: 1});
expect(Mojo.Controller.AppController.showBanner).toHaveBeenCalled();
});
});

the spec fails with the message

showBanner() method does not exist


Do I need to do something different when spying on the
AppController?

(I note that a do-nothing showBanner is defined on
jasmine.webos.StubSceneController, which is odd, because showBanner is
defined on AppControler, not SceneController.)
Reply all
Reply to author
Forward
0 new messages