Merge pull request #1942 from xhh/javascript-fixes

[JavaScript] Fix initialization issues on array and nested model fields
This commit is contained in:
wing328
2016-01-22 18:15:20 +08:00
5 changed files with 9 additions and 61 deletions

View File

@@ -95,9 +95,9 @@ var StatusEnum = function StatusEnum() {
self.name = data.name;
self.photoUrls = new Array();
self.photoUrls = data.photoUrls;
self.tags = new Array();
self.tags = data.tags;
self.status = data.status;

View File

@@ -40,6 +40,7 @@ describe('PetApi', function() {
expect(fetched).to.be.ok();
expect(fetched.id).to.be(pet.id);
expect(fetched.getPhotoUrls()).to.eql(pet.getPhotoUrls());
expect(fetched.getCategory()).to.be.ok();
expect(fetched.getCategory().getName()).to.be(pet.getCategory().getName());