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

			@request.returns(@writeStream)
			@fs.createReadStream.returns 
				on: (type, cb)-> 
					if type == "open"
						cb()
				pipe:(o)=>
					@writeStream.should.equal o
