Skip to content

Commit

Permalink
[JRD-471] Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cerealkill committed Oct 5, 2015
1 parent 69f7b79 commit f1a7bc9
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pids

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
unit-test-coverage

# Coverage directory used by tools like istanbul
coverage
Expand All @@ -29,11 +30,13 @@ build/Release
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

# IDE
.settings
#docs
docs

# Mac
.DS_STORE
#idea
.idea

# Test coverage
unit-test-coverage
#Visual Code
.settings
launch.json
.DS_Store
66 changes: 66 additions & 0 deletions test/test-account-manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
'use strict';
var AccountManagerHelper = require('../app/lib/AccountManagerHelper.js');
var should = require('chai').should();
var helper = new AccountManagerHelper('http://localhost:3000/account-manager');

describe('AccountManagerHelper', function () {

describe('createProject()', function () {
it('Should create projects from a user', function (done) {
var promiss = helper.createProject({
owner: '[email protected]',
name: 'Project 201',
description: 'Descricao',
});
promiss
.then(
function (res) {
res[0].should.have.property('project');
res[0].project.should.have.property('safeName');
res[0].project.should.have.property('name');
res[0].project.should.have.property('description');
res[0].project.should.have.property('code');
}
)
.done(function () {
done();
});
});

it('Should not create projects from a wrong user param',
function (done) {
var promiss = helper.createProject({
owner: '[email protected]',
name: 'Project 400',
description: 'Descricao',
});
promiss
.catch(function (err) {
err.should.not.be.null;
err.should.have.property('code');
err.should.have.property('message');
err.code.should.be.equals(400);
})
.done(function () {
done();
});
});

it('Should not create projects without info', function (done) {
var promiss = helper.createProject({
});
promiss
.catch(function (err) {
err.should.not.be.null;
err.should.have.property('code');
err.should.have.property('message');
err.code.should.be.equals(500);
})
.done(function () {
done();
});
});
});


});

0 comments on commit f1a7bc9

Please sign in to comment.