Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. describe('Get customer info', () => {
  2.  
  3. it('should return a valid response', () => {
  4. response.should.have.status(200);
  5. response.should.be.json;
  6. response.body.should.not.be.empty;
  7. });
  8.  
  9. it('should set the Location header', () => {
  10. response.should.have.header('Location');
  11. });
  12.  
  13. it('should match the customer schema', () => {
  14. var customerSchema = JSON.parse(environment.customerSchema));
  15. response.body.should.have.schema(customerSchema);
  16. });
  17.  
  18. it('should return the correct customer', () => {
  19. response.body.id.should.equal(12345);
  20. response.body.age.should.be.above(18).and.below(99);
  21. response.body.firstName.should.be.a('string').and.not.empty;
  22. response.body.lastName.should.be.oneOf(['Smith', 'Jones', 'Robinson']);
  23. });
  24.  
  25. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement