diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-04-01 01:43:44 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-04-01 01:43:44 -0700 |
commit | ef9a2f05f3e14455dc70a5e0f68b0cf317a8709c (patch) | |
tree | 7d3d3831c66d99a2235d6c0ff9b1159f4238b164 /test/rails/app-1.2.3/app/controllers/foo_controller.rb | |
parent | b2569b344d61a7d26033aeb6198d23f99d2e7f3e (diff) | |
download | unicorn-ef9a2f05f3e14455dc70a5e0f68b0cf317a8709c.tar.gz |
Additional tests for Rails have been added * cookies and sessions * POST requests * POST requests with multipart uploads * 404 handling * static file serving * cached static file serving (resources with ";" caching in some old 1.2.x version not yet tested)
Diffstat (limited to 'test/rails/app-1.2.3/app/controllers/foo_controller.rb')
-rw-r--r-- | test/rails/app-1.2.3/app/controllers/foo_controller.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/rails/app-1.2.3/app/controllers/foo_controller.rb b/test/rails/app-1.2.3/app/controllers/foo_controller.rb index 7602947..8d877d1 100644 --- a/test/rails/app-1.2.3/app/controllers/foo_controller.rb +++ b/test/rails/app-1.2.3/app/controllers/foo_controller.rb @@ -1,5 +1,34 @@ +require 'digest/sha1' class FooController < ApplicationController def index render :text => "FOO\n" end + + def xcookie + cookies["foo"] = "cookie #$$" + render :text => "" + end + + def xnotice + flash[:notice] = "session #$$" + render :text => "" + end + + def xpost + if request.post? + digest = Digest::SHA1.new + out = "params: #{params.inspect}\n" + if file = params[:file] + loop do + buf = file.read(4096) or break + digest.update(buf) + end + out << "sha1: #{digest.to_s}\n" + end + headers['content-type'] = 'text/plain' + render :text => out + else + render :status => 403, :text => "need post\n" + end + end end |