2014-08-05 16:01:49 -04:00
|
|
|
moduleFor("controller:site-map-category", 'controller:site-map-category', {
|
|
|
|
needs: ['controller:site-map']
|
|
|
|
});
|
2013-11-27 15:58:36 -05:00
|
|
|
|
2014-08-05 16:01:49 -04:00
|
|
|
test("showTopicCount anonymous", function() {
|
2014-07-30 18:56:01 -04:00
|
|
|
var controller = this.subject();
|
2014-08-05 16:01:49 -04:00
|
|
|
ok(controller.get("showTopicCount"), 'true when anonymous');
|
|
|
|
});
|
2013-11-27 15:58:36 -05:00
|
|
|
|
2014-08-05 16:01:49 -04:00
|
|
|
test("showTopicCount logged in", function() {
|
|
|
|
var controller = this.subject({ currentUser: Discourse.User.create() });
|
|
|
|
ok(!controller.get("showTopicCount"), 'false when logged in');
|
|
|
|
});
|
|
|
|
|
|
|
|
test("unreadTotal default", function() {
|
|
|
|
var controller = this.subject({ currentUser: Discourse.User.create() });
|
|
|
|
ok(!controller.get('unreadTotal'), "empty by default");
|
|
|
|
});
|
2013-11-27 15:58:36 -05:00
|
|
|
|
2014-08-05 16:01:49 -04:00
|
|
|
test("unreadTotal with values", function() {
|
|
|
|
var controller = this.subject({
|
|
|
|
currentUser: Discourse.User.create(),
|
|
|
|
unreadTopics: 1,
|
|
|
|
newTopics: 3
|
|
|
|
});
|
|
|
|
equal(controller.get('unreadTotal'), 4);
|
2013-11-27 15:58:36 -05:00
|
|
|
});
|