aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorThomas Fuchs <thomas@fesch.at>2007-02-09 11:25:37 +0000
committerThomas Fuchs <thomas@fesch.at>2007-02-09 11:25:37 +0000
commitc9108f3e399ad2b81d7001489a4036d69333add5 (patch)
tree10e6a607880e4ea6b8c532638e9ae965941be64f /actionpack/test
parent9daddf0116f2e88153e4473bb9aa5b8edc186963 (diff)
downloadrails-c9108f3e399ad2b81d7001489a4036d69333add5.tar.gz
rails-c9108f3e399ad2b81d7001489a4036d69333add5.tar.bz2
rails-c9108f3e399ad2b81d7001489a4036d69333add5.zip
Add a :url_based_filename => true option to ActionController::Streaming::send_file, which allows URL-based filenames. [Thomas Fuchs]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6142 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/send_file_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb
index e7ebc91676..77f1c3614b 100644
--- a/actionpack/test/controller/send_file_test.rb
+++ b/actionpack/test/controller/send_file_test.rb
@@ -53,6 +53,14 @@ class SendFileTest < Test::Unit::TestCase
assert_nothing_raised { response.body.call(response, output) }
assert_equal file_data, output.string
end
+
+ def test_file_url_based_filename
+ @controller.options = { :url_based_filename => true }
+ response = nil
+ assert_nothing_raised { response = process('file') }
+ assert_not_nil response
+ assert_equal "attachment", response.headers["Content-Disposition"]
+ end
def test_data
response = nil