Methods
- P
- S
- T
Included Modules
Instance Public methods
public_path()
Link
setup()
Link
test_custom_handler_called_when_file_is_outside_root()
Link
# File actionpack/test/dispatch/static_test.rb, line 270 def test_custom_handler_called_when_file_is_outside_root filename = 'shared.html.erb' assert File.exist?(File.join(@root, '..', filename)) env = { "REQUEST_METHOD"=>"GET", "REQUEST_PATH"=>"/..%2F#{filename}", "PATH_INFO"=>"/..%2F#{filename}", "REQUEST_URI"=>"/..%2F#{filename}", "HTTP_VERSION"=>"HTTP/1.1", "SERVER_NAME"=>"localhost", "SERVER_PORT"=>"8080", "QUERY_STRING"=>"" } assert_equal(DummyApp.call(nil), @app.call(env)) end
test_non_default_static_index()
Link
# File actionpack/test/dispatch/static_test.rb, line 286 def test_non_default_static_index @app = ActionDispatch::Static.new(DummyApp, @root, index: "other-index") assert_html "/other-index.html", get("/other-index.html") assert_html "/other-index.html", get("/other-index") assert_html "/other-index.html", get("/") assert_html "/other-index.html", get("") assert_html "/foo/other-index.html", get("/foo/other-index.html") assert_html "/foo/other-index.html", get("/foo/other-index") assert_html "/foo/other-index.html", get("/foo/") assert_html "/foo/other-index.html", get("/foo") end