Methods
S
T
Instance Public methods
setup()
# File actionpack/test/controller/render_test.rb, line 300
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 387
def test_date_header_when_expires_in
  time = Time.mktime(2011,10,30)
  Time.stubs(:now).returns(time)
  get :conditional_hello_with_expires_in
  assert_equal Time.now.httpdate, @response.headers["Date"]
end
test_dynamic_render()
# File actionpack/test/controller/render_test.rb, line 325
def test_dynamic_render
  assert File.exist?(File.join(File.dirname(__FILE__), '../../test/abstract_unit.rb'))
  assert_raises ActionView::MissingTemplate do
    get :dynamic_render, { id: '../\../test/abstract_unit.rb' }
  end
end
test_dynamic_render_file_hash()
# File actionpack/test/controller/render_test.rb, line 339
def test_dynamic_render_file_hash
  e = assert_raises ArgumentError do
    get :dynamic_render, { id: { file: '../\../test/abstract_unit.rb' } }
  end
  assert_equal "render parameters are not permitted", e.message
end
test_dynamic_render_with_absolute_path()
# File actionpack/test/controller/render_test.rb, line 313
def test_dynamic_render_with_absolute_path
  file = Tempfile.new('name')
  file.write "secrets!"
  file.flush
  assert_raises ActionView::MissingTemplate do
    response = get :dynamic_render, { id: file.path }
  end
ensure
  file.close
  file.unlink
end
test_dynamic_render_with_file()
# File actionpack/test/controller/render_test.rb, line 305
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, { 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 346
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 366
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 356
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 351
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 361
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 371
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 376
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 381
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 332
def test_permitted_dynamic_render_file_hash
  assert File.exist?(File.join(File.dirname(__FILE__), '../../test/abstract_unit.rb'))
  response = get :dynamic_render_permit, { id: { file: '../\../test/abstract_unit.rb' } }
  assert_equal File.read(File.join(File.dirname(__FILE__), '../../test/abstract_unit.rb')),
    response.body
end