2013-06-17 11:38:30 -04:00
|
|
|
module("Discourse.Category");
|
|
|
|
|
|
|
|
test('slugFor', function(){
|
|
|
|
|
|
|
|
var slugFor = function(args, val, text) {
|
|
|
|
equal(Discourse.Category.slugFor(args), val, text);
|
2013-06-21 14:06:20 -04:00
|
|
|
};
|
2013-06-17 11:38:30 -04:00
|
|
|
|
|
|
|
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");
|
|
|
|
|
|
|
|
});
|