Bit of refactoring

This commit is contained in:
Vojta Jina
2011-05-18 13:31:26 +02:00
committed by Igor Minar
parent 864da8b553
commit 7fe46e8d7e
2 changed files with 22 additions and 25 deletions

View File

@@ -192,15 +192,15 @@ describe('ngdoc', function(){
describe('merge', function(){
it('should merge child with parent', function(){
var parent = new Doc({name:'angular.service.abc'});
var methodA = new Doc({name:'methodA', methodOf:'angular.service.abc'});
var methodB = new Doc({name:'methodB', methodOf:'angular.service.abc'});
var propA = new Doc({name:'propA', propertyOf:'angular.service.abc'});
var propB = new Doc({name:'propB', propertyOf:'angular.service.abc'});
var parent = new Doc({id: 'angular.service.abc', name: 'angular.service.abc', section: 'api'});
var methodA = new Doc({name: 'methodA', methodOf: 'angular.service.abc'});
var methodB = new Doc({name: 'methodB', methodOf: 'angular.service.abc'});
var propA = new Doc({name: 'propA', propertyOf: 'angular.service.abc'});
var propB = new Doc({name: 'propB', propertyOf: 'angular.service.abc'});
var docs = [methodB, methodA, propB, propA, parent]; // keep wrong order;
ngdoc.merge(docs);
expect(docs.length).toEqual(1);
expect(docs[0].name).toEqual('angular.service.abc');
expect(docs[0].id).toEqual('angular.service.abc');
expect(docs[0].methods).toEqual([methodA, methodB]);
expect(docs[0].properties).toEqual([propA, propB]);
});