Move newsletter content attributes into data object

This commit is contained in:
Tautvidas Sipavičius
2015-09-24 19:49:56 +03:00
parent 38fb33d2eb
commit d7029f3d29
4 changed files with 1104 additions and 1096 deletions

View File

@ -9,13 +9,15 @@ define([
beforeEach(function() {
model = new (ContentComponent.NewsletterModel)({
globalStyles: {
style1: 'style1Value',
style2: 'style2Value',
},
content: {
data1: 'data1Value',
data2: 'data2Value',
data: {
globalStyles: {
style1: 'style1Value',
style2: 'style2Value',
},
content: {
data1: 'data1Value',
data2: 'data2Value',
},
},
someField: 'someValue'
});
@ -30,7 +32,7 @@ define([
mock.verify();
});
it('does not include styles and data attributes in its JSON', function() {
it('does not include styles and content attributes in its JSON', function() {
var json = model.toJSON();
expect(json).to.deep.equal({someField: 'someValue'});
});
@ -79,8 +81,10 @@ define([
};
var json = ContentComponent.toJSON();
expect(json).to.deep.equal(_.extend({
content: dataField,
globalStyles: stylesField
data: {
content: dataField,
globalStyles: stylesField
},
}, newsletterFields));
});
});