Skip to content

Instantly share code, notes, and snippets.

@evilboss
Created August 5, 2015 03:40
Show Gist options
  • Save evilboss/89950eac8869bd06fba8 to your computer and use it in GitHub Desktop.
Save evilboss/89950eac8869bd06fba8 to your computer and use it in GitHub Desktop.
'use strict'; /** * Module dependencies. */ var should = require('should'), mongoose = require('mongoose'), User = mongoose.model('User'), Applicant = mongoose.model('Applicant'); /** * Globals */ var user, applicant; /** * Unit tests */ describe('Applicant Model Unit Tests:', function() { beforeEach(function(done) { user = new User({ firstName:…
'use strict';
/**
* Module dependencies.
*/
var should = require('should'),
mongoose = require('mongoose'),
User = mongoose.model('User'),
Applicant = mongoose.model('Applicant');
/**
* Globals
*/
var user, applicant;
/**
* Unit tests
*/
describe('Applicant 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() {
applicant = new Applicant({
name: 'Applicant Name',
user: user
});
done();
});
});
describe('Method Save', function() {
it('should be able to save without problems', function(done) {
return applicant.save(function(err) {
should.not.exist(err);
done();
});
});
it('should be able to show an error when try to save without name', function(done) {
applicant.name = '';
return applicant.save(function(err) {
should.exist(err);
done();
});
});
});
afterEach(function(done) {
Applicant.remove().exec(function(){
User.remove().exec(function(){
done();
});
});
});
});
Feature: Author a Website
As a web page author
I want to set the title of my page
So that I can create the simplest website in the world
Scenario: Author using the Meteor settings file
Given I have created a document with the title "Meteor Cucumber by Xolv.io"
When I navigate to "/"
Then I see the title "mypage"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment