message: Update video upload test
diff: @@ -7,7 +7,7 @@ import {Server} from '../../src/server';
  import {FixtureLoader} from '../../fixtures/FixtureLoader';
  import {JwtUtils} from '../../src/security/JwtUtils';
  import {User} from '../../src/models/User';
  -import {Lecture} from '../../src/models/Lecture';
  +import {Course} from '../../src/models/Course';
  chai.use(chaiHttp);
  chai.should();
  @@ -20,23 +20,24 @@ describe('Unit', () => {
  beforeEach(() => fixtureLoader.load());
  describe(`POST ${BASE_URL}`, () => {
  - it('should upload a video and return the lecture', () => {
  + it('should upload a video and return the created unit', () => {
  return User.findOne({email: 'teacher@test.local'})
  .then((user) => {
  - return Lecture.findOne({name: 'Lecture 1'})
  - .then((lecture) => ({user, lecture}));
  - }).then(({user, lecture}) =>
  + return Course.findOne({name: 'Introduction to web development'})
  + .then((course) => ({user, course}));
  + }).then(({user, course}) =>
  chai.request(app)
  - .post(BASE_URL)
  + .post(`${BASE_URL}/video`)
  .field('name', 'Test Upload')
  .field('description', 'This is my test upload.')
  - .field('lectureId', lecture._id.toString())
  + .field('lectureId', course.lectures[0].toString())
  + .field('courseId', course._id.toString())
  .attach('file', fs.readFileSync('fixtures/binaryData/testvideo.mp4'), 'testvideo.mp4')
  .set('Authorization', `JWT ${JwtUtils.generateToken(user)}`))
  .then((res) => {
  res.status.should.be.equal(200);
  - res.body.name.should.be.equal('Lecture 1');
  - res.body.description.should.be.equal('Description Lecture 1');
  + res.body.name.should.be.equal('Test Upload');
  + res.body.description.should.be.equal('This is my test upload.');
  });
  }).timeout(10000); // use higher timeout for upload to complete
  });
  