diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-07-27 15:54:11 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-07-27 15:54:23 -0700 |
commit | acb6848468bc4ec035201b23af9affeb8279711f (patch) | |
tree | 601a3d3e6136d8c06a06c977f2fc839a563600ce /actionpack/test/dispatch | |
parent | f4d818d51e64a025f78fca15fdae2391ed072656 (diff) | |
download | rails-acb6848468bc4ec035201b23af9affeb8279711f.tar.gz rails-acb6848468bc4ec035201b23af9affeb8279711f.tar.bz2 rails-acb6848468bc4ec035201b23af9affeb8279711f.zip |
threads can wait on responses to be committed
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/response_test.rb | 9 |
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 |