Last active
December 25, 2015 21:19
-
-
Save iampeterbanjo/7041182 to your computer and use it in GitHub Desktop.
Problem testing Alloy controllers based on alloy-unit-test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] ------------------------------------------------------------ | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! That works :-)