aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-07-27 15:54:11 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2012-07-27 15:54:23 -0700
commitacb6848468bc4ec035201b23af9affeb8279711f (patch)
tree601a3d3e6136d8c06a06c977f2fc839a563600ce /actionpack/test
parentf4d818d51e64a025f78fca15fdae2391ed072656 (diff)
downloadrails-acb6848468bc4ec035201b23af9affeb8279711f.tar.gz
rails-acb6848468bc4ec035201b23af9affeb8279711f.tar.bz2
rails-acb6848468bc4ec035201b23af9affeb8279711f.zip
threads can wait on responses to be committed
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/response_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/response_test.rb b/actionpack/test/dispatch/response_test.rb
index 82d1200f8e..500056b56b 100644
--- a/actionpack/test/dispatch/response_test.rb
+++ b/actionpack/test/dispatch/response_test.rb
@@ -5,6 +5,15 @@ class ResponseTest < ActiveSupport::TestCase
@response = ActionDispatch::Response.new
end
+ def test_can_wait_until_commit
+ t = Thread.new {
+ assert @response.await_commit
+ }
+ @response.commit!
+ assert @response.committed?
+ t.join
+ end
+
def test_response_body_encoding
body = ["hello".encode('utf-8')]
response = ActionDispatch::Response.new 200, {}, body