Sha256: f3be7ee8ceb97b78cf15157b8e029f85c2341cd1b8252a37c3c145c5190fe111
Contents?: true
Size: 633 Bytes
Versions: 39
Compression:
Stored size: 633 Bytes
Contents
require 'spec_helper' describe "#upload_file" do it "should upload a multipart_file", :real_only do requests = [] canary = lambda { |env| requests << Rack::Request.new(env); [200, {}, []] } client = Ey::Core::Client.new(adapter: [:rack, canary], token: "blah") begin file = Tempfile.new('foo') file.write("bar") file.close client.upload_file(:file => file.path) ensure file.close file.unlink # deletes the temp file end request = requests.first expect(request.content_type).to eq("multipart/form-data") expect(request.body.read).to eq("bar") end end
Version data entries
39 entries across 39 versions & 2 rubygems