From 49dd87bfe17338c3c7c8287762f6d57c1e1c3de0 Mon Sep 17 00:00:00 2001 From: Josh Hornby Date: Tue, 24 Feb 2015 16:30:49 +0000 Subject: [PATCH 1/2] Added QUnit tests --- tests/tests.html | 24 ++++++++++++++++++++++++ tests/tests.js | 23 +++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 tests/tests.html create mode 100644 tests/tests.js 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 From f8ea2f07f534a90818be2cfe2ee263feab415c4f Mon Sep 17 00:00:00 2001 From: Josh Hornby Date: Sat, 28 Feb 2015 11:28:14 +0000 Subject: [PATCH 2/2] Adding bower support --- bower.json | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 bower.json 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" + ] +}