text: 'use strict'
  /* global describe, it */
  const assert = require('assert')
  const supertest = require('supertest')
  const _ = require('lodash')
  
  describe('Admin User ReviewController', () => {
    let adminUser, userID, customerID
  
    before((done) => {
  
      adminUser = supertest.agent(global.app.spools.express.server)
      // Login as Admin
      adminUser
        .post('/auth/local')
        .set('Accept', 'application/json') //set header for this test
        .send({username: 'admin', password: 'admin1234'})
        .expect(200)
        .end((err, res) => {
          assert.ok(res.body.user.id)
          assert.ok(res.body.user.current_customer_id)
          userID = res.body.user.id
          customerID = res.body.user.current_customer_id
          done(err)
        })
    })
    it('should exist', () => {
      assert(global.app.api.controllers['ReviewController'])
    })
    it('should get general stats', (done) => {
      adminUser
        .get('/review/generalStats')
        .expect(200)
        .end((err, res) => {
          assert.ok(res.body)
          done(err)
        })
    })
    it('It should get reviews', (done) => {
      adminUser
        .get('/reviews')
        .expect(200)
        .end((err, res) => {
          assert.ok(res.headers['x-pagination-total'])
          assert.ok(res.headers['x-pagination-pages'])
          assert.ok(res.headers['x-pagination-page'])
          assert.ok(res.headers['x-pagination-limit'])
          assert.ok(res.headers['x-pagination-offset'])
          assert.ok(res.headers['x-pagination-sort'])
  
          assert.equal(_.isNumber(parseInt(res.headers['x-pagination-total'])), true)
          assert.equal(_.isNumber(parseInt(res.headers['x-pagination-offset'])), true)
          assert.equal(_.isNumber(parseInt(res.headers['x-pagination-limit'])), true)
          assert.equal(_.isNumber(parseInt(res.headers['x-pagination-page'])), true)
          assert.equal(_.isNumber(parseInt(res.headers['x-pagination-pages'])), true)
  
          assert.ok(res.body)
          done(err)
        })
    })
  })
  