diff --git a/API.md b/API.md
index d1e338d..f64cf56 100644
--- a/API.md
+++ b/API.md
@@ -11,7 +11,7 @@
- [onValidSubmit()](#onvalidsubmit)
- [onInvalidSubmit()](#oninvalidsubmit)
- [onChange()](#onchange)
- - [resetForm()](#resetform)
+ - [reset()](#resetform)
- [Formsy.Mixin](#formsymixin)
- [name](#name)
- [value](#value)
@@ -142,7 +142,7 @@ Triggers when form is submitted with an invalid state. The arguments are the sam
```
"onChange" triggers when setValue is called on your form elements. It is also triggered when dynamic form elements have been added to the form. The "currentValues" is an object where the key is the name of the input and the value is the current value.
-#### resetForm()
+#### reset()
```html
var MyForm = React.createClass({
resetForm: function () {
diff --git a/specs/Formsy-spec.jsx b/specs/Formsy-spec.jsx
index 95b9c6e..b483a7f 100755
--- a/specs/Formsy-spec.jsx
+++ b/specs/Formsy-spec.jsx
@@ -593,5 +593,24 @@ describe('Formsy', function () {
TestUtils.Simulate.submit(form.getDOMNode());
expect(onSubmit).toHaveBeenCalledWith({foo: false});
});
+
+ it("should say the form is submitted", function() {
+ var form = TestUtils.renderIntoDocument();
+ var input = TestUtils.findRenderedComponentWithType(form, TestInput);
+ expect(input.isFormSubmitted()).toBe(false);
+ TestUtils.Simulate.submit(form.getDOMNode());
+ expect(input.isFormSubmitted()).toBe(true);
+ });
+
+ it("should be able to reset the form to its pristine state", function() {
+ var form = TestUtils.renderIntoDocument();
+ var input = TestUtils.findRenderedComponentWithType(form, TestInput);
+ var formsyForm = TestUtils.findRenderedComponentWithType(form, Formsy.Form);
+ expect(input.getValue()).toBe(true);
+ form.setProps({value: false});
+ expect(input.getValue()).toBe(false);
+ formsyForm.reset();
+ expect(input.getValue()).toBe(true);
+ });
});
});
diff --git a/src/main.js b/src/main.js
index f6208b7..93caeac 100644
--- a/src/main.js
+++ b/src/main.js
@@ -74,7 +74,7 @@ Formsy.Form = React.createClass({
}.bind(this), 0);
},
- resetForm: function () {
+ reset: function () {
this.setFormPristine(true);
this.resetModel();
},