Browse Source

Refactor color validators to one single entity

Emil Rømer Christensen 11 years ago
parent
commit
236c33fe9e

+ 1 - 1
dist/css/bootstrapValidator.min.css

@@ -2,7 +2,7 @@
  * BootstrapValidator (http://bootstrapvalidator.com)
  * The best jQuery plugin to validate form fields. Designed to use with Bootstrap 3
  *
- * @version     v0.5.2-dev, built on 2014-09-18 10:04:01 PM
+ * @version     v0.5.2-dev, built on 2014-09-18 10:04:11 PM
  * @author      https://twitter.com/nghuuphuoc
  * @copyright   (c) 2013 - 2014 Nguyen Huu Phuoc
  * @license     MIT

File diff suppressed because it is too large
+ 66 - 174
dist/js/bootstrapValidator.js


File diff suppressed because it is too large
+ 5 - 5
dist/js/bootstrapValidator.min.js


File diff suppressed because it is too large
+ 65 - 12
src/js/validator/color.js


+ 0 - 28
src/js/validator/hexColor.js

@@ -1,28 +0,0 @@
-(function($) {
-    $.fn.bootstrapValidator.i18n.hexColor = $.extend($.fn.bootstrapValidator.i18n.hexColor || {}, {
-        'default': 'Please enter a valid hex color'
-    });
-
-    $.fn.bootstrapValidator.validators.hexColor = {
-        enableByHtml5: function($field) {
-            return ('color' === $field.attr('type'));
-        },
-
-        /**
-         * Return true if the input value is a valid hex color
-         *
-         * @param {BootstrapValidator} validator The validator plugin instance
-         * @param {jQuery} $field Field element
-         * @param {Object} options Can consist of the following keys:
-         * - message: The invalid message
-         * @returns {Boolean}
-         */
-        validate: function(validator, $field, options) {
-            var value = $field.val();
-            if (value === '') {
-                return true;
-            }
-            return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(value);
-        }
-    };
-}(window.jQuery));

+ 0 - 26
src/js/validator/hslColor.js

@@ -1,26 +0,0 @@
-(function($) {
-    $.fn.bootstrapValidator.i18n.hslColor = $.extend($.fn.bootstrapValidator.i18n.hslColor || {}, {
-        'default': 'Please enter a valid hsl color'
-    });
-
-    $.fn.bootstrapValidator.validators.hslColor = {
-
-        /**
-         * Return true if the input value is a valid hsl() color
-         *
-         * @param {BootstrapValidator} validator The validator plugin instance
-         * @param {jQuery} $field Field element
-         * @param {Object} options Can consist of the following keys:
-         * - message: The invalid message
-         * @returns {Boolean}
-         */
-        validate: function(validator, $field, options) {
-            var value = $field.val();
-            if (value === '') {
-                return true;
-            }
-            return /^hsl\((\s*(-?\d+)\s*,)(\s*(\b(0?\d{1,2}|100)\b%)\s*,)(\s*(\b(0?\d{1,2}|100)\b%)\s*)\)$/.test(value);
-        }
-    };
-}(window.jQuery));
-

+ 0 - 26
src/js/validator/hslaColor.js

@@ -1,26 +0,0 @@
-(function($) {
-    $.fn.bootstrapValidator.i18n.hslaColor = $.extend($.fn.bootstrapValidator.i18n.hslaColor || {}, {
-        'default': 'Please enter a valid hsla color'
-    });
-
-    $.fn.bootstrapValidator.validators.hslaColor = {
-
-        /**
-         * Return true if the input value is a valid hsla() color
-         *
-         * @param {BootstrapValidator} validator The validator plugin instance
-         * @param {jQuery} $field Field element
-         * @param {Object} options Can consist of the following keys:
-         * - message: The invalid message
-         * @returns {Boolean}
-         */
-        validate: function(validator, $field, options) {
-            var value = $field.val();
-            if (value === '') {
-                return true;
-            }
-            return /^hsla\((\s*(-?\d+)\s*,)(\s*(\b(0?\d{1,2}|100)\b%)\s*,){2}(\s*(0?(\.\d+)?|1(\.0+)?)\s*)\)$/.test(value);
-        }
-    };
-}(window.jQuery));
-

File diff suppressed because it is too large
+ 0 - 25
src/js/validator/keywordColor.js


+ 0 - 28
src/js/validator/rgbColor.js

@@ -1,28 +0,0 @@
-(function($) {
-    $.fn.bootstrapValidator.i18n.rgbColor = $.extend($.fn.bootstrapValidator.i18n.rgbColor || {}, {
-        'default': 'Please enter a valid rgb color'
-    });
-
-    $.fn.bootstrapValidator.validators.rgbColor = {
-
-        /**
-         * Return true if the input value is a valid rgb() color
-         *
-         * @param {BootstrapValidator} validator The validator plugin instance
-         * @param {jQuery} $field Field element
-         * @param {Object} options Can consist of the following keys:
-         * - message: The invalid message
-         * @returns {Boolean}
-         */
-        validate: function(validator, $field, options) {
-            var value = $field.val();
-            var regexInteger = /^rgb\((\s*(\b([01]?\d{1,2}|2[0-4]\d|25[0-5])\b)\s*,){2}(\s*(\b([01]?\d{1,2}|2[0-4]\d|25[0-5])\b)\s*)\)$/;
-            var regexPercent = /^rgb\((\s*(\b(0?\d{1,2}|100)\b%)\s*,){2}(\s*(\b(0?\d{1,2}|100)\b%)\s*)\)$/;
-            if (value === '') {
-                return true;
-            }
-            return regexInteger.test(value) || regexPercent.test(value);
-        }
-    };
-}(window.jQuery));
-

+ 0 - 28
src/js/validator/rgbaColor.js

@@ -1,28 +0,0 @@
-(function($) {
-    $.fn.bootstrapValidator.i18n.rgbaColor = $.extend($.fn.bootstrapValidator.i18n.rgbaColor || {}, {
-        'default': 'Please enter a valid rgb color'
-    });
-
-    $.fn.bootstrapValidator.validators.rgbaColor = {
-
-        /**
-         * Return true if the input value is a valid rgb() color
-         *
-         * @param {BootstrapValidator} validator The validator plugin instance
-         * @param {jQuery} $field Field element
-         * @param {Object} options Can consist of the following keys:
-         * - message: The invalid message
-         * @returns {Boolean}
-         */
-        validate: function(validator, $field, options) {
-            var value = $field.val();
-            var regexInteger = /^rgba\((\s*(\b([01]?\d{1,2}|2[0-4]\d|25[0-5])\b)\s*,){3}(\s*(0?(\.\d+)?|1(\.0+)?)\s*)\)$/;
-            var regexPercent = /^rgba\((\s*(\b(0?\d{1,2}|100)\b%)\s*,){3}(\s*(0?(\.\d+)?|1(\.0+)?)\s*)\)$/;
-            if (value === '') {
-                return true;
-            }
-            return regexInteger.test(value) || regexPercent.test(value);
-        }
-    };
-}(window.jQuery));
-

+ 0 - 667
test/spec.js

@@ -3593,302 +3593,6 @@ describe('greaterThan', function() {
     });
 });
 
