diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-01-14 00:18:19 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-01-14 00:20:32 -0200 |
commit | 50454559f8739ef70ac8b7ab6e885d033519c10d (patch) | |
tree | 423912563aa89998d1e6856afe7242b211710576 /railties/test | |
parent | 9b84dd4b28df6c3d8eacd93d1262f897d429eb78 (diff) | |
download | rails-50454559f8739ef70ac8b7ab6e885d033519c10d.tar.gz rails-50454559f8739ef70ac8b7ab6e885d033519c10d.tar.bz2 rails-50454559f8739ef70ac8b7ab6e885d033519c10d.zip |
Add regression test to #8907
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/middleware/static_test.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/railties/test/application/middleware/static_test.rb b/railties/test/application/middleware/static_test.rb new file mode 100644 index 0000000000..0a793f8f60 --- /dev/null +++ b/railties/test/application/middleware/static_test.rb @@ -0,0 +1,31 @@ +# encoding: utf-8 +require 'isolation/abstract_unit' +require 'rack/test' + +module ApplicationTests + class MiddlewareStaticTest < ActiveSupport::TestCase + include ActiveSupport::Testing::Isolation + include Rack::Test::Methods + + def setup + build_app + FileUtils.rm_rf "#{app_path}/config/environments" + end + + def teardown + teardown_app + end + + # Regression test to #8907 + # See https://github.com/rails/rails/commit/9cc82b77196d21a5c7021f6dca59ab9b2b158a45#commitcomment-2416514 + test "doesn't set Cache-Control header when it is nil" do + app_file "public/foo.html", 'static' + + require "#{app_path}/config/environment" + + get 'foo' + + assert_not last_response.headers.has_key?('Cache-Control'), "Cache-Control should not be set" + end + end +end |