diff --git a/spec/integration/merb/app/controllers/testing.rb b/spec/integration/merb/app/controllers/testing.rb
index 31ccbeb..14cba1b 100644
--- a/spec/integration/merb/app/controllers/testing.rb
+++ b/spec/integration/merb/app/controllers/testing.rb
@@ -4,6 +4,15 @@ class Testing < Application
render
end
+ def upload
+ case request.method
+ when :get then render
+ when :post then
+ uploaded_file = params[:uploaded_file]
+ render [uploaded_file[:filename], uploaded_file[:tempfile].class.name].inspect
+ end
+ end
+
def submit_form
end
diff --git a/spec/integration/merb/app/views/testing/upload.html.erb b/spec/integration/merb/app/views/testing/upload.html.erb
new file mode 100644
index 0000000..f750c55
--- /dev/null
+++ b/spec/integration/merb/app/views/testing/upload.html.erb
@@ -0,0 +1,9 @@
+
Webrat Form
+
+
\ No newline at end of file
diff --git a/spec/integration/merb/config/router.rb b/spec/integration/merb/config/router.rb
index c57ec70..6ff8c3c 100644
--- a/spec/integration/merb/config/router.rb
+++ b/spec/integration/merb/config/router.rb
@@ -28,6 +28,7 @@
Merb.logger.info("Compiling routes...")
Merb::Router.prepare do
match("/").to(:controller => "testing", :action => "show_form")
+ match("/upload").to(:controller => "testing", :action => "upload")
match("/internal_redirect").to(:controller => "testing", :action => "internal_redirect")
match("/external_redirect").to(:controller => "testing", :action => "external_redirect")
end
diff --git a/spec/integration/merb/spec/webrat_spec.rb b/spec/integration/merb/spec/webrat_spec.rb
index bdaad20..6264dae 100644
--- a/spec/integration/merb/spec/webrat_spec.rb
+++ b/spec/integration/merb/spec/webrat_spec.rb
@@ -29,4 +29,11 @@ describe "Webrat" do
response = visit "/external_redirect"
response.status.should == 302
end
+
+ it "should upload files" do
+ visit "/upload"
+ attach_file "File", __FILE__
+ response = click_button "Upload"
+ response.should contain(%(["webrat_spec.rb", "Tempfile"]))
+ end
end