mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 21:10:17 +08:00
28 lines
845 B
JavaScript
28 lines
845 B
JavaScript
moduleFor("controller:site-map-category", 'controller:site-map-category', {
|
|
needs: ['controller:site-map']
|
|
});
|
|
|
|
test("showTopicCount anonymous", function() {
|
|
var controller = this.subject();
|
|
ok(controller.get("showTopicCount"), 'true when anonymous');
|
|
});
|
|
|
|
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");
|
|
});
|
|
|
|
test("unreadTotal with values", function() {
|
|
var controller = this.subject({
|
|
currentUser: Discourse.User.create(),
|
|
unreadTopics: 1,
|
|
newTopics: 3
|
|
});
|
|
equal(controller.get('unreadTotal'), 4);
|
|
});
|