[#258,model][xs]: tiny bugfix for cases where fields in raw state contain a non-string - fixes #258.

This commit is contained in:
Rufus Pollock
2012-10-19 07:57:47 +01:00
parent dd8641ded2
commit f6a3395b40
2 changed files with 18 additions and 1 deletions

View File

@@ -180,6 +180,21 @@ test('_normalizeRecordsAndFields', function () {
records: null
},
},
{
in_: {
fields: [ 1, 1, 3 ],
records: null
},
exp: {
fields: [
{id: '1'},
{id: '11'},
{id: '3'}
],
records: null
},
},
// field is *not* a string
// records array but no fields
{
in_: {
@@ -267,6 +282,7 @@ test('_normalizeRecordsAndFields', function () {
out = dataset._normalizeRecordsAndFields(item.in_.records, item.in_.fields);
deepEqual(out, item.exp);
});
});