-describe('hslColor', function() {
-
-    beforeEach(function() {
-        var html = [
-            '<div class="container">',
-                '<form class="form-horizontal" id="hslColorForm">',
-                    '<div class="form-group">',
-                        '<input type="text" name="hsl" data-bv-hslcolor />',
-                    '</div>',
-                '</form>',
-            '</div>'
-        ].join('\n');
-
-        $(html).appendTo('body');
-        $('#hslColorForm').bootstrapValidator();
-
-        this.bv          = $('#hslColorForm').data('bootstrapValidator');
-        this.$hslColor = this.bv.getFieldElements('hsl');
-    });
-
-    afterEach(function() {
-        $('#hslColorForm').bootstrapValidator('destroy').parent().remove();
-    });
-
-    it('accept hsl()', function() {
-        this.$hslColor.val('hsl(120,50%,50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toBeTruthy();
-    });
-
-    it('accept spaces around values', function() {
-        this.$hslColor.val('hsl( 120 , 50% , 50% )');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toBeTruthy();
-    });
-
-    it('accept multiple spaces around values', function() {
-        this.$hslColor.val('hsl(  120,  50%,       50%  )');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toBeTruthy();
-    });
-
-    it('accept negative hue value', function() {
-        this.$hslColor.val('hsl(-120,50%,50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toBeTruthy();
-    });
-
-    it('accept hue values larger than 360', function() {
-        this.$hslColor.val('hsl(480,50%,50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toBeTruthy();
-    });
-
-    it('reject negative saturation value', function() {
-        this.$hslColor.val('hsl(10,-50%,50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('reject negative lightness', function() {
-        this.$hslColor.val('hsl(10,50%,-50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('require hsl()', function() {
-        this.$hslColor.val('120,50%,50%');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('reject percentages above 100%', function() {
-        this.$hslColor.val('hsl(120,100%,101%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('reject space between hsl and (', function() {
-        this.$hslColor.val('hsl (120,50%,50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('reject leading space', function() {
-        this.$hslColor.val(' hsl(120,50%,50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('reject trailing space', function() {
-        this.$hslColor.val('hsl(120,50%,50%) ');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('reject percentages in hue value', function() {
-        this.$hslColor.val('hsl(50%, 50%, 100%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('reject integers in saturation value', function() {
-        this.$hslColor.val('hsl(120, 50, 100%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('reject integers in lightness value', function() {
-        this.$hslColor.val('hsl(120, 50%, 100)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-});
-
-describe('hslaColor', function() {
-
-    beforeEach(function() {
-        var html = [
-            '<div class="container">',
-                '<form class="form-horizontal" id="hslaColorForm">',
-                    '<div class="form-group">',
-                        '<input type="text" name="hsla" data-bv-hslacolor />',
-                    '</div>',
-                '</form>',
-            '</div>'
-        ].join('\n');
-
-        $(html).appendTo('body');
-        $('#hslaColorForm').bootstrapValidator();
-
-        this.bv          = $('#hslaColorForm').data('bootstrapValidator');
-        this.$hslaColor = this.bv.getFieldElements('hsla');
-    });
-
-    afterEach(function() {
-        $('#hslaColorForm').bootstrapValidator('destroy').parent().remove();
-    });
-
-    it('accept hsla()', function() {
-        this.$hslaColor.val('hsla(120,50%,50%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept spaces around values', function() {
-        this.$hslaColor.val('hsla( 120 , 50% , 50%, 1 )');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept multiple spaces around values', function() {
-        this.$hslaColor.val('hsla(  120,  50%,       50% ,   1  )');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept negative hue value', function() {
-        this.$hslaColor.val('hsla(-120,50%,50%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept hue values larger than 360', function() {
-        this.$hslaColor.val('hsla(480,50%,50%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept integer alpha channel value of 0', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,0)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept integer alpha channel value of 1', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel with leading 0', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,0.5)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel without leading 0', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,.5)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel with more than 1 decimal place', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,.524141)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('reject percentage value for alpha channel', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject integers larger than 1 for alpha channel', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,2)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject negative integers for alpha channel', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,-1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject floats larger than 1 for alpha channel', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,1.000000000001)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject negative floats for alpha channel', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,-0.5)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject more floats larger than 1 for alpha channel', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,2.3)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject negative saturation value', function() {
-        this.$hslaColor.val('hsla(10,-50%,50%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject negative lightness', function() {
-        this.$hslaColor.val('hsla(10,50%,-50%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('require hsla()', function() {
-        this.$hslaColor.val('120,50%,50%,1');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject percentages above 100%', function() {
-        this.$hslaColor.val('hsla(120,100%,101%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject space between hsla and (', function() {
-        this.$hslaColor.val('hsla (120,50%,50%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject leading space', function() {
-        this.$hslaColor.val(' hsla(120,50%,50%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject trailing space', function() {
-        this.$hslaColor.val('hsla(120,50%,50%,1) ');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject percentages in hue value', function() {
-        this.$hslaColor.val('hsla(50%, 50%, 100%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject integers in saturation value', function() {
-        this.$hslaColor.val('hsla(120, 50, 100%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject integers in lightness value', function() {
-        this.$hslaColor.val('hsla(120, 50%, 100,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-});
-
 describe('iban', function() {
     beforeEach(function() {
         $([
@@ -5431,61 +5135,6 @@ describe('issn', function() {
     });
 });
 
-describe('keywordColor', function() {
-
-    beforeEach(function() {
-        var html = [
-            '<div class="container">',
-                '<form class="form-horizontal" id="keywordColorForm">',
-                    '<div class="form-group">',
-                        '<input type="text" name="keyword" data-bv-keywordcolor />',
-                    '</div>',
-                '</form>',
-            '</div>'
-        ].join('\n');
-
-        $(html).appendTo('body');
-        $('#keywordColorForm').bootstrapValidator();
-
-        this.bv          = $('#keywordColorForm').data('bootstrapValidator');
-        this.$keywordColor = this.bv.getFieldElements('keyword');
-    });
-
-    afterEach(function() {
-        $('#keywordColorForm').bootstrapValidator('destroy').parent().remove();
-    });
-
-    it('accept transparent', function() {
-        this.$keywordColor.val('transparent');
-        this.bv.validate();
-        expect(this.bv.isValidField('keyword')).toBeTruthy();
-    });
-
-    it('accept blueviolet', function() {
-        this.$keywordColor.val('transparent');
-        this.bv.validate();
-        expect(this.bv.isValidField('keyword')).toBeTruthy();
-    });
-
-    it('reject combined keywords', function() {
-        this.$keywordColor.val('blueviolet red');
-        this.bv.validate();
-        expect(this.bv.isValidField('keyword')).toEqual(false);
-    });
-
-   it('reject shady', function() {
-        this.$keywordColor.val('shady');
-        this.bv.validate();
-        expect(this.bv.isValidField('keyword')).toEqual(false);
-    });
-
-    it('reject blueish', function() {
-        this.$keywordColor.val('blueish');
-        this.bv.validate();
-        expect(this.bv.isValidField('keyword')).toEqual(false);
-    });
-});
-
 function lessThanCompare() {
     var compareTo = $('#lessThanForm').find('[name="maxAge"]').val();
     $('#msg').html('lessThanCompare() called; compare to ' + compareTo);
@@ -6012,322 +5661,6 @@ describe('phone', function() {
     });
 });
 
-describe('rgbColor', function() {
-
-    beforeEach(function() {
-        var html = [
-            '<div class="container">',
-                '<form class="form-horizontal" id="rgbColorForm">',
-                    '<div class="form-group">',
-                        '<input type="text" name="rgb" data-bv-rgbcolor />',
-                    '</div>',
-                '</form>',
-            '</div>'
-        ].join('\n');
-
-        $(html).appendTo('body');
-        $('#rgbColorForm').bootstrapValidator();
-
-        this.bv          = $('#rgbColorForm').data('bootstrapValidator');
-        this.$rgbColor = this.bv.getFieldElements('rgb');
-    });
-
-    afterEach(function() {
-        $('#rgbColorForm').bootstrapValidator('destroy').parent().remove();
-    });
-
-    it('accept rgb()', function() {
-        this.$rgbColor.val('rgb(255,255,255)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toBeTruthy();
-    });
-
-    it('accept spaces around numeric values', function() {
-        this.$rgbColor.val('rgb( 255 , 255 , 255 )');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toBeTruthy();
-    });
-
-    it('accept multiple spaces around numeric values', function() {
-        this.$rgbColor.val('rgb(  255,  255,       255  )');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toBeTruthy();
-    });
-
-    it('accept interger values', function() {
-        this.$rgbColor.val('rgb(255,255,255)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toBeTruthy();
-    });
-
-    it('accept percent values', function() {
-        this.$rgbColor.val('rgb(100%,100%,100%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toBeTruthy();
-    });
-
-    it('reject mixed intergers and percentile input', function() {
-        this.$rgbColor.val('rgb(255,255,100%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-    it('reject negative integers', function() {
-        this.$rgbColor.val('rgb(-10,255,255)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-    it('reject negative percentages', function() {
-        this.$rgbColor.val('rgb(-10%,100%,100%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-    it('require rgb()', function() {
-        this.$rgbColor.val('255,255,255');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-    it('reject intergers above 255', function() {
-        this.$rgbColor.val('rgb(255,255,256)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-    it('reject percentages above 100%', function() {
-        this.$rgbColor.val('rgb(100%,100%,101%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-    it('reject space between rgb and (', function() {
-        this.$rgbColor.val('rgb (255,255,255)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-    it('reject leading space', function() {
-        this.$rgbColor.val(' rgb(255,255,255)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-    it('reject trailing space', function() {
-        this.$rgbColor.val('rgb(255,255,255) ');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-});
-
-describe('rgbaColor', function() {
-
-    beforeEach(function() {
-        var html = [
-            '<div class="container">',
-                '<form class="form-horizontal" id="rgbaColorForm">',
-                    '<div class="form-group">',
-                        '<input type="text" name="rgba" data-bv-rgbacolor />',
-                    '</div>',
-                '</form>',
-            '</div>'
-        ].join('\n');
-
-        $(html).appendTo('body');
-        $('#rgbaColorForm').bootstrapValidator();
-
-        this.bv          = $('#rgbaColorForm').data('bootstrapValidator');
-        this.$rgbaColor = this.bv.getFieldElements('rgba');
-    });
-
-    afterEach(function() {
-        $('#rgbaColorForm').bootstrapValidator('destroy').parent().remove();
-    });
-
-    it('accept rgba()', function() {
-        this.$rgbaColor.val('rgba(255,255,255,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept spaces around numeric values', function() {
-        this.$rgbaColor.val('rgba( 255 , 255 , 255 , 1 )');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept multiple spaces around numeric values', function() {
-        this.$rgbaColor.val('rgba(  255  ,  255    ,       255 ,  1     )');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept interger values', function() {
-        this.$rgbaColor.val('rgba(255,255,255,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept percent values', function() {
-        this.$rgbaColor.val('rgba(100%,100%,100%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept integer alpha channel value of 0', function() {
-        this.$rgbaColor.val('rgba(255,255,255,0)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept integer alpha channel value of 1', function() {
-        this.$rgbaColor.val('rgba(255,255,255,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel with leading 0', function() {
-        this.$rgbaColor.val('rgba(255,255,255,0.5)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel without leading 0', function() {
-        this.$rgbaColor.val('rgba(255,255,255,.5)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel with more than 1 decimal place', function() {
-        this.$rgbaColor.val('rgba(255,255,255,.524141)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept integer alpha channel value of 0 with percentage rgb values', function() {
-        this.$rgbaColor.val('rgba(100%,100%,100%,0)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept integer alpha channel value of 1 with percentage rgb values', function() {
-        this.$rgbaColor.val('rgba(100%,100%,100%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel with leading 0 with percentage rgb values', function() {
-        this.$rgbaColor.val('rgba(100%,100%,100%,0.5)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel without leading 0 with percentage rgb values', function() {
-        this.$rgbaColor.val('rgba(100%,100%,100%,.5)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel with more than 1 decimal place with percentage rgb values', function() {
-        this.$rgbaColor.val('rgba(100%,100%,100%,.524141)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('reject percentage value for alpha channel', function() {
-        this.$rgbaColor.val('rgba(100%,100%,100%,50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject integers larger than 1 for alpha channel', function() {
-        this.$rgbaColor.val('rgba(255,255,255,2)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject negative integers for alpha channel', function() {
-        this.$rgbaColor.val('rgba(255,255,255,-1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject floats larger than 1 for alpha channel', function() {
-        this.$rgbaColor.val('rgba(255,255,255,1.000000000001)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject negative floats for alpha channel', function() {
-        this.$rgbaColor.val('rgba(255,255,255,-0.5)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject more floats larger than 1 for alpha channel', function() {
-        this.$rgbaColor.val('rgba(255,255,255,2.3)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject mixed intergers and percentile input', function() {
-        this.$rgbaColor.val('rgba(255,255,100%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject negative integers', function() {
-        this.$rgbaColor.val('rgba(-10,255,255,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject negative percentages', function() {
-        this.$rgbaColor.val('rgba(-10%,100%,100%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('require rgba()', function() {
-        this.$rgbaColor.val('255,255,255,1');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject intergers above 255', function() {
-        this.$rgbaColor.val('rgba(255,255,256),1');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject percentages above 100%', function() {
-        this.$rgbaColor.val('rgba(100%,100%,101%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject space between rgba and (', function() {
-        this.$rgbaColor.val('rgba (255,255,255,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject leading space', function() {
-        this.$rgbaColor.val(' rgba(255,255,255,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject trailing space', function() {
-        this.$rgbaColor.val('rgba(255,255,255,1) ');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-});
-
 describe('uri', function() {
     beforeEach(function() {
         $([

+ 0 - 114
test/spec/validator/hslColor.js

@@ -1,114 +0,0 @@
-describe('hslColor', function() {
-
-    beforeEach(function() {
-        var html = [
-            '<div class="container">',
-                '<form class="form-horizontal" id="hslColorForm">',
-                    '<div class="form-group">',
-                        '<input type="text" name="hsl" data-bv-hslcolor />',
-                    '</div>',
-                '</form>',
-            '</div>'
-        ].join('\n');
-
-        $(html).appendTo('body');
-        $('#hslColorForm').bootstrapValidator();
-
-        this.bv          = $('#hslColorForm').data('bootstrapValidator');
-        this.$hslColor = this.bv.getFieldElements('hsl');
-    });
-
-    afterEach(function() {
-        $('#hslColorForm').bootstrapValidator('destroy').parent().remove();
-    });
-
-    it('accept hsl()', function() {
-        this.$hslColor.val('hsl(120,50%,50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toBeTruthy();
-    });
-
-    it('accept spaces around values', function() {
-        this.$hslColor.val('hsl( 120 , 50% , 50% )');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toBeTruthy();
-    });
-
-    it('accept multiple spaces around values', function() {
-        this.$hslColor.val('hsl(  120,  50%,       50%  )');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toBeTruthy();
-    });
-
-    it('accept negative hue value', function() {
-        this.$hslColor.val('hsl(-120,50%,50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toBeTruthy();
-    });
-
-    it('accept hue values larger than 360', function() {
-        this.$hslColor.val('hsl(480,50%,50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toBeTruthy();
-    });
-
-    it('reject negative saturation value', function() {
-        this.$hslColor.val('hsl(10,-50%,50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('reject negative lightness', function() {
-        this.$hslColor.val('hsl(10,50%,-50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('require hsl()', function() {
-        this.$hslColor.val('120,50%,50%');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('reject percentages above 100%', function() {
-        this.$hslColor.val('hsl(120,100%,101%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('reject space between hsl and (', function() {
-        this.$hslColor.val('hsl (120,50%,50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('reject leading space', function() {
-        this.$hslColor.val(' hsl(120,50%,50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('reject trailing space', function() {
-        this.$hslColor.val('hsl(120,50%,50%) ');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('reject percentages in hue value', function() {
-        this.$hslColor.val('hsl(50%, 50%, 100%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('reject integers in saturation value', function() {
-        this.$hslColor.val('hsl(120, 50, 100%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-
-    it('reject integers in lightness value', function() {
-        this.$hslColor.val('hsl(120, 50%, 100)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsl')).toEqual(false);
-    });
-});

+ 0 - 180
test/spec/validator/hslaColor.js

@@ -1,180 +0,0 @@
-describe('hslaColor', function() {
-
-    beforeEach(function() {
-        var html = [
-            '<div class="container">',
-                '<form class="form-horizontal" id="hslaColorForm">',
-                    '<div class="form-group">',
-                        '<input type="text" name="hsla" data-bv-hslacolor />',
-                    '</div>',
-                '</form>',
-            '</div>'
-        ].join('\n');
-
-        $(html).appendTo('body');
-        $('#hslaColorForm').bootstrapValidator();
-
-        this.bv          = $('#hslaColorForm').data('bootstrapValidator');
-        this.$hslaColor = this.bv.getFieldElements('hsla');
-    });
-
-    afterEach(function() {
-        $('#hslaColorForm').bootstrapValidator('destroy').parent().remove();
-    });
-
-    it('accept hsla()', function() {
-        this.$hslaColor.val('hsla(120,50%,50%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept spaces around values', function() {
-        this.$hslaColor.val('hsla( 120 , 50% , 50%, 1 )');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept multiple spaces around values', function() {
-        this.$hslaColor.val('hsla(  120,  50%,       50% ,   1  )');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept negative hue value', function() {
-        this.$hslaColor.val('hsla(-120,50%,50%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept hue values larger than 360', function() {
-        this.$hslaColor.val('hsla(480,50%,50%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept integer alpha channel value of 0', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,0)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept integer alpha channel value of 1', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel with leading 0', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,0.5)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel without leading 0', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,.5)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel with more than 1 decimal place', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,.524141)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toBeTruthy();
-    });
-
-    it('reject percentage value for alpha channel', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject integers larger than 1 for alpha channel', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,2)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject negative integers for alpha channel', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,-1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject floats larger than 1 for alpha channel', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,1.000000000001)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject negative floats for alpha channel', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,-0.5)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject more floats larger than 1 for alpha channel', function() {
-        this.$hslaColor.val('hsla(120,50%,100%,2.3)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject negative saturation value', function() {
-        this.$hslaColor.val('hsla(10,-50%,50%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject negative lightness', function() {
-        this.$hslaColor.val('hsla(10,50%,-50%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('require hsla()', function() {
-        this.$hslaColor.val('120,50%,50%,1');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject percentages above 100%', function() {
-        this.$hslaColor.val('hsla(120,100%,101%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject space between hsla and (', function() {
-        this.$hslaColor.val('hsla (120,50%,50%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject leading space', function() {
-        this.$hslaColor.val(' hsla(120,50%,50%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject trailing space', function() {
-        this.$hslaColor.val('hsla(120,50%,50%,1) ');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject percentages in hue value', function() {
-        this.$hslaColor.val('hsla(50%, 50%, 100%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject integers in saturation value', function() {
-        this.$hslaColor.val('hsla(120, 50, 100%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-
-    it('reject integers in lightness value', function() {
-        this.$hslaColor.val('hsla(120, 50%, 100,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('hsla')).toEqual(false);
-    });
-});

+ 0 - 54
test/spec/validator/keywordColor.js

@@ -1,54 +0,0 @@
-describe('keywordColor', function() {
-
-    beforeEach(function() {
-        var html = [
-            '<div class="container">',
-                '<form class="form-horizontal" id="keywordColorForm">',
-                    '<div class="form-group">',
-                        '<input type="text" name="keyword" data-bv-keywordcolor />',
-                    '</div>',
-                '</form>',
-            '</div>'
-        ].join('\n');
-
-        $(html).appendTo('body');
-        $('#keywordColorForm').bootstrapValidator();
-
-        this.bv          = $('#keywordColorForm').data('bootstrapValidator');
-        this.$keywordColor = this.bv.getFieldElements('keyword');
-    });
-
-    afterEach(function() {
-        $('#keywordColorForm').bootstrapValidator('destroy').parent().remove();
-    });
-
-    it('accept transparent', function() {
-        this.$keywordColor.val('transparent');
-        this.bv.validate();
-        expect(this.bv.isValidField('keyword')).toBeTruthy();
-    });
-
-    it('accept blueviolet', function() {
-        this.$keywordColor.val('transparent');
-        this.bv.validate();
-        expect(this.bv.isValidField('keyword')).toBeTruthy();
-    });
-
-    it('reject combined keywords', function() {
-        this.$keywordColor.val('blueviolet red');
-        this.bv.validate();
-        expect(this.bv.isValidField('keyword')).toEqual(false);
-    });
-
-   it('reject shady', function() {
-        this.$keywordColor.val('shady');
-        this.bv.validate();
-        expect(this.bv.isValidField('keyword')).toEqual(false);
-    });
-
-    it('reject blueish', function() {
-        this.$keywordColor.val('blueish');
-        this.bv.validate();
-        expect(this.bv.isValidField('keyword')).toEqual(false);
-    });
-});

+ 0 - 109
test/spec/validator/rgbColor.js

@@ -1,109 +0,0 @@
-describe('rgbColor', function() {
-
-    beforeEach(function() {
-        var html = [
-            '<div class="container">',
-                '<form class="form-horizontal" id="rgbColorForm">',
-                    '<div class="form-group">',
-                        '<input type="text" name="rgb" data-bv-rgbcolor />',
-                    '</div>',
-                '</form>',
-            '</div>'
-        ].join('\n');
-
-        $(html).appendTo('body');
-        $('#rgbColorForm').bootstrapValidator();
-
-        this.bv          = $('#rgbColorForm').data('bootstrapValidator');
-        this.$rgbColor = this.bv.getFieldElements('rgb');
-    });
-
-    afterEach(function() {
-        $('#rgbColorForm').bootstrapValidator('destroy').parent().remove();
-    });
-
-    it('accept rgb()', function() {
-        this.$rgbColor.val('rgb(255,255,255)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toBeTruthy();
-    });
-
-    it('accept spaces around numeric values', function() {
-        this.$rgbColor.val('rgb( 255 , 255 , 255 )');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toBeTruthy();
-    });
-
-    it('accept multiple spaces around numeric values', function() {
-        this.$rgbColor.val('rgb(  255,  255,       255  )');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toBeTruthy();
-    });
-
-    it('accept interger values', function() {
-        this.$rgbColor.val('rgb(255,255,255)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toBeTruthy();
-    });
-
-    it('accept percent values', function() {
-        this.$rgbColor.val('rgb(100%,100%,100%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toBeTruthy();
-    });
-
-    it('reject mixed intergers and percentile input', function() {
-        this.$rgbColor.val('rgb(255,255,100%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-    it('reject negative integers', function() {
-        this.$rgbColor.val('rgb(-10,255,255)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-    it('reject negative percentages', function() {
-        this.$rgbColor.val('rgb(-10%,100%,100%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-    it('require rgb()', function() {
-        this.$rgbColor.val('255,255,255');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-    it('reject intergers above 255', function() {
-        this.$rgbColor.val('rgb(255,255,256)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-    it('reject percentages above 100%', function() {
-        this.$rgbColor.val('rgb(100%,100%,101%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-    it('reject space between rgb and (', function() {
-        this.$rgbColor.val('rgb (255,255,255)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-    it('reject leading space', function() {
-        this.$rgbColor.val(' rgb(255,255,255)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-    it('reject trailing space', function() {
-        this.$rgbColor.val('rgb(255,255,255) ');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgb')).toEqual(false);
-    });
-
-});

+ 0 - 205
test/spec/validator/rgbaColor.js

@@ -1,205 +0,0 @@
-describe('rgbaColor', function() {
-
-    beforeEach(function() {
-        var html = [
-            '<div class="container">',
-                '<form class="form-horizontal" id="rgbaColorForm">',
-                    '<div class="form-group">',
-                        '<input type="text" name="rgba" data-bv-rgbacolor />',
-                    '</div>',
-                '</form>',
-            '</div>'
-        ].join('\n');
-
-        $(html).appendTo('body');
-        $('#rgbaColorForm').bootstrapValidator();
-
-        this.bv          = $('#rgbaColorForm').data('bootstrapValidator');
-        this.$rgbaColor = this.bv.getFieldElements('rgba');
-    });
-
-    afterEach(function() {
-        $('#rgbaColorForm').bootstrapValidator('destroy').parent().remove();
-    });
-
-    it('accept rgba()', function() {
-        this.$rgbaColor.val('rgba(255,255,255,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept spaces around numeric values', function() {
-        this.$rgbaColor.val('rgba( 255 , 255 , 255 , 1 )');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept multiple spaces around numeric values', function() {
-        this.$rgbaColor.val('rgba(  255  ,  255    ,       255 ,  1     )');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept interger values', function() {
-        this.$rgbaColor.val('rgba(255,255,255,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept percent values', function() {
-        this.$rgbaColor.val('rgba(100%,100%,100%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept integer alpha channel value of 0', function() {
-        this.$rgbaColor.val('rgba(255,255,255,0)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept integer alpha channel value of 1', function() {
-        this.$rgbaColor.val('rgba(255,255,255,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel with leading 0', function() {
-        this.$rgbaColor.val('rgba(255,255,255,0.5)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel without leading 0', function() {
-        this.$rgbaColor.val('rgba(255,255,255,.5)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel with more than 1 decimal place', function() {
-        this.$rgbaColor.val('rgba(255,255,255,.524141)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept integer alpha channel value of 0 with percentage rgb values', function() {
-        this.$rgbaColor.val('rgba(100%,100%,100%,0)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept integer alpha channel value of 1 with percentage rgb values', function() {
-        this.$rgbaColor.val('rgba(100%,100%,100%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel with leading 0 with percentage rgb values', function() {
-        this.$rgbaColor.val('rgba(100%,100%,100%,0.5)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel without leading 0 with percentage rgb values', function() {
-        this.$rgbaColor.val('rgba(100%,100%,100%,.5)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('accept floating alpha channel with more than 1 decimal place with percentage rgb values', function() {
-        this.$rgbaColor.val('rgba(100%,100%,100%,.524141)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toBeTruthy();
-    });
-
-    it('reject percentage value for alpha channel', function() {
-        this.$rgbaColor.val('rgba(100%,100%,100%,50%)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject integers larger than 1 for alpha channel', function() {
-        this.$rgbaColor.val('rgba(255,255,255,2)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject negative integers for alpha channel', function() {
-        this.$rgbaColor.val('rgba(255,255,255,-1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject floats larger than 1 for alpha channel', function() {
-        this.$rgbaColor.val('rgba(255,255,255,1.000000000001)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject negative floats for alpha channel', function() {
-        this.$rgbaColor.val('rgba(255,255,255,-0.5)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject more floats larger than 1 for alpha channel', function() {
-        this.$rgbaColor.val('rgba(255,255,255,2.3)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject mixed intergers and percentile input', function() {
-        this.$rgbaColor.val('rgba(255,255,100%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject negative integers', function() {
-        this.$rgbaColor.val('rgba(-10,255,255,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject negative percentages', function() {
-        this.$rgbaColor.val('rgba(-10%,100%,100%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('require rgba()', function() {
-        this.$rgbaColor.val('255,255,255,1');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject intergers above 255', function() {
-        this.$rgbaColor.val('rgba(255,255,256),1');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject percentages above 100%', function() {
-        this.$rgbaColor.val('rgba(100%,100%,101%,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject space between rgba and (', function() {
-        this.$rgbaColor.val('rgba (255,255,255,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject leading space', function() {
-        this.$rgbaColor.val(' rgba(255,255,255,1)');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-    it('reject trailing space', function() {
-        this.$rgbaColor.val('rgba(255,255,255,1) ');
-        this.bv.validate();
-        expect(this.bv.isValidField('rgba')).toEqual(false);
-    });
-
-});