aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorSergey Nartimov <just.lest@gmail.com>2012-04-30 10:12:55 +0300
committerSergey Nartimov <just.lest@gmail.com>2012-04-30 10:12:55 +0300
commit9f64f20b8b635f21e47bf7e8432700ed29194f88 (patch)
tree30634edb18e0fef9a2fd5b7f23278a4d6d477eab /actionpack/test/controller
parent24f143789a8989f3bccde14ff28067de25cafd87 (diff)
downloadrails-9f64f20b8b635f21e47bf7e8432700ed29194f88.tar.gz
rails-9f64f20b8b635f21e47bf7e8432700ed29194f88.tar.bz2
rails-9f64f20b8b635f21e47bf7e8432700ed29194f88.zip
allow send_file/send_data to skip disposition header, closes #2973
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/send_file_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb
index 3af17f495c..6fc3556e31 100644
--- a/actionpack/test/controller/send_file_test.rb
+++ b/actionpack/test/controller/send_file_test.rb
@@ -154,6 +154,17 @@ class SendFileTest < ActionController::TestCase
end
end
+ def test_send_file_with_default_content_disposition_header
+ process('data')
+ assert_equal 'attachment', @controller.headers['Content-Disposition']
+ end
+
+ def test_send_file_without_content_disposition_header
+ @controller.options = {:disposition => nil}
+ process('data')
+ assert_nil @controller.headers['Content-Disposition']
+ end
+
%w(file data).each do |method|
define_method "test_send_#{method}_status" do
@controller.options = { :stream => false, :status => 500 }