 SandboxedModule = require('sandboxed-module')
 ObjectId = require("mongojs").ObjectId
 Errors = require "../../../app/js/Errors"
+crypto = require("crypto")
 
 describe "DocArchiveManager", ->
 


		@error = "my errror"
		@project_id = ObjectId().toString()
		@stubbedError = new Errors.NotFoundError("blew up")

	describe "archiveDoc", ->

		it "should use correct options", (done)->
			@request.put = sinon.stub().callsArgWith(1,  null, statusCode:200)
			@requires["request"] = @request
			@DocArchiveManager = SandboxedModule.require modulePath, requires: @requires


				done()

		it "should return the error", (done)->
			@request.get = sinon.stub().callsArgWith(1, @stubbedError, {}, {})
			@requires["request"] = @request
			@DocArchiveManager = SandboxedModule.require modulePath, requires: @requires

			@DocArchiveManager.unarchiveDoc @project_id, @docs[0], (err)=>
				should.exist err
				done()

	describe "archiveAllDocs", ->
