discourse/test/javascripts/controllers/site-map-category-test.js.es6

27 lines
852 B
Text
Raw Normal View History

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