forked from ezsystems/ez-js-rest-client
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ezsystems#54 from ezsystems/ezp-24065_section_assign
EZP-24065: ContentMetadataUpdateStruct improvements
- Loading branch information
Showing
3 changed files
with
56 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* global define, describe, it, expect, beforeEach */ | ||
define(function (require) { | ||
var ContentMetadataUpdateStruct = require('structures/ContentMetadataUpdateStruct'); | ||
|
||
describe('ContentMetadataUpdateStruct', function () { | ||
var contentMetadataUpdateStruct; | ||
|
||
beforeEach(function () { | ||
contentMetadataUpdateStruct = new ContentMetadataUpdateStruct(); | ||
}); | ||
|
||
describe('constructor', function () { | ||
it('should initialize the body', function () { | ||
expect(contentMetadataUpdateStruct.body).toEqual({'ContentUpdate': {}}); | ||
}); | ||
|
||
it('should set the headers', function () { | ||
expect(contentMetadataUpdateStruct.headers).toEqual({ | ||
"Accept": "application/vnd.ez.api.ContentInfo+json", | ||
"Content-Type": "application/vnd.ez.api.ContentUpdate+json" | ||
}); | ||
}); | ||
}); | ||
|
||
describe('setSection', function () { | ||
it('should set the Section property', function () { | ||
var sectionId = 'section-id'; | ||
|
||
contentMetadataUpdateStruct.setSection(sectionId); | ||
|
||
expect(contentMetadataUpdateStruct.body.ContentUpdate.Section).toEqual({ | ||
_href: sectionId, | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters