aboutsummaryrefslogtreecommitdiffstats
path: root/test/ngMock/angular-mocksSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ngMock/angular-mocksSpec.js')
-rw-r--r--test/ngMock/angular-mocksSpec.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ngMock/angular-mocksSpec.js b/test/ngMock/angular-mocksSpec.js
index e506e608..1a4290e0 100644
--- a/test/ngMock/angular-mocksSpec.js
+++ b/test/ngMock/angular-mocksSpec.js
@@ -1,5 +1,7 @@
'use strict';
+var msie = +((/msie (\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1]);
+
describe('ngMock', function() {
var noop = angular.noop;
@@ -448,6 +450,15 @@ describe('ngMock', function() {
expect(d($rootScope)).toMatch(/Scope\(.*\): \{/);
expect(d($rootScope)).toMatch(/{"abc":"123"}/);
}));
+
+ it('should serialize scope that has overridden "hasOwnProperty"', inject(function($rootScope){
+ // MS IE8 just doesn't work for this kind of thing, since "for ... in" doesn't return
+ // things like hasOwnProperty even if it is explicitly defined on the actual object!
+ if (msie<=8) return;
+ $rootScope.hasOwnProperty = 'X';
+ expect(d($rootScope)).toMatch(/Scope\(.*\): \{/);
+ expect(d($rootScope)).toMatch(/hasOwnProperty: "X"/);
+ }));
});