'use strict';

/**
 * Module dependencies.
 */
var should = require('should'),
	mongoose = require('mongoose'),
	User = mongoose.model('User'),
	Comment = mongoose.model('Comment');

/**
 * Globals
 */
var user, comment;

/**
 * Unit tests
 */
describe('Comment Model Unit Tests:', function() {
	beforeEach(function(done) {
		user = new User({
			firstName: 'Full',
			lastName: 'Name',
			displayName: 'Full Name',
			email: 'test@test.com',
			username: 'username',
			password: 'password'
		});

		user.save(function() { 
			comment = new Comment({
				reviews: 'Comment body',
				user: user
			});

			done();
		});
	});

	describe('Method Save', function() {
		it('should be able to save without problems', function(done) {
			return comment.save(function(err) {
				should.not.exist(err);
				done();
			});
		});

		it('should be able to save without reviews', function(done) { 
			comment.reviews = '';

			return comment.save(function(err) {
				should.not.exist(err);
				done();
			});
		});
	});

	afterEach(function(done) { 
		Comment.remove().exec();
		User.remove().exec();

		done();
	});
});
@@ -831,32 +831,58 @@
 ould be able to 
+show an error when try to 
 save without rev
@@ -974,36 +974,32 @@
 r) %7B%0A%09%09%09%09should.
-not.
 exist(err);%0A%09%09%09%09

revise comment model