fulcrum-app
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -16,3 +16,7 @@ var _ = require('lodash'); | ||
_.extend(Projects.prototype, mixins.searchable); | ||
_.extend(Projects.prototype, mixins.findable); | ||
_.extend(Projects.prototype, mixins.creatable); | ||
_.extend(Projects.prototype, mixins.updatable); | ||
_.extend(Projects.prototype, mixins.deletable); | ||
module.exports = Projects; |
{ | ||
"name": "fulcrum-app", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "JavaScript wrapper for the Fulcrum API", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -8,2 +8,14 @@ var assert = require('assert'); | ||
describe('Projects', function(){ | ||
describe('#find()', function(){ | ||
it('should return a project.', function(done){ | ||
var nocker = nock('https://api.fulcrumapp.com') | ||
.get('/api/v2/projects/d68c7034-9f5c-4045-b374-d4952ec9d9eb') | ||
.replyWithFile(200, __dirname + '/objects/project.json'); | ||
client.projects.find('d68c7034-9f5c-4045-b374-d4952ec9d9eb', function(error, project) { | ||
assert.ifError(error); | ||
assert.equal(project.project.id, 'd68c7034-9f5c-4045-b374-d4952ec9d9eb', 'project.id is incorrect.'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
@@ -24,2 +36,51 @@ describe('#search()', function(){ | ||
describe('#delete()', function(){ | ||
it('should not return an error if deleted.', function(done){ | ||
var nocker = nock('https://api.fulcrumapp.com') | ||
.delete('/api/v2/projects/d68c7034-9f5c-4045-b374-d4952ec9d9eb') | ||
.reply(204); | ||
client.projects.delete('d68c7034-9f5c-4045-b374-d4952ec9d9eb', function(error) { | ||
assert.ifError(error); | ||
done(); | ||
}); | ||
}); | ||
it('should return an error if no project is found.', function(done){ | ||
var nocker = nock('https://api.fulcrumapp.com') | ||
.delete('/api/v2/projects/d68c7034-9f5c-4045-b374-d4952ec9d9eb') | ||
.reply(404); | ||
client.projects.delete('d68c7034-9f5c-4045-b374-d4952ec9d9eb', function(error) { | ||
assert(error, 'error is not an error.'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
describe('#create()', function(){ | ||
it('should return a project.', function(done){ | ||
var project_to_post = JSON.parse(fs.readFileSync(__dirname + '/objects/project.json')); | ||
var nocker = nock('https://api.fulcrumapp.com') | ||
.post('/api/v2/projects', project_to_post) | ||
.replyWithFile(201, __dirname + '/objects/project.json'); | ||
client.projects.create(project_to_post, function(error, project) { | ||
assert.ifError(error); | ||
assert.equal(project.project.id, 'd68c7034-9f5c-4045-b374-d4952ec9d9eb', 'project.id is incorrect.'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
describe('#update()', function(){ | ||
it('should return a project.', function(done){ | ||
var project_to_put = JSON.parse(fs.readFileSync(__dirname + '/objects/project.json')); | ||
var nocker = nock('https://api.fulcrumapp.com') | ||
.put('/api/v2/projects/d68c7034-9f5c-4045-b374-d4952ec9d9eb', project_to_put) | ||
.replyWithFile(200, __dirname + '/objects/project.json'); | ||
client.projects.update('d68c7034-9f5c-4045-b374-d4952ec9d9eb', project_to_put, function(error, project) { | ||
assert.ifError(error); | ||
assert.equal(project.project.id, 'd68c7034-9f5c-4045-b374-d4952ec9d9eb', 'project.id is incorrect.'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
546427
61
15347
1