aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/directive/inputSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ng/directive/inputSpec.js')
-rw-r--r--test/ng/directive/inputSpec.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ng/directive/inputSpec.js b/test/ng/directive/inputSpec.js
index 01669b18..4dcb79a3 100644
--- a/test/ng/directive/inputSpec.js
+++ b/test/ng/directive/inputSpec.js
@@ -117,6 +117,18 @@ describe('NgModelController', function() {
});
});
+ describe('setPristine', function() {
+
+ it('should set control to its pristine state', function() {
+ ctrl.$setViewValue('edit');
+ expect(ctrl.$dirty).toBe(true);
+ expect(ctrl.$pristine).toBe(false);
+
+ ctrl.$setPristine();
+ expect(ctrl.$dirty).toBe(false);
+ expect(ctrl.$pristine).toBe(true);
+ });
+ });
describe('view -> model', function() {