Skip to content

Instantly share code, notes, and snippets.

@iampeterbanjo
Last active December 25, 2015 21:19
Show Gist options
  • Save iampeterbanjo/7041182 to your computer and use it in GitHub Desktop.
Save iampeterbanjo/7041182 to your computer and use it in GitHub Desktop.
Problem testing Alloy controllers based on alloy-unit-test
it('create with 2 items', function () {
item.set({
title: "The cloud atlas",
author: "David Mitchell"
});
item.save();
item.set({
title: "Design of design",
author: "Brooks"
});
item.save();
$ = Alloy.createController('index', {});
Ti.API.info(JSON.stringify($.table.getData()))
expect($.table.getData().length).toEqual(2);
});
/*
[ERROR] THERE WERE FAILURES!
[ERROR] ============================================================
[ERROR] Recap of failing specs:
[ERROR] ------------------------------------------------------------
[ERROR] index controller create with 1 item. - Expected 1 to equal 2.
[ERROR] ------------------------------------------------------------
*/
@iampeterbanjo
Copy link
Author

Thanks! That works :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment