Skip to content

Commit

Permalink
Typo; changes to make tests work
Browse files Browse the repository at this point in the history
  • Loading branch information
caulagi committed May 27, 2012
1 parent b2066d3 commit aeee7d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/widgets.js
Expand Up @@ -28,12 +28,18 @@ var input = function (type) {
html += f.value ? ' value="' + f.value + '"' : '';
html += Object.keys(opt).reduce(function (html, k) {
if (ignoreAttrs.indexOf(k) === -1 && legalAttrs.indexOf(k) !== -1 || dataRegExp.test(k) || ariaRegExp.test(k)) {
return html + ' ' + k + '="' + opt[k].replace(/"/g", '"') + '"';
return html + ' ' + k + '="' + opt[k].replace(/"/g, '"') + '"';
}
return html;
}, '');
return html + ' />';
};
w.getDataRegExp = function() {
return dataRegExp;
};
w.getAriaRegExp = function() {
return ariaRegExp;
};
return w;
};
};
Expand Down
2 changes: 1 addition & 1 deletion test/test-widgets.js
Expand Up @@ -257,7 +257,7 @@ exports['optional text input'] = function(test){
};

exports['optional data attribute regex test'] = function(test){
var re = forms.widgets.text().dataRegExp;
var re = forms.widgets.text().getDataRegExp();
test.equals(re.test('data-'), false);
test.equals(re.test('data-input'), true);
test.equals(re.test('idata-input'), false);
Expand Down

0 comments on commit aeee7d3

Please sign in to comment.