2014-04-29 21:16:57 -04:00
|
|
|
module("controller:avatar-selector");
|
2013-08-27 17:01:35 -04:00
|
|
|
|
|
|
|
test("avatarTemplate", function() {
|
2014-04-29 21:16:57 -04:00
|
|
|
var avatarSelectorController = controllerFor('avatar-selector');
|
2014-05-27 00:40:46 -04: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 17:01:35 -04:00
|
|
|
|
2014-05-27 00:40:46 -04:00
|
|
|
avatarSelectorController.set('selected', 'gravatar');
|
2013-08-27 17:01:35 -04:00
|
|
|
|
2014-05-27 00:40:46 -04:00
|
|
|
equal(avatarSelectorController.get("selectedUploadId"), 2,
|
|
|
|
"we are using gravatar when set");
|
2013-08-27 17:01:35 -04:00
|
|
|
|
2014-05-27 00:40:46 -04:00
|
|
|
avatarSelectorController.set("selected", "custom");
|
2013-08-27 17:01:35 -04:00
|
|
|
|
2014-05-27 00:40:46 -04:00
|
|
|
equal(avatarSelectorController.get("selectedUploadId"), 3,
|
|
|
|
"we are using custom when set");
|
2013-08-27 17:01:35 -04:00
|
|
|
|
|
|
|
});
|