mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 12:13:37 +08:00
27 lines
852 B
JavaScript
27 lines
852 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(),
|
|
model: { unreadTopics: 1, newTopics: 3 }
|
|
});
|
|
equal(controller.get('unreadTotal'), 4);
|
|
});
|