 				@fs.createReadStream.returns
 					pipe:->
 					on: (type, cb)->
-						if type == "end"
+						if type == "open"
 							cb()
 				@handler.uploadFileFromDisk @project_id, @file_id, @fsPath, (err) =>
 					expect(err).to.exist

			@fs.createReadStream.returns 
				pipe:->
				on: (type, cb)-> 
					if type == "end"
						cb()
			@handler.uploadFileFromDisk @project_id, @file_id, @fsPath, =>
				@request.args[0][0].method.should.equal "post"

			@fs.createReadStream.returns
				pipe:->
				on: (type, cb)->
					if type == "open"
						cb()
			@handler.uploadFileFromDisk @project_id, @file_id, @fsPath, (err) =>
				expect(err).to.not.exist
