mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 20:44:40 +08:00
FIX: don't let admins skip post validations, unless it's faq, tos, or privacy
This commit is contained in:
@ -243,19 +243,24 @@ test('open with a quote', function() {
|
||||
|
||||
module("Discourse.Composer as admin", {
|
||||
setup: function() {
|
||||
Discourse.SiteSettings.min_topic_title_length = 5;
|
||||
Discourse.SiteSettings.max_topic_title_length = 10;
|
||||
sandbox.stub(Discourse.User, 'currentProp').withArgs('admin').returns(true);
|
||||
},
|
||||
|
||||
teardown: function() {
|
||||
Discourse.SiteSettings.min_topic_title_length = 15;
|
||||
Discourse.SiteSettings.max_topic_title_length = 255;
|
||||
Discourse.User.currentProp.restore();
|
||||
}
|
||||
});
|
||||
|
||||
test("Title length for regular topics as admin", function() {
|
||||
Discourse.SiteSettings.min_topic_title_length = 5;
|
||||
Discourse.SiteSettings.max_topic_title_length = 10;
|
||||
test("Title length for static page topics as admin", function() {
|
||||
var composer = Discourse.Composer.create();
|
||||
|
||||
var post = Discourse.Post.create({id: 123, post_number: 2, static_doc: true});
|
||||
composer.setProperties({post: post, action: Discourse.Composer.EDIT });
|
||||
|
||||
composer.set('title', 'asdf');
|
||||
ok(composer.get('titleLengthValid'), "admins can use short titles");
|
||||
|
||||
|
Reference in New Issue
Block a user