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

		it "should create read stream", (done)->
			@fs.createReadStream.returns 
				pipe:->
				on: (type, cb)-> 
					if type == "end"
						cb()
			@handler.uploadFileFromDisk @project_id, @file_id, @fsPath, =>
				@fs.createReadStream.calledWith(@fsPath).should.equal true

			@fs.createReadStream.returns 
				pipe:->
				on: (type, cb)-> 
					if type == "open"
						cb()
			@handler.uploadFileFromDisk @project_id, @file_id, @fsPath, =>
				@handler._buildUrl.calledWith(@project_id, @file_id).should.equal true
