Make the composer and TopicCreator use category id instead of category name

Also fixes #1171
Includes backwards compatibility for topic creation
This commit is contained in:
Viktor Palmkvist
2013-07-18 00:58:25 +02:00
parent 09b640b782
commit 37673e3412
7 changed files with 26 additions and 26 deletions

View File

@ -180,11 +180,11 @@ test('clearState', function() {
test('initial category when uncategorized is allowed', function() {
Discourse.SiteSettings.allow_uncategorized_topics = true;
var composer = Discourse.Composer.open({action: 'createTopic', draftKey: 'asfd', draftSequence: 1});
equal(composer.get('categoryName'),undefined,"Uncategorized by default");
equal(composer.get('categoryId'),undefined,"Uncategorized by default");
});
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('categoryName') !== undefined, "Not uncategorized by default");
ok(composer.get('categoryId') !== undefined, "Not uncategorized by default");
});