aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/integration_test.rb
diff options
context:
space:
mode:
authorRyan Bigg <radarlistener@gmail.com>2008-12-21 13:30:51 +1030
committerRyan Bigg <radarlistener@gmail.com>2008-12-21 13:30:51 +1030
commit4fc9f69e54e649e2bc14a796ad7363426958a5ad (patch)
treef6bb401cb70e449fc79b1754fd46fa4fa71ad5da /actionpack/test/controller/integration_test.rb
parent199f4c54ea3139168a867b7f80ac789a3c29a48d (diff)
parent19939fd4c0d0e4eae4ec71df13228547dba03287 (diff)
downloadrails-4fc9f69e54e649e2bc14a796ad7363426958a5ad.tar.gz
rails-4fc9f69e54e649e2bc14a796ad7363426958a5ad.tar.bz2
rails-4fc9f69e54e649e2bc14a796ad7363426958a5ad.zip
Merge branch 'master' of git@github.com:lifo/docrails
Diffstat (limited to 'actionpack/test/controller/integration_test.rb')
-rw-r--r--actionpack/test/controller/integration_test.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb
index fd985a9a46..c28050fe0d 100644
--- a/actionpack/test/controller/integration_test.rb
+++ b/actionpack/test/controller/integration_test.rb
@@ -373,4 +373,35 @@ class IntegrationProcessTest < ActionController::IntegrationTest
end
end
+class MetalTest < ActionController::IntegrationTest
+ class Poller
+ def self.call(env)
+ if env["PATH_INFO"] =~ /^\/success/
+ [200, {"Content-Type" => "text/plain"}, "Hello World!"]
+ else
+ [404, {"Content-Type" => "text/plain"}, '']
+ end
+ end
+ end
+
+ def setup
+ @integration_session = ActionController::Integration::Session.new(Poller)
+ end
+
+ def test_successful_get
+ get "/success"
+ assert_response 200
+ assert_response :success
+ assert_response :ok
+ assert_equal "Hello World!", response.body
+ end
+
+ def test_failed_get
+ get "/failure"
+ assert_response 404
+ assert_response :not_found
+ assert_equal '', response.body
+ end
+end
+
end