浏览代码

Fix bug in form names for test suites for rgb, rgba and hsl

Emil Rømer Christensen 11 年之前
父节点
当前提交
4d78da95fb

+ 4 - 0
dist/css/bootstrapValidator.min.css

@@ -8,6 +8,7 @@
 <<<<<<< HEAD
 <<<<<<< HEAD
 <<<<<<< HEAD
+<<<<<<< HEAD
  * @version     v0.5.3-dev, built on 2014-10-06 8:02:42 AM
 =======
  * @version     v0.5.2-dev, built on 2014-09-18 9:55:01 PM
@@ -27,6 +28,9 @@
 =======
  * @version     v0.5.2-dev, built on 2014-09-18 9:57:19 PM
 >>>>>>> Add validator and test suite for hsl() color validation
+=======
+ * @version     v0.5.2-dev, built on 2014-09-18 9:57:27 PM
+>>>>>>> Fix bug in form names for test suites for rgb, rgba and hsl
  * @author      https://twitter.com/nghuuphuoc
  * @copyright   (c) 2013 - 2014 Nguyen Huu Phuoc
  * @license     MIT

+ 4 - 0
dist/js/bootstrapValidator.js

@@ -8,6 +8,7 @@
 <<<<<<< HEAD
 <<<<<<< HEAD
 <<<<<<< HEAD
+<<<<<<< HEAD
  * @version     v0.5.3-dev, built on 2014-10-06 8:02:42 AM
 =======
  * @version     v0.5.2-dev, built on 2014-09-18 9:55:01 PM
@@ -27,6 +28,9 @@
 =======
  * @version     v0.5.2-dev, built on 2014-09-18 9:57:19 PM
 >>>>>>> Add validator and test suite for hsl() color validation
+=======
+ * @version     v0.5.2-dev, built on 2014-09-18 9:57:27 PM
+>>>>>>> Fix bug in form names for test suites for rgb, rgba and hsl
  * @author      https://twitter.com/nghuuphuoc
  * @copyright   (c) 2013 - 2014 Nguyen Huu Phuoc
  * @license     MIT

+ 4 - 0
dist/js/bootstrapValidator.min.js

@@ -8,6 +8,7 @@
 <<<<<<< HEAD
 <<<<<<< HEAD
 <<<<<<< HEAD
+<<<<<<< HEAD
  * @version     v0.5.3-dev, built on 2014-10-06 8:02:42 AM
 =======
  * @version     v0.5.2-dev, built on 2014-09-18 9:55:01 PM
@@ -27,6 +28,9 @@
 =======
  * @version     v0.5.2-dev, built on 2014-09-18 9:57:19 PM
 >>>>>>> Add validator and test suite for hsl() color validation
+=======
+ * @version     v0.5.2-dev, built on 2014-09-18 9:57:27 PM
+>>>>>>> Fix bug in form names for test suites for rgb, rgba and hsl
  * @author      https://twitter.com/nghuuphuoc
  * @copyright   (c) 2013 - 2014 Nguyen Huu Phuoc
  * @license     MIT

+ 28 - 29
test/spec.js

