{"size": 1330, "ext": "js", "max_stars_repo_path": "test/models/RelatedVoice.js", "max_stars_repo_name": "Empathia/crowdvoice.by", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/models/RelatedVoice.js", "max_issues_repo_name": "Empathia/crowdvoice.by", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/models/RelatedVoice.js", "max_forks_repo_name": "Empathia/crowdvoice.by", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.9310344828, "max_line_length": 80, "alphanum_fraction": 0.5541353383}
'use strict'

var path = require('path')

require(path.join(process.cwd(), 'bin', 'server.js'))

logger.info = function () {}

var expect = require('chai').expect

describe('K.RelatedVoice', function () {

  describe('Relations', function () {

    describe('voice', function () {

      it('Should return a proper Voice object', function (doneTest) {
        K.RelatedVoice.query()
          .where('voice_id', 1)
          .andWhere('related_id', 2)
          .include('voice')
          .then(function (result) {
            var related = result[0]

            expect(related.voice).to.be.an('object')
            expect(related.voice.constructor.className).to.equal('Voice')

            return doneTest()
          })
          .catch(doneTest)
      })

    })

    describe('relatedVoice', function () {

      it('Should return a proper Voice object', function (doneTest) {
        K.RelatedVoice.query()
          .where('voice_id', 1)
          .andWhere('related_id', 2)
          .include('relatedVoice')
          .then(function (result) {
            var related = result[0]

            expect(related.relatedVoice).to.be.an('object')
            expect(related.relatedVoice.constructor.className).to.equal('Voice')

            return doneTest()
          })
          .catch(doneTest)
      })

    })

  })

})
