mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
make sure set_response! sets the correct response object
This commit is contained in:
parent
08b107e345
commit
619e7c8db8
2 changed files with 15 additions and 0 deletions
|
@ -111,5 +111,14 @@ module ActionController # :nodoc:
|
|||
|
||||
@_response.await_commit
|
||||
end
|
||||
|
||||
def set_response!(request)
|
||||
if request.env["HTTP_VERSION"] == "HTTP/1.0"
|
||||
super
|
||||
else
|
||||
@_response = Live::Response.new
|
||||
@_response.request = request
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -53,6 +53,12 @@ module ActionController
|
|||
TestResponse.new
|
||||
end
|
||||
|
||||
def test_set_response!
|
||||
@controller.set_response!(@request)
|
||||
assert_kind_of(Live::Response, @controller.response)
|
||||
assert_equal @request, @controller.response.request
|
||||
end
|
||||
|
||||
def test_write_to_stream
|
||||
@controller = TestController.new
|
||||
get :basic_stream
|
||||
|
|
Loading…
Reference in a new issue