improve the breakUp user name algorithm, add some tests

This commit is contained in:
Sam
2013-06-28 13:56:38 +10:00
parent 966513a66d
commit e63bfd2f4c
3 changed files with 35 additions and 14 deletions

View File

@ -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");
});