Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. 'use strict';
  2.  
  3. const should = require('should');
  4. const userModel = require('./user');
  5. console.debug = console.log;
  6.  
  7. describe('Test User Model', function() {
  8. it('given user with local password, when get user json, then json should not contains local password', (done) => {
  9. let user = userModel(null);
  10. user.attributes.toObject = function() {
  11. return {
  12. name: 'name',
  13. localPassword: 'localPassword'
  14. }
  15. }
  16. should.exist(user.attributes.toJSON().name);
  17. should.not.exist(user.attributes.toJSON().localPassword);
  18. done();
  19. });
  20. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement