aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-10-05 16:50:37 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-10-05 16:50:50 -0700
commit69009f4473637a44ade26d954ef5ddea6ff903f2 (patch)
tree4dae45acf6e72e2a6e6e7110c07e8677038fec2c /actionpack/test
parent76698441453821fb175799b99099322688bde6c1 (diff)
downloadrails-69009f4473637a44ade26d954ef5ddea6ff903f2.tar.gz
rails-69009f4473637a44ade26d954ef5ddea6ff903f2.tar.bz2
rails-69009f4473637a44ade26d954ef5ddea6ff903f2.zip
move file sending to the response object
Just a slight refactor that delegates file sending to the response object. This gives us the advantage that if a webserver (in the future) provides a response object that knows how to do accelerated file serving, it can implement this method.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/send_file_test.rb2
-rw-r--r--actionpack/test/dispatch/live_response_test.rb2
2 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb
index c712c75c88..3224d84b58 100644
--- a/actionpack/test/controller/send_file_test.rb
+++ b/actionpack/test/controller/send_file_test.rb
@@ -195,7 +195,7 @@ class SendFileTest < ActionController::TestCase
%w(file data).each do |method|
define_method "test_send_#{method}_status" do
@controller.options = { :stream => false, :status => 500 }
- assert_nothing_raised { assert_not_nil process(method) }
+ assert_not_nil process(method)
assert_equal 500, @response.status
end
diff --git a/actionpack/test/dispatch/live_response_test.rb b/actionpack/test/dispatch/live_response_test.rb
index 1c128365c7..55becc1c91 100644
--- a/actionpack/test/dispatch/live_response_test.rb
+++ b/actionpack/test/dispatch/live_response_test.rb
@@ -83,6 +83,8 @@ module ActionController
def test_headers_cannot_be_written_after_close
@response.stream.close
+ # we can add data until it's actually written, which happens on `each`
+ @response.each { |x| }
e = assert_raises(ActionDispatch::IllegalStateError) do
@response.headers['Content-Length'] = "zomg"