mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-21 21:12:39 -05:00
27 lines
845 B
JavaScript
27 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);
|
|
});
|