[test/model][xs]: add a test for FieldList.toJSON.

This commit is contained in:
Rufus Pollock 2012-03-29 08:38:58 +01:00
parent 5fc486d808
commit d68529c113

View File

@ -18,6 +18,21 @@ test('Field: basics', function () {
},
'should throw an error if not passed in a hash with id'
);
// toJSON
var field = new recline.Model.Field({
id: 'x',
label: 'My label'
});
var out = field.toJSON();
equal('My label', out.label);
var fieldList = new recline.Model.FieldList([
{id: 'xx', label: 'XX'},
{id: 'yy', label: 'YY'}
]);
var out = fieldList.toJSON();
equal('XX', out[0].label);
});
test('Dataset', function () {