diff options
| author | Andres Ornelas | 2010-07-27 10:44:46 -0700 |
|---|---|---|
| committer | Andres Ornelas | 2010-07-27 10:44:46 -0700 |
| commit | b42072733c3afd03a49457d88ffed28ebe55655e (patch) | |
| tree | 2fa2b8703cdc75fe19a204d2c9677e27d33c8176 /test/AngularSpec.js | |
| parent | 2f7c538628929888ce7c99b9577e34f8c87211f7 (diff) | |
| parent | 8ddee9bb25ade2bbe7d57db6353b29867606c184 (diff) | |
| download | angular.js-b42072733c3afd03a49457d88ffed28ebe55655e.tar.bz2 | |
Merge branch 'master' of github.com:angular/angular.js into future
Diffstat (limited to 'test/AngularSpec.js')
| -rw-r--r-- | test/AngularSpec.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/AngularSpec.js b/test/AngularSpec.js index de724f03..b4e90175 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -1,3 +1,7 @@ +beforeEach(function(){ + compileCache = {}; +}); + describe('Angular', function(){ xit('should fire on updateEvents', function(){ var onUpdateView = jasmine.createSpy(); @@ -50,3 +54,30 @@ describe("copy", function(){ }); }); + +describe('equals', function(){ + it('should return true if same object', function(){ + var o = {}; + expect(equals(o, o)).toEqual(true); + expect(equals(1, '1')).toEqual(true); + expect(equals(1, '2')).toEqual(false); + }); + + it('should recurse into object', function(){ + expect(equals({}, {})).toEqual(true); + expect(equals({name:'misko'}, {name:'misko'})).toEqual(true); + expect(equals({name:'misko', age:1}, {name:'misko'})).toEqual(false); + expect(equals({name:'misko'}, {name:'misko', age:1})).toEqual(false); + expect(equals({name:'misko'}, {name:'adam'})).toEqual(false); + expect(equals(['misko'], ['misko'])).toEqual(true); + expect(equals(['misko'], ['adam'])).toEqual(false); + expect(equals(['misko'], ['misko', 'adam'])).toEqual(false); + }); + + it('should ignore $ member variables', function(){ + expect(equals({name:'misko', $id:1}, {name:'misko', $id:2})).toEqual(true); + expect(equals({name:'misko'}, {name:'misko', $id:2})).toEqual(true); + expect(equals({name:'misko', $id:1}, {name:'misko'})).toEqual(true); + }); + +}); |
