Moved a bunch of tests to QUnit. Added basic Discourse.Site support to test suite.

This commit is contained in:
Robin Ward
2013-06-17 11:38:30 -04:00
parent 2174c0d661
commit 797b99db7c
14 changed files with 112 additions and 259 deletions
+15
View File
@@ -0,0 +1,15 @@
/*global module:true test:true ok:true visit:true expect:true exists:true count:true equal:true */
module("Discourse.Category");
test('slugFor', function(){
var slugFor = function(args, val, text) {
equal(Discourse.Category.slugFor(args), val, text);
}
slugFor({slug: 'hello'}, "hello", "It calculates the proper slug for hello");
slugFor({id: 123, slug: ''}, "123-category", "It returns id-category for empty strings");
slugFor({id: 456}, "456-category", "It returns id-category for undefined slugs");
});