Methods
- S
- T
-
- test_date_header_when_expires_in,
- test_dynamic_render,
- test_dynamic_render_file_hash,
- test_dynamic_render_with_absolute_path,
- test_dynamic_render_with_file,
- test_expires_in_header,
- test_expires_in_header_with_additional_headers,
- test_expires_in_header_with_must_revalidate,
- test_expires_in_header_with_public,
- test_expires_in_header_with_public_and_must_revalidate,
- test_expires_in_old_syntax,
- test_expires_now,
- test_expires_now_with_cache_control_headers,
- test_permitted_dynamic_render_file_hash,
- test_render_nothing_deprecated
Instance Public methods
setup()
Link
test_date_header_when_expires_in()
Link
test_dynamic_render()
Link
# 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()
Link
test_dynamic_render_with_absolute_path()
Link
# 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()
Link
# 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()
Link
test_expires_in_header_with_additional_headers()
Link
test_expires_in_header_with_must_revalidate()
Link
test_expires_in_header_with_public()
Link
test_expires_in_header_with_public_and_must_revalidate()
Link
# 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()
Link
test_expires_now()
Link
test_expires_now_with_cache_control_headers()
Link
# 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()
Link
# 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