2014-07-30 16:53:14 -05:00
|
|
|
moduleFor("controller:avatar-selector", "controller:avatar-selector", {
|
|
|
|
needs: ['controller:modal']
|
|
|
|
});
|
2013-08-27 16:01:35 -05:00
|
|
|
|
|
|
|
test("avatarTemplate", function() {
|
2014-07-30 16:53:14 -05:00
|
|
|
var avatarSelectorController = this.subject();
|
2014-05-26 23:40:46 -05:00
|
|
|
avatarSelectorController.setProperties({
|
|
|
|
selected: "system",
|
|
|
|
system_avatar_upload_id:1,
|
|
|
|
gravatar_avatar_upload_id:2,
|
|
|
|
custom_avatar_upload_id: 3
|
|
|
|
});
|
|
|
|
|
|
|
|
equal(avatarSelectorController.get("selectedUploadId"), 1,
|
|
|
|
"we are using system by default");
|
2013-08-27 16:01:35 -05:00
|
|
|
|
2014-05-26 23:40:46 -05:00
|
|
|
avatarSelectorController.set('selected', 'gravatar');
|
2013-08-27 16:01:35 -05:00
|
|
|
|
2014-05-26 23:40:46 -05:00
|
|
|
equal(avatarSelectorController.get("selectedUploadId"), 2,
|
|
|
|
"we are using gravatar when set");
|
2013-08-27 16:01:35 -05:00
|
|
|
|
2014-05-26 23:40:46 -05:00
|
|
|
avatarSelectorController.set("selected", "custom");
|
2013-08-27 16:01:35 -05:00
|
|
|
|
2014-05-26 23:40:46 -05:00
|
|
|
equal(avatarSelectorController.get("selectedUploadId"), 3,
|
|
|
|
"we are using custom when set");
|
2013-08-27 16:01:35 -05:00
|
|
|
|
|
|
|
});
|