@@ -93,21 +93,28 @@ def disposition(params)
9393 let ( :params ) do
9494 [
9595 [ "metadata" , %(filename=first.txt) ] ,
96- [ "file" , HTTP ::FormData ::File . new ( StringIO . new ( "uno" ) , :content_type => ' plain/text' , :filename => "stream-123 " ) ] ,
96+ [ "file" , HTTP ::FormData ::File . new ( StringIO . new ( "uno" ) , :content_type => " plain/text" , :filename => "abc " ) ] ,
9797 [ "metadata" , %(filename=second.txt) ] ,
98- [ "file" , HTTP ::FormData ::File . new ( StringIO . new ( "dos" ) , :content_type => ' plain/text' , :filename => "stream-456 " ) ]
98+ [ "file" , HTTP ::FormData ::File . new ( StringIO . new ( "dos" ) , :content_type => " plain/text" , :filename => "xyz " ) ]
9999 ]
100100 end
101101
102102 it "allows duplicate param names and preservesd given order" do
103- # form_data.boundary
104-
105103 expect ( form_data . to_s ) . to eq ( [
106104 %(--#{ form_data . boundary } #{ crlf } ) ,
105+ %(Content-Disposition: form-data; name="metadata"#{ crlf } ) ,
106+ %(#{ crlf } filename=first.txt#{ crlf } ) ,
107+ %(--#{ form_data . boundary } #{ crlf } ) ,
108+ %(Content-Disposition: form-data; name="file"; filename="abc"#{ crlf } ) ,
109+ %(Content-Type: plain/text#{ crlf } ) ,
110+ %(#{ crlf } uno#{ crlf } ) ,
107111 %(Content-Disposition: form-data; name="metadata"#{ crlf } #{ crlf } ) ,
108- %(filename=first .txt#{ crlf } ) ,
112+ %(filename=second .txt#{ crlf } ) ,
109113 %(--#{ form_data . boundary } #{ crlf } ) ,
110- %(--#{ boundary_value } --#{ crlf } )
114+ %(Content-Disposition: form-data; name="file"; filename="xyz"#{ crlf } ) ,
115+ %(Content-Type: plain/text#{ crlf } ) ,
116+ %(#{ crlf } dos#{ crlf } ) ,
117+ %(--#{ form_data . boundary } --#{ crlf } )
111118 ] . join )
112119 end
113120 end
0 commit comments