@@ -3536,7 +3536,7 @@ describe('hslColor', function() {
     beforeEach(function() {
         var html = [
             '<div class="container">',
-                '<form class="form-horizontal" id="rbgColorForm">',
+                '<form class="form-horizontal" id="hslColorForm">',
                     '<div class="form-group">',
                         '<input type="text" name="hsl" data-bv-hslcolor />',
                     '</div>',
@@ -3545,14 +3545,14 @@ describe('hslColor', function() {
         ].join('\n');
 
         $(html).appendTo('body');
-        $('#rbgColorForm').bootstrapValidator();
+        $('#hslColorForm').bootstrapValidator();
 
-        this.bv          = $('#rbgColorForm').data('bootstrapValidator');
+        this.bv          = $('#hslColorForm').data('bootstrapValidator');
         this.$hslColor = this.bv.getFieldElements('hsl');
     });
 
     afterEach(function() {
-        $('#rbgColorForm').bootstrapValidator('destroy').parent().remove();
+        $('#hslColorForm').bootstrapValidator('destroy').parent().remove();
     });
 
     it('accept hsl()', function() {
@@ -3644,7 +3644,6 @@ describe('hslColor', function() {
         this.bv.validate();
         expect(this.bv.isValidField('hsl')).toEqual(false);
     });
-
 });
 
 describe('iban', function() {
@@ -5963,107 +5962,107 @@ describe('rgbColor', function() {
     beforeEach(function() {
         var html = [
             '<div class="container">',
-                '<form class="form-horizontal" id="rbgColorForm">',
+                '<form class="form-horizontal" id="rgbColorForm">',
                     '<div class="form-group">',
-                        '<input type="text" name="rc" data-bv-rgbcolor />',
+                        '<input type="text" name="rgb" data-bv-rgbcolor />',
                     '</div>',
                 '</form>',
             '</div>'
         ].join('\n');
 
         $(html).appendTo('body');
-        $('#rbgColorForm').bootstrapValidator();
+        $('#rgbColorForm').bootstrapValidator();
 
-        this.bv          = $('#rbgColorForm').data('bootstrapValidator');
-        this.$rgbColor = this.bv.getFieldElements('rc');
+        this.bv          = $('#rgbColorForm').data('bootstrapValidator');
+        this.$rgbColor = this.bv.getFieldElements('rgb');
     });
 
     afterEach(function() {
-        $('#rbgColorForm').bootstrapValidator('destroy').parent().remove();
+        $('#rgbColorForm').bootstrapValidator('destroy').parent().remove();
     });
 
     it('accept rgb()', function() {
         this.$rgbColor.val('rgb(255,255,255)');
         this.bv.validate();
-        expect(this.bv.isValidField('rc')).toBeTruthy();
+        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('rc')).toBeTruthy();
+        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('rc')).toBeTruthy();
+        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('rc')).toBeTruthy();
+        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('rc')).toBeTruthy();
+        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('rc')).toEqual(false);
+        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('rc')).toEqual(false);
+        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('rc')).toEqual(false);
+        expect(this.bv.isValidField('rgb')).toEqual(false);
     });
 
     it('require rgb()', function() {
         this.$rgbColor.val('255,255,255');
         this.bv.validate();
-        expect(this.bv.isValidField('rc')).toEqual(false);
+        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('rc')).toEqual(false);
+        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('rc')).toEqual(false);
+        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('rc')).toEqual(false);
+        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('rc')).toEqual(false);
+        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('rc')).toEqual(false);
+        expect(this.bv.isValidField('rgb')).toEqual(false);
     });
 
 });
