When creating a topic, don't select a category by default when allow_uncategorized_topics is false. Also, added category validation on the server to enforce allow_uncategorized_topics.

This commit is contained in:
Neil Lalonde
2013-10-08 14:40:31 -04:00
parent 32af23884e
commit bccb37b6f3
9 changed files with 92 additions and 20 deletions

View File

@@ -186,5 +186,5 @@ test('initial category when uncategorized is allowed', function() {
test('initial category when uncategorized is not allowed', function() {
Discourse.SiteSettings.allow_uncategorized_topics = false;
var composer = Discourse.Composer.open({action: 'createTopic', draftKey: 'asfd', draftSequence: 1});
ok(composer.get('categoryId') !== undefined, "Not uncategorized by default");
ok(composer.get('categoryId') === undefined, "Uncategorized by default. Must choose a category.");
});