aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/live_stream_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* re-raise error if error occurs before committing in streamingKevin Casey2014-03-141-0/+19
| | | | update the tests, using an if-else
* use the body proxy to freeze headersAaron Patterson2014-03-121-2/+4
| | | | | | avoid freezing the headers until the web server has actually read data from the body proxy. Once the webserver has read data, then we should throw an error if someone tries to set a header
* only write the jar if the response isn't committedAaron Patterson2014-03-121-0/+13
| | | | | | | | | | | when streaming responses, we need to make sure the cookie jar is written to the headers before returning up the stack. This commit introduces a new method on the response object that writes the cookie jar to the headers as the response is committed. The middleware and test framework will not write the cookie headers if the response has already been committed. fixes #14352
* make sure we wait for the threads to shut down before asserting closureAaron Patterson2014-02-281-0/+1
|
* use built-in exception handling in live controllersAaron Patterson2014-02-281-15/+17
| | | | | | when an exception happens in an action before the response has been committed, then we should re-raise the exception in the main thread. This lets us reuse the existing exception handling.
* live controllers should have live responsesAaron Patterson2014-02-281-13/+2
| | | | | | 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.
* set the error callback to a nice default in case nobody set an error ↵Aaron Patterson2014-02-281-0/+7
| | | | callback and an error happens
* Correct prestreaming controller response status.Kevin Casey2014-02-151-0/+18
| | | | | | if the controller action has not yet streamed any data, actions should process as normal, and errors should trigger the appropriate behavior (500, or in the case of ActionController::BadRequest, a 400 Bad Request)
* Merge pull request #11443 from wangjohn/sse_reloader_classSantiago Pastorino2013-08-191-0/+88
|\ | | | | SSE class for ActionController::Live
| * Creating an SSE class to be used with ActionController::Live.wangjohn2013-07-301-0/+88
| |
* | Add timeout to test_async_streamGaurish Sharma2013-08-021-1/+1
|/ | | | | | | | | | Without timeout: this test executed infinitely on JRuby Passes on MRI With Timeout: this test gracefully fails on JRuby Passes on MRI, tested on v2.0 & v1.9.3
* Exception handling for controllers using ActionController::LiveSean Griffin2013-03-181-1/+75
| | | | | | | | | Any exceptions that occured at the view or controller level for a controller using ActionController::Live would cause the server to either hang with an open socket indefinitely, or immediately crash (depending on whether the server was launched with rails s or directly). Changed the behavior of exceptions to act the same as streaming templates for html requests, and allow for an on_error callback if needed.
* Handle conditional get in live requests - this will prevent error when using ↵Bernard Potocki2013-03-141-0/+15
| | | | stale on live streams(issue #9636)
* Alias refute methods to assert_not and perfer assert_not on testsRafael Mendonça França2012-12-311-1/+1
|
* make sure the body finishes rendering before checking response closureAaron Patterson2012-08-031-1/+2
|
* close the response when the response body is set so that normal render calls ↵Aaron Patterson2012-07-291-0/+9
| | | | will work
* header hash is duped before being sent up the rack stackAaron Patterson2012-07-291-0/+13
|
* make sure set_response! sets the correct response objectAaron Patterson2012-07-291-0/+6
|
* Controller actions are processed in a separate thread for liveAaron Patterson2012-07-291-3/+69
| | | | | | | | | | responses. Processing controller actions in a separate thread allows us to work around the rack api - we can allow the user to set status and headers, then block until the first bytes are written. As soon as the first bytes are written, the main thread can return the status, headers, and (essentially) a queue for the body.
* added live responses which can be written and read in separate threadsAaron Patterson2012-07-291-0/+26