Skip to content

Commit

Permalink
Add regression test to rails#8907
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Jan 14, 2013
1 parent 9b84dd4 commit 5045455
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions railties/test/application/middleware/static_test.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5045455

Please sign in to comment.