aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/send_file_test.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-11-28 10:31:56 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-11-28 10:31:56 -0200
commit9d97ef8f21ac583838230599fdbf812b27a5bc45 (patch)
tree37b41e2dab29653e4cdab77dacf46ec5947ababd /actionpack/test/controller/send_file_test.rb
parent06cc38a2b0d4778746e8a2a2e2b6aa07e1c1c075 (diff)
parent9c33cb26f409845cde5cd5f4298a94ac8a887f1d (diff)
downloadrails-9d97ef8f21ac583838230599fdbf812b27a5bc45.tar.gz
rails-9d97ef8f21ac583838230599fdbf812b27a5bc45.tar.bz2
rails-9d97ef8f21ac583838230599fdbf812b27a5bc45.zip
Merge pull request #8327 from elia/fix-send-data-disposition-with-symbols
Accept symbols as #send_data :disposition value
Diffstat (limited to 'actionpack/test/controller/send_file_test.rb')
-rw-r--r--actionpack/test/controller/send_file_test.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb
index 8f885ff28e..4e4dd8d005 100644
--- a/actionpack/test/controller/send_file_test.rb
+++ b/actionpack/test/controller/send_file_test.rb
@@ -118,6 +118,18 @@ class SendFileTest < ActionController::TestCase
assert_equal 'private', h['Cache-Control']
end
+ def test_send_file_headers_with_disposition_as_a_symbol
+ options = {
+ :type => Mime::PNG,
+ :disposition => :disposition,
+ :filename => 'filename'
+ }
+
+ @controller.headers = {}
+ @controller.send(:send_file_headers!, options)
+ assert_equal 'disposition; filename="filename"', @controller.headers['Content-Disposition']
+ end
+
def test_send_file_headers_with_mime_lookup_with_symbol
options = {
:type => :png
@@ -138,7 +150,7 @@ class SendFileTest < ActionController::TestCase
@controller.headers = {}
assert_raise(ArgumentError){ @controller.send(:send_file_headers!, options) }
end
-
+
def test_send_file_headers_guess_type_from_extension
{
'image.png' => 'image/png',