Fix broken integration test in 1.9.1-p378.

This commit is contained in:
Damian Janowski 2010-04-22 19:09:45 -03:00
parent 80ea640901
commit 438e53c295
2 changed files with 4 additions and 3 deletions

View File

@ -38,7 +38,8 @@ class RackApp < Sinatra::Base
end end
post "/upload" do post "/upload" do
params[:uploaded_file].to_yaml uploaded_file = params[:uploaded_file]
Marshal.dump(:tempfile => uploaded_file[:tempfile].read, :type => uploaded_file[:type], :filename => uploaded_file[:filename])
end end
end end

View File

@ -53,10 +53,10 @@ class WebratRackTest < Test::Unit::TestCase
attach_file "File", __FILE__, "text/ruby" attach_file "File", __FILE__, "text/ruby"
click_button "Upload" click_button "Upload"
upload = YAML.load(response_body) upload = Marshal.load(response_body)
assert_equal "text/ruby", upload[:type] assert_equal "text/ruby", upload[:type]
assert_equal "webrat_rack_test.rb", upload[:filename] assert_equal "webrat_rack_test.rb", upload[:filename]
assert upload[:tempfile].respond_to?(:read) assert_equal File.read(__FILE__), upload[:tempfile]
end end
end end