diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-28 15:22:35 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-28 15:22:43 -0800 |
commit | 30d21dfcb7fafe49b3805b8249454485a90097b6 (patch) | |
tree | c63242b81200e976954bd0802ef3c9f4611b0971 /actionpack/test/controller | |
parent | be6f51a487eb412ca29765aa7e84d2f13a688891 (diff) | |
download | rails-30d21dfcb7fafe49b3805b8249454485a90097b6.tar.gz rails-30d21dfcb7fafe49b3805b8249454485a90097b6.tar.bz2 rails-30d21dfcb7fafe49b3805b8249454485a90097b6.zip |
live controllers should have live responses
detect the type of controller we're testing and return the right type of
response based on that controller. This allows us to stop doing the
weird sleep thing.
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/live_stream_test.rb | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/actionpack/test/controller/live_stream_test.rb b/actionpack/test/controller/live_stream_test.rb index 934915fc5b..5fb066cc51 100644 --- a/actionpack/test/controller/live_stream_test.rb +++ b/actionpack/test/controller/live_stream_test.rb @@ -1,5 +1,6 @@ require 'abstract_unit' require 'active_support/concurrency/latch' +Thread.abort_on_exception = true module ActionController class SSETest < ActionController::TestCase @@ -43,9 +44,7 @@ module ActionController tests SSETestController def wait_for_response_stream_close - while !response.stream.closed? - sleep 0.01 - end + response.stream.await_close end def test_basic_sse @@ -175,16 +174,6 @@ module ActionController tests TestController - class TestResponse < Live::Response - def recycle! - initialize - end - end - - def build_response - TestResponse.new - end - def assert_stream_closed assert response.stream.closed?, 'stream should be closed' end |