Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- const should = require('should');
- const userModel = require('./user');
- console.debug = console.log;
- describe('Test User Model', function() {
- it('given user with local password, when get user json, then json should not contains local password', (done) => {
- let user = userModel(null);
- user.attributes.toObject = function() {
- return {
- name: 'name',
- localPassword: 'localPassword'
- }
- }
- should.exist(user.attributes.toJSON().name);
- should.not.exist(user.attributes.toJSON().localPassword);
- done();
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement