Methods
S
T
Instance Public methods
setup()
# File actionpack/test/controller/render_test.rb, line 267
def setup
  super
  ActionController::Base.view_paths.paths.each(&:clear_cache)
end
test_date_header_when_expires_in()
# File actionpack/test/controller/render_test.rb, line 360
def test_date_header_when_expires_in
  time = Time.mktime(2011,10,30)
  Time.stub :now, time do
    get :conditional_hello_with_expires_in
    assert_equal Time.now.httpdate, @response.headers["Date"]
  end
end
test_dynamic_render()
# File actionpack/test/controller/render_test.rb, line 292
def test_dynamic_render
  assert File.exist?(File.join(File.dirname(__FILE__), '../../test/abstract_unit.rb'))
  assert_raises ActionView::MissingTemplate do
    get :dynamic_render, params: { id: '../\../test/abstract_unit.rb' }
  end
end
test_dynamic_render_file_hash()
# File actionpack/test/controller/render_test.rb, line 307
def test_dynamic_render_file_hash
  assert_raises ArgumentError do
    get :dynamic_render, params: { id: { file: '../\../test/abstract_unit.rb' } }
  end
end
test_dynamic_render_with_absolute_path()
# File actionpack/test/controller/render_test.rb, line 280
def test_dynamic_render_with_absolute_path
  file = Tempfile.new('name')
  file.write "secrets!"
  file.flush
  assert_raises ActionView::MissingTemplate do
    get :dynamic_render, params: { id: file.path }
  end
ensure
  file.close
  file.unlink
end
test_dynamic_render_with_file()
# File actionpack/test/controller/render_test.rb, line 272
def test_dynamic_render_with_file
  # This is extremely bad, but should be possible to do.
  assert File.exist?(File.join(File.dirname(__FILE__), '../../test/abstract_unit.rb'))
  response = get :dynamic_render_with_file, params: { id: '../\../test/abstract_unit.rb' }
  assert_equal File.read(File.join(File.dirname(__FILE__), '../../test/abstract_unit.rb')),
    response.body
end
test_expires_in_header()
# File actionpack/test/controller/render_test.rb, line 313
def test_expires_in_header
  get :conditional_hello_with_expires_in
  assert_equal "max-age=60, private", @response.headers["Cache-Control"]
end
test_expires_in_header_with_additional_headers()
# File actionpack/test/controller/render_test.rb, line 333
def test_expires_in_header_with_additional_headers
  get :conditional_hello_with_expires_in_with_public_with_more_keys
  assert_equal "max-age=60, public, s-maxage=18000", @response.headers["Cache-Control"]
end
test_expires_in_header_with_must_revalidate()
# File actionpack/test/controller/render_test.rb, line 323
def test_expires_in_header_with_must_revalidate
  get :conditional_hello_with_expires_in_with_must_revalidate
  assert_equal "max-age=60, private, must-revalidate", @response.headers["Cache-Control"]
end
test_expires_in_header_with_public()
# File actionpack/test/controller/render_test.rb, line 318
def test_expires_in_header_with_public
  get :conditional_hello_with_expires_in_with_public
  assert_equal "max-age=60, public", @response.headers["Cache-Control"]
end
test_expires_in_header_with_public_and_must_revalidate()
# File actionpack/test/controller/render_test.rb, line 328
def test_expires_in_header_with_public_and_must_revalidate
  get :conditional_hello_with_expires_in_with_public_and_must_revalidate
  assert_equal "max-age=60, public, must-revalidate", @response.headers["Cache-Control"]
end
test_expires_in_old_syntax()
# File actionpack/test/controller/render_test.rb, line 338
def test_expires_in_old_syntax
  get :conditional_hello_with_expires_in_with_public_with_more_keys_old_syntax
  assert_equal "max-age=60, public, s-maxage=18000", @response.headers["Cache-Control"]
end
test_expires_now()
# File actionpack/test/controller/render_test.rb, line 343
def test_expires_now
  get :conditional_hello_with_expires_now
  assert_equal "no-cache", @response.headers["Cache-Control"]
end
test_expires_now_with_cache_control_headers()
# File actionpack/test/controller/render_test.rb, line 348
def test_expires_now_with_cache_control_headers
  get :conditional_hello_with_cache_control_headers
  assert_match(/no-cache/, @response.headers["Cache-Control"])
  assert_match(/no-transform/, @response.headers["Cache-Control"])
end
test_permitted_dynamic_render_file_hash()
# File actionpack/test/controller/render_test.rb, line 299
def test_permitted_dynamic_render_file_hash
  skip "FIXME: this test passes on 4-2-stable but not master. Why?"
  assert File.exist?(File.join(File.dirname(__FILE__), '../../test/abstract_unit.rb'))
  response = get :dynamic_render_permit, params: { id: { file: '../\../test/abstract_unit.rb' } }
  assert_equal File.read(File.join(File.dirname(__FILE__), '../../test/abstract_unit.rb')),
    response.body
end
test_render_nothing_deprecated()
# File actionpack/test/controller/render_test.rb, line 354
def test_render_nothing_deprecated
  assert_deprecated do
    get :respond_with_empty_body
  end
end