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

27 lines
852 B
Plaintext
Raw Normal View History

moduleFor("controller:site-map-category", 'controller:site-map-category', {
needs: ['controller:site-map']
});
2013-11-28 04:58:36 +08:00
test("showTopicCount anonymous", function() {
2014-07-31 06:56:01 +08:00
var controller = this.subject();
ok(controller.get("showTopicCount"), 'true when anonymous');
});
2013-11-28 04:58:36 +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
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 }
});
equal(controller.get('unreadTotal'), 4);
2013-11-28 04:58:36 +08:00
});