diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..0dd80f1 --- /dev/null +++ b/bower.json @@ -0,0 +1,22 @@ +{ + "name": "jQuery-Slugify-Plugin", + "version": "1.0.0", + "homepage": "https://github.com/pmcelhaney/jQuery-Slugify-Plugin", + "authors": [ + "Patrick McElhaney " + ], + "description": "Creates a URL slug as you type a page title", + "main": "jquery.slugify.js", + "keywords": [ + "slug", + "jquery" + ], + "license": "BSD", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/tests/tests.html b/tests/tests.html new file mode 100644 index 0000000..9ed5d8b --- /dev/null +++ b/tests/tests.html @@ -0,0 +1,24 @@ + + + + + jQuery Slugify + + + +
+
+ +
+ +
+
+ +
+ + + + + + + \ No newline at end of file diff --git a/tests/tests.js b/tests/tests.js new file mode 100644 index 0000000..74dc336 --- /dev/null +++ b/tests/tests.js @@ -0,0 +1,23 @@ +(function($) { + + module('jQuery#slugify', { + setup: function () { + + } + }); + + test('test the DOM function on change', function () { + expect(1); + $('#slug-target').slugify('#slug-source'); + $('#slug-source').val('this test hás špeical characters & ćrāžÿ-śtrįngs ').trigger('change'); + equal($('#slug-target').val(), 'this-test-has-speical-characters-and-crazy-strings', "Correct slug in target field change event"); + }); + + test('test the DOM function on keyup', function () { + expect(1); + $('#slug-target').slugify('#slug-source'); + $('#slug-source').val('this test hás špeical characters & ćrāžÿ-śtrįngs ').trigger('change'); + equal($('#slug-target').val(), 'this-test-has-speical-characters-and-crazy-strings', "Correct slug in target field with keyup event"); + }); + +}(jQuery)); \ No newline at end of file