Skip to content

Commit

Permalink
TU cleanSlug
Browse files Browse the repository at this point in the history
  • Loading branch information
wonknu committed Oct 3, 2016
1 parent 858b989 commit 891dab2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/fixtures/string/urls.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"template name with à, é, û, UPPERCASE; @": "template-name-with-a-e-u-uppercase."
}
22 changes: 22 additions & 0 deletions test/url.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
var chai = require('chai');

var cleanSlug = require('../src/cli').cleanSlug
var fse = require('fs-extra')
var config = require('../src/cli').config
config.set({root: __dirname + '/fixtures'})

describe('Url', function() {

var urls = fse.readJsonSync(__dirname + '/fixtures/string/urls.json', 'utf8')

/**
* getAbeImport
*
*/
it('configuration file', function() {
for(var key in urls){
chai.assert.equal(cleanSlug(key), urls[key] + config.files.templates.extension, key + 'slugified url did not match')
}
});

});

0 comments on commit 891dab2

Please sign in to comment.