mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-02-17 04:01:29 -05:00
Use a helper function in nav_item_test.js
This commit is contained in:
parent
014db4c2e9
commit
9540112d32
1 changed files with 8 additions and 4 deletions
|
@ -15,8 +15,12 @@ module("Discourse.NavItem", {
|
|||
test('href', function(){
|
||||
expect(4);
|
||||
|
||||
equal(Discourse.NavItem.fromText('latest', {}).get('href'), '/latest', "latest");
|
||||
equal(Discourse.NavItem.fromText('categories', {}).get('href'), '/categories', "categories");
|
||||
equal(Discourse.NavItem.fromText('category/bug', {}).get('href'), '/category/bug', "English category name");
|
||||
equal(Discourse.NavItem.fromText('category/确实是这样', {}).get('href'), '/category/343434-category', "Chinese category name");
|
||||
function href(text, expected, label) {
|
||||
equal(Discourse.NavItem.fromText(text, {}).get('href'), expected, label);
|
||||
}
|
||||
|
||||
href('latest', '/latest', 'latest');
|
||||
href('categories', '/categories', 'categories');
|
||||
href('category/bug', '/category/bug', 'English category name');
|
||||
href('category/确实是这样', '/category/343434-category', 'Chinese category name');
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue