zevarito / mixpanel

Simple lib to track events in Mixpanel service. It can be used in any rack based framework.
MIT License
273 stars 84 forks source link

Fix for send_file returning 0 bytes #16 #20

Closed bradx3 closed 12 years ago

bradx3 commented 13 years ago

I've checked this worked on our servers, but couldn't get a failing test to commit. This was the best I could do, but it wouldn't fail even without the changes I made. Any ideas?

describe "With attachment responses" do
    before do
      setup_rack_application(DummyApp, :body => nil,
                             :headers => {"Content-Type" => "application/pdf", "Content-Length" => 123})
      get "/"
    end

    it "should leave the body untouched" do
      last_response.body.should == html_document
    end

    it "should not reset the content length" do
      last_response.headers["Content-Length"].should == "123"
    end
  end