@@ -6073,7 +6072,7 @@ describe('rgbaColor', function() {
     beforeEach(function() {
         var html = [
             '<div class="container">',
-                '<form class="form-horizontal" id="rbgColorForm">',
+                '<form class="form-horizontal" id="rgbaColorForm">',
                     '<div class="form-group">',
                         '<input type="text" name="rgba" data-bv-rgbacolor />',
                     '</div>',
@@ -6082,14 +6081,14 @@ describe('rgbaColor', function() {
         ].join('\n');
 
         $(html).appendTo('body');
-        $('#rbgColorForm').bootstrapValidator();
+        $('#rgbaColorForm').bootstrapValidator();
 
-        this.bv          = $('#rbgColorForm').data('bootstrapValidator');
+        this.bv          = $('#rgbaColorForm').data('bootstrapValidator');
         this.$rgbaColor = this.bv.getFieldElements('rgba');
     });
 
     afterEach(function() {
-        $('#rbgColorForm').bootstrapValidator('destroy').parent().remove();
+        $('#rgbaColorForm').bootstrapValidator('destroy').parent().remove();
     });
 
     it('accept rgba()', function() {

+ 4 - 5
test/spec/validator/hslColor.js

@@ -3,7 +3,7 @@ describe('hslColor', function() {
     beforeEach(function() {
         var html = [
             '<div class="container">',
-                '<form class="form-horizontal" id="rbgColorForm">',
+                '<form class="form-horizontal" id="hslColorForm">',
                     '<div class="form-group">',
                         '<input type="text" name="hsl" data-bv-hslcolor />',
                     '</div>',
@@ -12,14 +12,14 @@ describe('hslColor', function() {
         ].join('\n');
 
         $(html).appendTo('body');
-        $('#rbgColorForm').bootstrapValidator();
+        $('#hslColorForm').bootstrapValidator();
 
-        this.bv          = $('#rbgColorForm').data('bootstrapValidator');
+        this.bv          = $('#hslColorForm').data('bootstrapValidator');
         this.$hslColor = this.bv.getFieldElements('hsl');
     });
 
     afterEach(function() {
-        $('#rbgColorForm').bootstrapValidator('destroy').parent().remove();
+        $('#hslColorForm').bootstrapValidator('destroy').parent().remove();
     });
 
     it('accept hsl()', function() {
@@ -111,5 +111,4 @@ describe('hslColor', function() {
         this.bv.validate();
         expect(this.bv.isValidField('hsl')).toEqual(false);
     });
-
 });

+ 20 - 20
test/spec/validator/rgbColor.js

@@ -3,107 +3,107 @@ describe('rgbColor', function() {
     beforeEach(function() {
         var html = [
             '<div class="container">',
-                '<form class="form-horizontal" id="rbgColorForm">',
+                '<form class="form-horizontal" id="rgbColorForm">',
                     '<div class="form-group">',
-                        '<input type="text" name="rc" data-bv-rgbcolor />',
+                        '<input type="text" name="rgb" data-bv-rgbcolor />',
                     '</div>',
                 '</form>',
             '</div>'
         ].join('\n');
 
         $(html).appendTo('body');
-        $('#rbgColorForm').bootstrapValidator();
+        $('#rgbColorForm').bootstrapValidator();
 
-        this.bv          = $('#rbgColorForm').data('bootstrapValidator');
-        this.$rgbColor = this.bv.getFieldElements('rc');
+        this.bv          = $('#rgbColorForm').data('bootstrapValidator');
+        this.$rgbColor = this.bv.getFieldElements('rgb');
     });
 
     afterEach(function() {
-        $('#rbgColorForm').bootstrapValidator('destroy').parent().remove();
+        $('#rgbColorForm').bootstrapValidator('destroy').parent().remove();
     });
 
     it('accept rgb()', function() {
         this.$rgbColor.val('rgb(255,255,255)');
         this.bv.validate();
-        expect(this.bv.isValidField('rc')).toBeTruthy();
+        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('rc')).toBeTruthy();
+        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('rc')).toBeTruthy();
+        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('rc')).toBeTruthy();
+        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('rc')).toBeTruthy();
+        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('rc')).toEqual(false);
+        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('rc')).toEqual(false);
+        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('rc')).toEqual(false);
+        expect(this.bv.isValidField('rgb')).toEqual(false);
     });
 
     it('require rgb()', function() {
         this.$rgbColor.val('255,255,255');
         this.bv.validate();
-        expect(this.bv.isValidField('rc')).toEqual(false);
+        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('rc')).toEqual(false);
+        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('rc')).toEqual(false);
+        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('rc')).toEqual(false);
+        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('rc')).toEqual(false);
+        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('rc')).toEqual(false);
+        expect(this.bv.isValidField('rgb')).toEqual(false);
     });
 
 });

+ 4 - 4
test/spec/validator/rgbaColor.js

@@ -3,7 +3,7 @@ describe('rgbaColor', function() {
     beforeEach(function() {
         var html = [
             '<div class="container">',
-                '<form class="form-horizontal" id="rbgColorForm">',
+                '<form class="form-horizontal" id="rgbaColorForm">',
                     '<div class="form-group">',
                         '<input type="text" name="rgba" data-bv-rgbacolor />',
                     '</div>',
@@ -12,14 +12,14 @@ describe('rgbaColor', function() {
         ].join('\n');
 
         $(html).appendTo('body');
-        $('#rbgColorForm').bootstrapValidator();
+        $('#rgbaColorForm').bootstrapValidator();
 
-        this.bv          = $('#rbgColorForm').data('bootstrapValidator');
+        this.bv          = $('#rgbaColorForm').data('bootstrapValidator');
         this.$rgbaColor = this.bv.getFieldElements('rgba');
     });
 
     afterEach(function() {
-        $('#rbgColorForm').bootstrapValidator('destroy').parent().remove();
+        $('#rgbaColorForm').bootstrapValidator('destroy').parent().remove();
     });
 
     it('accept rgba()', function() {