omniacare
Version:
CHR OmniaCare API SDK for NodeJS
45 lines (39 loc) • 1.15 kB
JavaScript
;
var chai = require('chai'),
expect = chai.expect,
should = chai.should();
chai.config.includeStack = true;
var omniacare = require('../');
omniacare.configure({host: 'omniacare.local'});
describe('SDK', function() {
describe('Batch', function() {
if (process.env.NOCK_OFF !== true) {
require('./mocks/batch');
}
it('create success', function(done) {
omniacare.batch.create({
'Batch': 'IVR Phone Payments 11/6/2015',
'AdjustmentCodeID': 100046,
'UserID': 10164442
})
.then(function(data) {
expect(data.BatchList.$.RecordCount).equal('1');
expect(data.BatchList.Batch[0].$.BatchID).equal('656404');
})
.then(done,done);
});
it('list success', function(done) {
omniacare.batch.list({
'StartDate': '2015-11-03 00:00:00',
'EndDate': '2015-11-03 11:59:59',
'IncludePosted': 1,
'UserID': '',
'Batch': 'Credit Card Web Payments 11/3/2015'
})
.then(function(data) {
expect(data.BatchList.$.RecordCount).equal('0');
})
.then(done,done);
});
});
});