Refactor: move category slug helper to Category model

This commit is contained in:
Robin Ward
2013-05-29 14:18:02 -04:00
parent fe3ac50aae
commit 3d0587d8ce
6 changed files with 32 additions and 27 deletions

View File

@ -2,22 +2,6 @@
describe("Discourse.Utilities", function() {
describe("categoryUrlId", function() {
it("returns the slug when it exists", function() {
expect(Discourse.Utilities.categoryUrlId({ slug: 'hello' })).toBe("hello");
});
it("returns id-category when slug is an empty string", function() {
expect(Discourse.Utilities.categoryUrlId({ id: 123, slug: '' })).toBe("123-category");
});
it("returns id-category without a slug", function() {
expect(Discourse.Utilities.categoryUrlId({ id: 456 })).toBe("456-category");
});
});
describe("emailValid", function() {
it("allows upper case in first part of emails", function() {