ProjectDetailsHandler.getDetails does not need full project

This commit is contained in:
Henry Oswald 2016-02-26 07:56:26 +00:00
parent 09ac8f8c7a
commit 447568aa91
2 changed files with 3 additions and 3 deletions

View file

@ -8,7 +8,7 @@ _ = require("underscore")
module.exports = module.exports =
getDetails: (project_id, callback)-> getDetails: (project_id, callback)->
ProjectGetter.getProjectWithoutDocLines project_id, (err, project)-> ProjectGetter.getProject project_id, {name:1, description:1, compiler:1, features:1, owner_ref:1}, (err, project)->
if err? if err?
logger.err err:err, project_id:project_id, "error getting project" logger.err err:err, project_id:project_id, "error getting project"
return callback(err) return callback(err)

View file

@ -5,7 +5,7 @@ sinon = require('sinon')
assert = require("chai").assert assert = require("chai").assert
require('chai').should() require('chai').should()
describe 'Project details handler', -> describe 'ProjectDetailsHandler', ->
beforeEach -> beforeEach ->
@project_id = "321l3j1kjkjl" @project_id = "321l3j1kjkjl"
@ -50,7 +50,7 @@ describe 'Project details handler', ->
it "should return the error", (done)-> it "should return the error", (done)->
error = "some error" error = "some error"
@ProjectGetter.getProjectWithoutDocLines.callsArgWith(1, error) @ProjectGetter.getProject.callsArgWith(2, error)
@handler.getDetails @project_id, (err)=> @handler.getDetails @project_id, (err)=>
err.should.equal error err.should.equal error
done() done()