Permalink
Browse files

Adjust the way that presence tests are generated.

  • Loading branch information...
jcoglan committed Dec 3, 2009
1 parent f478b94 commit acd43b995fcc91d0a6c07a46e1e289292bef9675
Showing with 1 addition and 5 deletions.
  1. +1 −5 javascript/field.js
View
@@ -3,7 +3,6 @@ Acceptance.Field = Acceptance.Class({
form._numRequirements += 1;
this._form = form;
this._fieldName = fieldName;
- this._message = message;
this._tests = [];
this.getInput();
},
@@ -19,7 +18,7 @@ Acceptance.Field = Acceptance.Class({
setMessage: function(message) {
if (!message) return;
- this._message = message;
+ this.addTest(this.klass._isPresent(message));
},
addTest: function(test) {
@@ -42,9 +41,6 @@ Acceptance.Field = Acceptance.Class({
value = formData[this._fieldName],
errors = [];
- if (tests.length === 0 || !Acceptance.trim(value))
- tests = [this.klass._isPresent(this._message)].concat(tests);
-
var i = 0, n = tests.length, self = this;
Acceptance.each(tests, function(test) {

0 comments on commit acd43b9

Please sign in to comment.