<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/mack/testing/file.rb</filename>
    </added>
    <added>
      <filename>test/fake_application/app/views/tst_another/upload_successful.html.erb</filename>
    </added>
    <added>
      <filename>test/unit/controller/file_upload_spec.rb</filename>
    </added>
    <added>
      <filename>test/unit/controller/images/homer_brain.jpg</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -82,10 +82,40 @@ module Mack
       def put(uri, options = {})
         build_response(request.put(uri, build_request_options({:input =&gt; options.to_params})))
       end
+      
+      def build_file(path)
+        return Mack::Testing::FileWrapper.new(path)
+      end
     
       # Performs a 'post' request for the specified uri.
       def post(uri, options = {})
-        build_response(request.post(uri, build_request_options({:input =&gt; options.to_params})))
+        if options[:multipart]
+          form_input = &quot;&quot;
+          boundary = &quot;--Mack-boundary\r\n&quot;
+          options.each_pair do |k, v|
+            if v.kind_of?(Mack::Testing::FileWrapper)
+              form_input += boundary
+              form_input += &quot;content-disposition: form-data; name=\&quot;#{k}\&quot;; filename=\&quot;#{v.file_name}\&quot;\r\n&quot;
+              form_input += &quot;Content-Type: application/octet-stream\r\n\r\n&quot;
+              form_input += &quot;#{v.content}\r\n&quot;
+            elsif k != :multipart 
+              form_input += boundary
+              form_input += &quot;content-disposition: form-data; name=\&quot;#{k}\&quot;\r\n&quot;
+              form_input += &quot;Content-Type: text/plain\r\n\r\n&quot;
+              form_input += &quot;#{v}\r\n&quot;
+            end
+          end
+          
+          form_input += boundary + &quot;\r\n&quot;
+          # request.env_for(&quot;/&quot;,
+          #                 &quot;CONTENT_TYPE&quot; =&gt; &quot;multipart/form-data, boundary=AaB03x&quot;,
+          #                 &quot;CONTENT_LENGTH&quot; =&gt; form_input.size)
+          # build_response(request.post(uri, build_request_options({:input =&gt; form_input})))
+          build_response(request.post(uri, build_request_options({&quot;CONTENT_TYPE&quot; =&gt; &quot;multipart/form-data, boundary=Mack-boundary&quot;, &quot;CONTENT_LENGTH&quot; =&gt; form_input.size, :input =&gt; form_input})))
+          # build_response(request.post(uri, build_request_options({:content_type =&gt; &quot;multipart/form-data, boundary=Mack-boundary&quot;, :content_length =&gt; form_input.size, :input =&gt; form_input})))
+        else
+          build_response(request.post(uri, build_request_options({:input =&gt; options.to_params})))
+        end
       end
     
       # Performs a 'delete' request for the specified uri.</diff>
      <filename>lib/mack/testing/helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -48,6 +48,13 @@ class TstAnotherController
     render(:text, love_you)
   end
   
+  def do_upload
+    debugger
+    file = request.file(&quot;file0&quot;)
+    @saved_file_name = file.file_name
+    redirect_to(upload_successful_url)
+  end
+  
   def regardless_of_string_or_symbol
     x = &quot;&quot;
     x &lt;&lt; &quot;from_string: foo=#{params[&quot;foo&quot;]}\n&quot;</diff>
      <filename>test/fake_application/app/controllers/tst_another_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,6 +24,8 @@ Mack::Routes.build do |r|
     map.env '/env', :action =&gt; :env
     map.kill_kenny_no_meth &quot;/tst_another/kill_kenny&quot;, :action =&gt; :kill_kenny
     map.kill_kenny_bad &quot;/tst_another/kill_kenny_bad&quot;, :action =&gt; :kill_kenny_bad
+    map.upload_file &quot;/tst_another/do_upload&quot;, :action =&gt; :do_upload
+    map.upload_successful &quot;/tst_another/upload_successful&quot;
   end
   
   r.with_options(:controller =&gt; &quot;vtt/view_template&quot;) do |map|</diff>
      <filename>test/fake_application/config/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -52,7 +52,7 @@ describe Mack::Request::UploadedFile do
     File.exists?(File.join(Mack.root, &quot;tmp&quot;, @uploaded_file.file_name)).should == true
     File.exists?(@uploaded_file.temp_file.path).should_not == true
   end
-  
+    
   it &quot;should raise error when destination path is not specified&quot; do
     lambda { @uploaded_file.save }.should raise_error(ArgumentError)
   end</diff>
      <filename>test/unit/controller/uploaded_file_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8668bae7524d50409d2464eedbcf0dcc040d616e</id>
    </parent>
  </parents>
  <author>
    <name>dsutedja</name>
    <email>dsutedja@helium.com</email>
  </author>
  <url>http://github.com/markbates/mack/commit/e8b236b2ef78a838448edc36d4141985620bceb6</url>
  <id>e8b236b2ef78a838448edc36d4141985620bceb6</id>
  <committed-date>2008-08-14T19:56:03-07:00</committed-date>
  <authored-date>2008-08-14T19:56:03-07:00</authored-date>
  <message>file upload testing</message>
  <tree>c361910a9ac07c4743bfb19e21a74929d09c4892</tree>
  <committer>
    <name>dsutedja</name>
    <email>dsutedja@helium.com</email>
  </committer>
</commit>
