2014-08-06 04:01:49 +08:00
|
|
|
moduleFor("controller:site-map-category", 'controller:site-map-category', {
|
|
|
|
needs: ['controller:site-map']
|
|
|
|
});
|
2013-11-28 04:58:36 +08:00
|
|
|
|
2014-08-06 04:01:49 +08:00
|
|
|
test("showTopicCount anonymous", function() {
|
2014-07-31 06:56:01 +08:00
|
|
|
var controller = this.subject();
|
2014-08-06 04:01:49 +08:00
|
|
|
ok(controller.get("showTopicCount"), 'true when anonymous');
|
|
|
|
});
|
2013-11-28 04:58:36 +08:00
|
|
|
|
2014-08-06 04:01:49 +08: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-28 04:58:36 +08:00
|
|
|
|
2014-08-06 04:01:49 +08:00
|
|
|
test("unreadTotal with values", function() {
|
|
|
|
var controller = this.subject({
|
|
|
|
currentUser: Discourse.User.create(),
|
2015-05-05 04:41:06 +08:00
|
|
|
model: { unreadTopics: 1, newTopics: 3 }
|
2014-08-06 04:01:49 +08:00
|
|
|
});
|
|
|
|
equal(controller.get('unreadTotal'), 4);
|
2013-11-28 04:58:36 +08:00
|
|
|
});
|