aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng
diff options
context:
space:
mode:
Diffstat (limited to 'src/ng')
-rw-r--r--src/ng/directive/input.js4
-rw-r--r--src/ng/filter/filters.js2
-rw-r--r--src/ng/filter/limitTo.js10
3 files changed, 8 insertions, 8 deletions
diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js
index 348c9f25..7343c358 100644
--- a/src/ng/directive/input.js
+++ b/src/ng/directive/input.js
@@ -671,7 +671,7 @@ function checkboxInputType(scope, element, attr, ctrl) {
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
- expect(binding('user')).toEqual('{"last":"visitor","name":"guest"}');
+ expect(binding('user')).toEqual('{"name":"guest","last":"visitor"}');
expect(binding('myForm.userName.$valid')).toEqual('true');
expect(binding('myForm.$valid')).toEqual('true');
});
@@ -685,7 +685,7 @@ function checkboxInputType(scope, element, attr, ctrl) {
it('should be valid if empty when min length is set', function() {
input('user.last').enter('');
- expect(binding('user')).toEqual('{"last":"","name":"guest"}');
+ expect(binding('user')).toEqual('{"name":"guest","last":""}');
expect(binding('myForm.lastName.$valid')).toEqual('true');
expect(binding('myForm.$valid')).toEqual('true');
});
diff --git a/src/ng/filter/filters.js b/src/ng/filter/filters.js
index c792cace..19f79ad1 100644
--- a/src/ng/filter/filters.js
+++ b/src/ng/filter/filters.js
@@ -407,7 +407,7 @@ function dateFilter($locale) {
</doc:source>
<doc:scenario>
it('should jsonify filtered objects', function() {
- expect(binding("{'name':'value'}")).toBe('{\n "name":"value"}');
+ expect(binding("{'name':'value'}")).toMatch(/\{\n "name": ?"value"\n}/);
});
</doc:scenario>
</doc:example>
diff --git a/src/ng/filter/limitTo.js b/src/ng/filter/limitTo.js
index 4928fb9a..af94b2f4 100644
--- a/src/ng/filter/limitTo.js
+++ b/src/ng/filter/limitTo.js
@@ -31,24 +31,24 @@
}
</script>
<div ng-controller="Ctrl">
- Limit {{numbers}} to: <input type="integer" ng-model="limit"/>
- <p>Output: {{ numbers | limitTo:limit | json }}</p>
+ Limit {{numbers}} to: <input type="integer" ng-model="limit" ng-model-instant>
+ <p>Output: {{ numbers | limitTo:limit }}</p>
</div>
</doc:source>
<doc:scenario>
it('should limit the numer array to first three items', function() {
expect(element('.doc-example-live input[ng-model=limit]').val()).toBe('3');
- expect(binding('numbers | limitTo:limit | json')).toEqual('[1,2,3]');
+ expect(binding('numbers | limitTo:limit')).toEqual('[1,2,3]');
});
it('should update the output when -3 is entered', function() {
input('limit').enter(-3);
- expect(binding('numbers | limitTo:limit | json')).toEqual('[7,8,9]');
+ expect(binding('numbers | limitTo:limit')).toEqual('[7,8,9]');
});
it('should not exceed the maximum size of input array', function() {
input('limit').enter(100);
- expect(binding('numbers | limitTo:limit | json')).toEqual('[1,2,3,4,5,6,7,8,9]');
+ expect(binding('numbers | limitTo:limit')).toEqual('[1,2,3,4,5,6,7,8,9]');
});
</doc:scenario>
</doc:example>