diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-02-23 15:37:17 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-02-23 15:37:17 -0800 |
commit | 3345af61fb128d0a70793b235e3cb878781d6f40 (patch) | |
tree | 13f658ed836dc7d8c15eb9486cef39f340496722 /actionpack/test | |
parent | ee541049fdbe5eeebcca2f3b83144a5d803345a9 (diff) | |
download | rails-3345af61fb128d0a70793b235e3cb878781d6f40.tar.gz rails-3345af61fb128d0a70793b235e3cb878781d6f40.tar.bz2 rails-3345af61fb128d0a70793b235e3cb878781d6f40.zip |
Fix streaming by having it create a File object, which can be handled by Rack servers as appropriate
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/send_file_test.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb index 31177223e4..ce144cc24b 100644 --- a/actionpack/test/controller/send_file_test.rb +++ b/actionpack/test/controller/send_file_test.rb @@ -46,15 +46,17 @@ class SendFileTest < ActionController::TestCase response = nil assert_nothing_raised { response = process('file') } assert_not_nil response - assert_kind_of String, response.body - assert_equal file_data, response.body + body = response.body + assert_kind_of String, body + assert_equal file_data, body end def test_file_stream response = nil assert_nothing_raised { response = process('file') } assert_not_nil response - assert_kind_of Array, response.body_parts + assert response.body_parts.respond_to?(:each) + assert response.body_parts.respond_to?(:to_path) require 'stringio' output = StringIO.new @@ -160,6 +162,12 @@ class SendFileTest < ActionController::TestCase assert_equal 500, @response.status end + define_method "test_send_#{method}_content_type" do + @controller.options = { :stream => false, :content_type => "application/x-ruby" } + assert_nothing_raised { assert_not_nil process(method) } + assert_equal "application/x-ruby", @response.content_type + end + define_method "test_default_send_#{method}_status" do @controller.options = { :stream => false } assert_nothing_raised { assert_not_nil process(method) } |