mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 09:57:25 +08:00
improve the breakUp user name algorithm, add some tests
This commit is contained in:
@ -122,3 +122,14 @@ test("updateRelativeAge", function(){
|
||||
|
||||
equal($elem.html(), "2 mins ago");
|
||||
});
|
||||
|
||||
test("breakUp", function(){
|
||||
|
||||
var b = function(s){ return Discourse.Formatter.breakUp(s,5); };
|
||||
|
||||
equal(b("hello"), "hello");
|
||||
equal(b("helloworld"), "hello world");
|
||||
equal(b("HeMans"), "He Mans");
|
||||
equal(b("he_man"), "he_ man");
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user