Skip to content

Commit

Permalink
refactoring: UT duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslabbe committed Oct 5, 2016
1 parent 81eefde commit 51840e6
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion test/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('Create', function() {
});

/**
* Util.getAllAttributes
* cmsOperations.create
*
*/
it('cmsOperations.create()', function(done) {
Expand All @@ -47,4 +47,27 @@ describe('Create', function() {
done()
}.bind(this));
});

/**
* cmsOperations.duplicate
*
*/
it('cmsOperations.duplicate()', function(done) {
cmsOperations.duplicate('article-1.html', 'article', '', 'article-2.html', {}, false)
.then(function(resSave) {
var html = path.join(config.root, config.draft.url, resSave.abe_meta.latest.abeUrl)
var json = path.join(config.root, config.data.url, resSave.abe_meta.latest.abeUrl.replace('.html', '.json'))
var stat = fse.statSync(html)
if (stat) {
chai.expect(stat).to.not.be.undefined;
}
stat = fse.statSync(json)
if (stat) {
chai.expect(stat).to.not.be.undefined;
}
fse.removeSync(html)
fse.removeSync(json)
done()
}.bind(this))
});
});

0 comments on commit 51840e6

Please sign in to comment.