Permalink
Browse files

Fixed send_file/binary_content for testing (closes #8044) [tolsen]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8318 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 57c9630 commit 8f24701ae17a6bba0a9e648e38df2d17fb884792 @dhh dhh committed Dec 5, 2007
Showing with 11 additions and 20 deletions.
  1. +1 −13 actionpack/CHANGELOG
  2. +1 −7 actionpack/lib/action_controller/test_process.rb
  3. +9 −0 actionpack/test/controller/test_test.rb
View
@@ -1,18 +1,6 @@
*SVN*
-* Add documentation examples to prototype helper. Closes #7211 [manfred]
-
-* Enhance documentation coverage for fragment caching. Closes #7315 [bscofield]
-
-* Fix typo in number helper docs. Closes #7582 [josh]
-
-* Add many examples to PrototypeHelper documentation. Closes #7656 [jeremymcanally]
-
-* Add many examples to assertion documentation. Closes #7803 [jeremymcanally]
-
-* Document the supported options for sortable_element. Closes #8820 [berkelep]
-
-* Add examples in the documentation for various assertions. Closes #9938 [zapnap]
+* Fixed send_file/binary_content for testing #8044 [tolsen]
* When a NonInferrableControllerError is raised, make the proposed fix clearer in the error message. Closes #10199 [danger]
@@ -270,13 +270,7 @@ def binary_content
require 'stringio'
sio = StringIO.new
-
- begin
- $stdout = sio
- body.call
- ensure
- $stdout = STDOUT
- end
+ body.call(self, sio)
sio.rewind
sio.read
@@ -73,6 +73,10 @@ def test_file_upload
render :text => params[:file].size
end
+ def test_send_file
+ send_file(File.expand_path(__FILE__))
+ end
+
def redirect_to_same_controller
redirect_to :controller => 'test', :action => 'test_uri', :id => 5
end
@@ -542,6 +546,11 @@ def test_redirect_url_only_cares_about_location_header
end
end
+ def test_binary_content_works_with_send_file
+ get :test_send_file
+ assert_nothing_raised(NoMethodError) { @response.binary_content }
+ end
+
protected
def with_foo_routing
with_routing do |set|

0 comments on commit 8f24701

Please sign in to comment.