2018-02-02 15:24:22 +00:00
|
|
|
const app = require('../../../../../client/server/server');
|
2018-01-31 11:02:35 +00:00
|
|
|
const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors;
|
2018-01-24 12:45:32 +00:00
|
|
|
|
|
|
|
describe('Client card', () => {
|
2018-01-26 08:00:16 +00:00
|
|
|
it('should call the card() method to receive a formated card of Bruce Wayne', done => {
|
2018-03-08 11:23:51 +00:00
|
|
|
let id = 101;
|
2018-01-24 12:45:32 +00:00
|
|
|
|
|
|
|
let callback = (error, result) => {
|
|
|
|
if (error) return catchErrors(done)(error);
|
|
|
|
|
|
|
|
expect(result).toEqual(jasmine.objectContaining({
|
2018-03-08 11:23:51 +00:00
|
|
|
id: 101,
|
2018-01-24 12:45:32 +00:00
|
|
|
name: 'Bruce Wayne'
|
|
|
|
}));
|
|
|
|
done();
|
|
|
|
};
|
|
|
|
|
|
|
|
app.models.Client.card(id, callback);
|
|
|
|
});
|
|
|
|
});
|