<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,4 @@
+* [#101] Update to file upload testing (build_file -&gt; file_for_upload, and multipart support in put)
 * [#96] Distributed Views module now uses file cache
 * [#92] Removed deprecated app_config.orm code.
 * [#91] Fixed Mack blowing up if there is no config/initializers/gems.rb file.</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 require 'base64'
 module Mack
   module Testing
-    class FileWrapper
+    class FileWrapper # :nodoc:
       
       attr_reader :path
       attr_reader :file_name</diff>
      <filename>lib/mack/testing/file.rb</filename>
    </modified>
    <modified>
      <diff>@@ -80,10 +80,16 @@ module Mack
     
       # Performs a 'put' request for the specified uri.
       def put(uri, options = {})
-        build_response(request.put(uri, build_request_options({:input =&gt; options.to_params})))
+        if options[:multipart]
+          form_input = build_multipart_data(options)
+          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})))
+        else
+          build_response(request.put(uri, build_request_options({:input =&gt; options.to_params})))
+        end
       end
       
-      def build_file(path)
+      # create a wrapper object for file upload testing.
+      def file_for_upload(path)
         return Mack::Testing::FileWrapper.new(path)
       end
           </diff>
      <filename>lib/mack/testing/helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ require Pathname(__FILE__).dirname.expand_path.parent.parent + 'spec_helper'
 
 describe &quot;File Upload Request&quot; do
   it &quot;should generate proper multipart content&quot; do
-    post upload_file_url, :multipart =&gt; true, :file0 =&gt; build_file(File.join(File.dirname(__FILE__), &quot;images&quot;, &quot;homer_brain.jpg&quot;)), :album =&gt; 'simpsons'
+    post upload_file_url, :multipart =&gt; true, :file0 =&gt; file_for_upload(File.join(File.dirname(__FILE__), &quot;images&quot;, &quot;homer_brain.jpg&quot;)), :album =&gt; 'simpsons'
     assigns(:saved_file_name).should_not be_nil
     assigns(:saved_file_name).should == &quot;homer_brain.jpg&quot;
     assigns(:album).should_not be_nil
@@ -11,7 +11,7 @@ describe &quot;File Upload Request&quot; do
   end
   
   it &quot;should be able to upload multiple files&quot; do  
-    post upload_multiple_url, :multipart =&gt; true, :file0 =&gt; build_file(File.join(File.dirname(__FILE__), &quot;images&quot;, &quot;homer_brain.jpg&quot;)), :file1 =&gt; build_file(File.join(File.dirname(__FILE__), &quot;images&quot;, &quot;homer_brain2.jpg&quot;))
+    post upload_multiple_url, :multipart =&gt; true, :file0 =&gt; file_for_upload(File.join(File.dirname(__FILE__), &quot;images&quot;, &quot;homer_brain.jpg&quot;)), :file1 =&gt; file_for_upload(File.join(File.dirname(__FILE__), &quot;images&quot;, &quot;homer_brain2.jpg&quot;))
     assigns(:saved_file1).should_not be_nil
     assigns(:saved_file2).should_not be_nil
     assigns(:saved_file1).should == &quot;homer_brain.jpg&quot;</diff>
      <filename>test/unit/controller/file_upload_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>afc26c3570fb97c4509caf7c25ef923d8a46f8d0</id>
    </parent>
  </parents>
  <author>
    <name>dsutedja</name>
    <email>dsutedja@helium.com</email>
  </author>
  <url>http://github.com/markbates/mack/commit/c48498d7606d3484506fc0d9ef5382c561d421c5</url>
  <id>c48498d7606d3484506fc0d9ef5382c561d421c5</id>
  <committed-date>2008-08-18T05:31:41-07:00</committed-date>
  <authored-date>2008-08-18T05:31:41-07:00</authored-date>
  <message>Update to file upload testing [#101 state:resolved]</message>
  <tree>944118836ae8dd7764696c9df7f938753312cfe5</tree>
  <committer>
    <name>dsutedja</name>
    <email>dsutedja@helium.com</email>
  </committer>
</commit>
