jets 1.4.11 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +3 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +6 -5
- data/jets.gemspec +3 -2
- data/lib/jets.rb +8 -2
- data/lib/jets/builders/tidy.rb +2 -1
- data/lib/jets/commands/db.rb +3 -3
- data/lib/jets/commands/db/tasks.rb +5 -4
- data/lib/jets/generator.rb +3 -2
- data/lib/jets/router.rb +29 -4
- data/lib/jets/router/scope.rb +30 -0
- data/lib/jets/version.rb +1 -1
- data/vendor/rails/Brewfile +13 -0
- data/vendor/rails/CODE_OF_CONDUCT.md +12 -0
- data/vendor/rails/CONTRIBUTING.md +49 -0
- data/vendor/rails/Gemfile +174 -0
- data/vendor/rails/Gemfile.lock +564 -0
- data/vendor/rails/MIT-LICENSE +20 -0
- data/vendor/rails/RAILS_VERSION +1 -0
- data/vendor/rails/README.md +97 -0
- data/vendor/rails/RELEASING_RAILS.md +225 -0
- data/vendor/rails/Rakefile +72 -0
- data/vendor/rails/actionpack/CHANGELOG.md +407 -0
- data/vendor/rails/actionpack/MIT-LICENSE +21 -0
- data/vendor/rails/actionpack/README.rdoc +57 -0
- data/vendor/rails/actionpack/Rakefile +40 -0
- data/vendor/rails/actionpack/actionpack.gemspec +38 -0
- data/vendor/rails/actionpack/bin/test +5 -0
- data/vendor/rails/actionpack/lib/abstract_controller.rb +27 -0
- data/vendor/rails/actionpack/lib/abstract_controller/asset_paths.rb +12 -0
- data/vendor/rails/actionpack/lib/abstract_controller/base.rb +265 -0
- data/vendor/rails/actionpack/lib/abstract_controller/caching.rb +66 -0
- data/vendor/rails/actionpack/lib/abstract_controller/caching/fragments.rb +166 -0
- data/vendor/rails/actionpack/lib/abstract_controller/callbacks.rb +212 -0
- data/vendor/rails/actionpack/lib/abstract_controller/collector.rb +43 -0
- data/vendor/rails/actionpack/lib/abstract_controller/error.rb +6 -0
- data/vendor/rails/actionpack/lib/abstract_controller/helpers.rb +194 -0
- data/vendor/rails/actionpack/lib/abstract_controller/logger.rb +14 -0
- data/vendor/rails/actionpack/lib/abstract_controller/railties/routes_helpers.rb +20 -0
- data/vendor/rails/actionpack/lib/abstract_controller/rendering.rb +127 -0
- data/vendor/rails/actionpack/lib/abstract_controller/translation.rb +31 -0
- data/vendor/rails/actionpack/lib/abstract_controller/url_for.rb +35 -0
- data/vendor/rails/actionpack/lib/action_controller.rb +66 -0
- data/vendor/rails/actionpack/lib/action_controller/api.rb +149 -0
- data/vendor/rails/actionpack/lib/action_controller/api/api_rendering.rb +16 -0
- data/vendor/rails/actionpack/lib/action_controller/base.rb +276 -0
- data/vendor/rails/actionpack/lib/action_controller/caching.rb +46 -0
- data/vendor/rails/actionpack/lib/action_controller/form_builder.rb +50 -0
- data/vendor/rails/actionpack/lib/action_controller/log_subscriber.rb +78 -0
- data/vendor/rails/actionpack/lib/action_controller/metal.rb +256 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/basic_implicit_render.rb +13 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/conditional_get.rb +274 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/content_security_policy.rb +52 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/cookies.rb +16 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/data_streaming.rb +152 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/etag_with_flash.rb +18 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/etag_with_template_digest.rb +57 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/exceptions.rb +53 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/flash.rb +61 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/force_ssl.rb +99 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/head.rb +60 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/helpers.rb +123 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/http_authentication.rb +519 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/implicit_render.rb +73 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/instrumentation.rb +107 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/live.rb +312 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/mime_responds.rb +313 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/parameter_encoding.rb +51 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/params_wrapper.rb +293 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/redirecting.rb +133 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/renderers.rb +181 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/rendering.rb +122 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/request_forgery_protection.rb +445 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/rescue.rb +28 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/streaming.rb +223 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/strong_parameters.rb +1086 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/testing.rb +16 -0
- data/vendor/rails/actionpack/lib/action_controller/metal/url_for.rb +58 -0
- data/vendor/rails/actionpack/lib/action_controller/railtie.rb +89 -0
- data/vendor/rails/actionpack/lib/action_controller/railties/helpers.rb +24 -0
- data/vendor/rails/actionpack/lib/action_controller/renderer.rb +117 -0
- data/vendor/rails/actionpack/lib/action_controller/template_assertions.rb +11 -0
- data/vendor/rails/actionpack/lib/action_controller/test_case.rb +629 -0
- data/vendor/rails/actionpack/lib/action_dispatch.rb +112 -0
- data/vendor/rails/actionpack/lib/action_dispatch/http/cache.rb +220 -0
- data/vendor/rails/actionpack/lib/action_dispatch/http/content_security_policy.rb +272 -0
- data/vendor/rails/actionpack/lib/action_dispatch/http/filter_parameters.rb +84 -0
- data/vendor/rails/actionpack/lib/action_dispatch/http/filter_redirect.rb +37 -0
- data/vendor/rails/actionpack/lib/action_dispatch/http/headers.rb +132 -0
- data/vendor/rails/actionpack/lib/action_dispatch/http/mime_negotiation.rb +170 -0
- data/vendor/rails/actionpack/lib/action_dispatch/http/mime_type.rb +342 -0
- data/vendor/rails/actionpack/lib/action_dispatch/http/mime_types.rb +50 -0
- data/vendor/rails/actionpack/lib/action_dispatch/http/parameter_filter.rb +86 -0
- data/vendor/rails/actionpack/lib/action_dispatch/http/parameters.rb +126 -0
- data/vendor/rails/actionpack/lib/action_dispatch/http/rack_cache.rb +63 -0
- data/vendor/rails/actionpack/lib/action_dispatch/http/request.rb +430 -0
- data/vendor/rails/actionpack/lib/action_dispatch/http/response.rb +520 -0
- data/vendor/rails/actionpack/lib/action_dispatch/http/upload.rb +84 -0
- data/vendor/rails/actionpack/lib/action_dispatch/http/url.rb +350 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey.rb +7 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/formatter.rb +189 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/gtg/builder.rb +164 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/gtg/simulator.rb +41 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb +158 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/nfa/builder.rb +78 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/nfa/dot.rb +36 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/nfa/simulator.rb +49 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/nfa/transition_table.rb +120 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/nodes/node.rb +140 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/parser.rb +199 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/parser.y +50 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/parser_extras.rb +31 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/path/pattern.rb +198 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/route.rb +203 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/router.rb +156 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/router/utils.rb +102 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/routes.rb +82 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/scanner.rb +64 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/visitors.rb +268 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/visualizer/fsm.css +30 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/visualizer/fsm.js +134 -0
- data/vendor/rails/actionpack/lib/action_dispatch/journey/visualizer/index.html.erb +52 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb +36 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/cookies.rb +685 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb +205 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/debug_locks.rb +124 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb +147 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/executor.rb +21 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/flash.rb +300 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/public_exceptions.rb +57 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/reloader.rb +12 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb +183 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/request_id.rb +43 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb +92 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/session/cache_store.rb +54 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb +117 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb +28 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb +62 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/ssl.rb +150 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/stack.rb +116 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/static.rb +130 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +22 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb +23 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.html.erb +27 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.text.erb +8 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb +52 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb +9 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +16 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb +9 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb +21 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb +13 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/layout.erb +161 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb +11 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.text.erb +3 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb +32 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.text.erb +11 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +20 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.text.erb +7 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.html.erb +6 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.text.erb +3 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/routes/_route.html.erb +16 -0
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/routes/_table.html.erb +200 -0
- data/vendor/rails/actionpack/lib/action_dispatch/railtie.rb +55 -0
- data/vendor/rails/actionpack/lib/action_dispatch/request/session.rb +234 -0
- data/vendor/rails/actionpack/lib/action_dispatch/request/utils.rb +78 -0
- data/vendor/rails/actionpack/lib/action_dispatch/routing.rb +260 -0
- data/vendor/rails/actionpack/lib/action_dispatch/routing/endpoint.rb +17 -0
- data/vendor/rails/actionpack/lib/action_dispatch/routing/inspector.rb +225 -0
- data/vendor/rails/actionpack/lib/action_dispatch/routing/mapper.rb +2267 -0
- data/vendor/rails/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +352 -0
- data/vendor/rails/actionpack/lib/action_dispatch/routing/redirection.rb +201 -0
- data/vendor/rails/actionpack/lib/action_dispatch/routing/route_set.rb +890 -0
- data/vendor/rails/actionpack/lib/action_dispatch/routing/routes_proxy.rb +69 -0
- data/vendor/rails/actionpack/lib/action_dispatch/routing/url_for.rb +236 -0
- data/vendor/rails/actionpack/lib/action_dispatch/system_test_case.rb +147 -0
- data/vendor/rails/actionpack/lib/action_dispatch/system_testing/browser.rb +49 -0
- data/vendor/rails/actionpack/lib/action_dispatch/system_testing/driver.rb +59 -0
- data/vendor/rails/actionpack/lib/action_dispatch/system_testing/server.rb +31 -0
- data/vendor/rails/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +96 -0
- data/vendor/rails/actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +31 -0
- data/vendor/rails/actionpack/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb +26 -0
- data/vendor/rails/actionpack/lib/action_dispatch/testing/assertion_response.rb +47 -0
- data/vendor/rails/actionpack/lib/action_dispatch/testing/assertions.rb +24 -0
- data/vendor/rails/actionpack/lib/action_dispatch/testing/assertions/response.rb +107 -0
- data/vendor/rails/actionpack/lib/action_dispatch/testing/assertions/routing.rb +222 -0
- data/vendor/rails/actionpack/lib/action_dispatch/testing/integration.rb +652 -0
- data/vendor/rails/actionpack/lib/action_dispatch/testing/request_encoder.rb +55 -0
- data/vendor/rails/actionpack/lib/action_dispatch/testing/test_process.rb +50 -0
- data/vendor/rails/actionpack/lib/action_dispatch/testing/test_request.rb +71 -0
- data/vendor/rails/actionpack/lib/action_dispatch/testing/test_response.rb +53 -0
- data/vendor/rails/actionpack/lib/action_pack.rb +26 -0
- data/vendor/rails/actionpack/lib/action_pack/gem_version.rb +17 -0
- data/vendor/rails/actionpack/lib/action_pack/version.rb +10 -0
- data/vendor/rails/actionpack/test/abstract/callbacks_test.rb +270 -0
- data/vendor/rails/actionpack/test/abstract/collector_test.rb +65 -0
- data/vendor/rails/actionpack/test/abstract/translation_test.rb +79 -0
- data/vendor/rails/actionpack/test/abstract_unit.rb +457 -0
- data/vendor/rails/actionpack/test/assertions/response_assertions_test.rb +141 -0
- data/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +493 -0
- data/vendor/rails/actionpack/test/controller/api/conditional_get_test.rb +59 -0
- data/vendor/rails/actionpack/test/controller/api/data_streaming_test.rb +28 -0
- data/vendor/rails/actionpack/test/controller/api/force_ssl_test.rb +22 -0
- data/vendor/rails/actionpack/test/controller/api/implicit_render_test.rb +17 -0
- data/vendor/rails/actionpack/test/controller/api/params_wrapper_test.rb +28 -0
- data/vendor/rails/actionpack/test/controller/api/redirect_to_test.rb +21 -0
- data/vendor/rails/actionpack/test/controller/api/renderers_test.rb +50 -0
- data/vendor/rails/actionpack/test/controller/api/url_for_test.rb +22 -0
- data/vendor/rails/actionpack/test/controller/api/with_cookies_test.rb +23 -0
- data/vendor/rails/actionpack/test/controller/api/with_helpers_test.rb +44 -0
- data/vendor/rails/actionpack/test/controller/base_test.rb +323 -0
- data/vendor/rails/actionpack/test/controller/caching_test.rb +511 -0
- data/vendor/rails/actionpack/test/controller/content_type_test.rb +169 -0
- data/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/admin/user_controller.rb +0 -0
- data/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/user_controller.rb +0 -0
- data/vendor/rails/actionpack/test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb +0 -0
- data/vendor/rails/actionpack/test/controller/default_url_options_with_before_action_test.rb +28 -0
- data/vendor/rails/actionpack/test/controller/filters_test.rb +1050 -0
- data/vendor/rails/actionpack/test/controller/flash_hash_test.rb +216 -0
- data/vendor/rails/actionpack/test/controller/flash_test.rb +373 -0
- data/vendor/rails/actionpack/test/controller/force_ssl_test.rb +333 -0
- data/vendor/rails/actionpack/test/controller/form_builder_test.rb +19 -0
- data/vendor/rails/actionpack/test/controller/helper_test.rb +295 -0
- data/vendor/rails/actionpack/test/controller/http_basic_authentication_test.rb +179 -0
- data/vendor/rails/actionpack/test/controller/http_digest_authentication_test.rb +282 -0
- data/vendor/rails/actionpack/test/controller/http_token_authentication_test.rb +216 -0
- data/vendor/rails/actionpack/test/controller/integration_test.rb +1136 -0
- data/vendor/rails/actionpack/test/controller/live_stream_test.rb +518 -0
- data/vendor/rails/actionpack/test/controller/localized_templates_test.rb +48 -0
- data/vendor/rails/actionpack/test/controller/log_subscriber_test.rb +371 -0
- data/vendor/rails/actionpack/test/controller/metal/renderers_test.rb +50 -0
- data/vendor/rails/actionpack/test/controller/metal_test.rb +32 -0
- data/vendor/rails/actionpack/test/controller/mime/accept_format_test.rb +94 -0
- data/vendor/rails/actionpack/test/controller/mime/respond_to_test.rb +843 -0
- data/vendor/rails/actionpack/test/controller/new_base/bare_metal_test.rb +184 -0
- data/vendor/rails/actionpack/test/controller/new_base/base_test.rb +131 -0
- data/vendor/rails/actionpack/test/controller/new_base/content_negotiation_test.rb +28 -0
- data/vendor/rails/actionpack/test/controller/new_base/content_type_test.rb +116 -0
- data/vendor/rails/actionpack/test/controller/new_base/middleware_test.rb +112 -0
- data/vendor/rails/actionpack/test/controller/new_base/render_action_test.rb +314 -0
- data/vendor/rails/actionpack/test/controller/new_base/render_body_test.rb +172 -0
- data/vendor/rails/actionpack/test/controller/new_base/render_context_test.rb +54 -0
- data/vendor/rails/actionpack/test/controller/new_base/render_file_test.rb +72 -0
- data/vendor/rails/actionpack/test/controller/new_base/render_html_test.rb +192 -0
- data/vendor/rails/actionpack/test/controller/new_base/render_implicit_action_test.rb +59 -0
- data/vendor/rails/actionpack/test/controller/new_base/render_layout_test.rb +128 -0
- data/vendor/rails/actionpack/test/controller/new_base/render_partial_test.rb +62 -0
- data/vendor/rails/actionpack/test/controller/new_base/render_plain_test.rb +170 -0
- data/vendor/rails/actionpack/test/controller/new_base/render_streaming_test.rb +116 -0
- data/vendor/rails/actionpack/test/controller/new_base/render_template_test.rb +240 -0
- data/vendor/rails/actionpack/test/controller/new_base/render_test.rb +142 -0
- data/vendor/rails/actionpack/test/controller/new_base/render_xml_test.rb +12 -0
- data/vendor/rails/actionpack/test/controller/output_escaping_test.rb +17 -0
- data/vendor/rails/actionpack/test/controller/parameter_encoding_test.rb +52 -0
- data/vendor/rails/actionpack/test/controller/parameters/accessors_test.rb +324 -0
- data/vendor/rails/actionpack/test/controller/parameters/always_permitted_parameters_test.rb +30 -0
- data/vendor/rails/actionpack/test/controller/parameters/dup_test.rb +67 -0
- data/vendor/rails/actionpack/test/controller/parameters/log_on_unpermitted_params_test.rb +70 -0
- data/vendor/rails/actionpack/test/controller/parameters/multi_parameter_attributes_test.rb +39 -0
- data/vendor/rails/actionpack/test/controller/parameters/mutators_test.rb +122 -0
- data/vendor/rails/actionpack/test/controller/parameters/nested_parameters_permit_test.rb +184 -0
- data/vendor/rails/actionpack/test/controller/parameters/parameters_permit_test.rb +516 -0
- data/vendor/rails/actionpack/test/controller/parameters/raise_on_unpermitted_params_test.rb +33 -0
- data/vendor/rails/actionpack/test/controller/parameters/serialization_test.rb +55 -0
- data/vendor/rails/actionpack/test/controller/params_wrapper_test.rb +422 -0
- data/vendor/rails/actionpack/test/controller/permitted_params_test.rb +27 -0
- data/vendor/rails/actionpack/test/controller/redirect_test.rb +395 -0
- data/vendor/rails/actionpack/test/controller/render_js_test.rb +36 -0
- data/vendor/rails/actionpack/test/controller/render_json_test.rb +137 -0
- data/vendor/rails/actionpack/test/controller/render_test.rb +843 -0
- data/vendor/rails/actionpack/test/controller/render_xml_test.rb +102 -0
- data/vendor/rails/actionpack/test/controller/renderer_test.rb +136 -0
- data/vendor/rails/actionpack/test/controller/renderers_test.rb +91 -0
- data/vendor/rails/actionpack/test/controller/request/test_request_test.rb +42 -0
- data/vendor/rails/actionpack/test/controller/request_forgery_protection_test.rb +1013 -0
- data/vendor/rails/actionpack/test/controller/required_params_test.rb +100 -0
- data/vendor/rails/actionpack/test/controller/rescue_test.rb +364 -0
- data/vendor/rails/actionpack/test/controller/resources_test.rb +1369 -0
- data/vendor/rails/actionpack/test/controller/routing_test.rb +2108 -0
- data/vendor/rails/actionpack/test/controller/runner_test.rb +24 -0
- data/vendor/rails/actionpack/test/controller/send_file_test.rb +259 -0
- data/vendor/rails/actionpack/test/controller/show_exceptions_test.rb +114 -0
- data/vendor/rails/actionpack/test/controller/streaming_test.rb +28 -0
- data/vendor/rails/actionpack/test/controller/test_case_test.rb +1157 -0
- data/vendor/rails/actionpack/test/controller/url_for_integration_test.rb +192 -0
- data/vendor/rails/actionpack/test/controller/url_for_test.rb +519 -0
- data/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +92 -0
- data/vendor/rails/actionpack/test/controller/webservice_test.rb +135 -0
- data/vendor/rails/actionpack/test/dispatch/callbacks_test.rb +47 -0
- data/vendor/rails/actionpack/test/dispatch/content_security_policy_test.rb +525 -0
- data/vendor/rails/actionpack/test/dispatch/cookies_test.rb +1345 -0
- data/vendor/rails/actionpack/test/dispatch/debug_exceptions_test.rb +502 -0
- data/vendor/rails/actionpack/test/dispatch/debug_locks_test.rb +38 -0
- data/vendor/rails/actionpack/test/dispatch/exception_wrapper_test.rb +120 -0
- data/vendor/rails/actionpack/test/dispatch/executor_test.rb +136 -0
- data/vendor/rails/actionpack/test/dispatch/header_test.rb +169 -0
- data/vendor/rails/actionpack/test/dispatch/live_response_test.rb +98 -0
- data/vendor/rails/actionpack/test/dispatch/mapper_test.rb +210 -0
- data/vendor/rails/actionpack/test/dispatch/middleware_stack_test.rb +115 -0
- data/vendor/rails/actionpack/test/dispatch/mime_type_test.rb +187 -0
- data/vendor/rails/actionpack/test/dispatch/mount_test.rb +95 -0
- data/vendor/rails/actionpack/test/dispatch/prefix_generation_test.rb +463 -0
- data/vendor/rails/actionpack/test/dispatch/rack_cache_test.rb +23 -0
- data/vendor/rails/actionpack/test/dispatch/reloader_test.rb +167 -0
- data/vendor/rails/actionpack/test/dispatch/request/json_params_parsing_test.rb +207 -0
- data/vendor/rails/actionpack/test/dispatch/request/multipart_params_parsing_test.rb +202 -0
- data/vendor/rails/actionpack/test/dispatch/request/query_string_parsing_test.rb +176 -0
- data/vendor/rails/actionpack/test/dispatch/request/session_test.rb +165 -0
- data/vendor/rails/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb +181 -0
- data/vendor/rails/actionpack/test/dispatch/request_id_test.rb +75 -0
- data/vendor/rails/actionpack/test/dispatch/request_test.rb +1307 -0
- data/vendor/rails/actionpack/test/dispatch/response_test.rb +542 -0
- data/vendor/rails/actionpack/test/dispatch/routing/concerns_test.rb +124 -0
- data/vendor/rails/actionpack/test/dispatch/routing/custom_url_helpers_test.rb +333 -0
- data/vendor/rails/actionpack/test/dispatch/routing/inspector_test.rb +425 -0
- data/vendor/rails/actionpack/test/dispatch/routing/ipv6_redirect_test.rb +46 -0
- data/vendor/rails/actionpack/test/dispatch/routing/route_set_test.rb +166 -0
- data/vendor/rails/actionpack/test/dispatch/routing_assertions_test.rb +209 -0
- data/vendor/rails/actionpack/test/dispatch/routing_test.rb +5112 -0
- data/vendor/rails/actionpack/test/dispatch/runner_test.rb +19 -0
- data/vendor/rails/actionpack/test/dispatch/session/abstract_store_test.rb +58 -0
- data/vendor/rails/actionpack/test/dispatch/session/cache_store_test.rb +183 -0
- data/vendor/rails/actionpack/test/dispatch/session/cookie_store_test.rb +417 -0
- data/vendor/rails/actionpack/test/dispatch/session/mem_cache_store_test.rb +205 -0
- data/vendor/rails/actionpack/test/dispatch/session/test_session_test.rb +65 -0
- data/vendor/rails/actionpack/test/dispatch/show_exceptions_test.rb +138 -0
- data/vendor/rails/actionpack/test/dispatch/ssl_test.rb +228 -0
- data/vendor/rails/actionpack/test/dispatch/static_test.rb +318 -0
- data/vendor/rails/actionpack/test/dispatch/system_testing/driver_test.rb +54 -0
- data/vendor/rails/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb +81 -0
- data/vendor/rails/actionpack/test/dispatch/system_testing/server_test.rb +32 -0
- data/vendor/rails/actionpack/test/dispatch/system_testing/system_test_case_test.rb +84 -0
- data/vendor/rails/actionpack/test/dispatch/test_request_test.rb +131 -0
- data/vendor/rails/actionpack/test/dispatch/test_response_test.rb +37 -0
- data/vendor/rails/actionpack/test/dispatch/uploaded_file_test.rb +113 -0
- data/vendor/rails/actionpack/test/dispatch/url_generation_test.rb +141 -0
- data/vendor/rails/actionpack/test/fixtures/_top_level_partial_only.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/alternate_helpers/foo_helper.rb +5 -0
- data/vendor/rails/actionpack/test/fixtures/bad_customers/_bad_customer.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/collection_cache/index.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/company.rb +11 -0
- data/vendor/rails/actionpack/test/fixtures/customers/_commented_customer.html.erb +5 -0
- data/vendor/rails/actionpack/test/fixtures/customers/_customer.html.erb +4 -0
- data/vendor/rails/actionpack/test/fixtures/filter_test/implicit_actions/edit.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/filter_test/implicit_actions/show.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/_formatted_partial.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/_partial.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached.html.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached.xml.builder +5 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached_with_variant.html+phone.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached.html.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached_with_options.html.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/html_fragment_cached_with_partial.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/inline_fragment_cached.html.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/xml_fragment_cached_with_html_partial.xml.builder +5 -0
- data/vendor/rails/actionpack/test/fixtures/helpers/abc_helper.rb +5 -0
- data/vendor/rails/actionpack/test/fixtures/helpers/fun/games_helper.rb +7 -0
- data/vendor/rails/actionpack/test/fixtures/helpers/fun/pdf_helper.rb +7 -0
- data/vendor/rails/actionpack/test/fixtures/helpers/just_me_helper.rb +5 -0
- data/vendor/rails/actionpack/test/fixtures/helpers/me_too_helper.rb +5 -0
- data/vendor/rails/actionpack/test/fixtures/helpers1_pack/pack1_helper.rb +7 -0
- data/vendor/rails/actionpack/test/fixtures/helpers2_pack/pack2_helper.rb +7 -0
- data/vendor/rails/actionpack/test/fixtures/helpers_typo/admin/users_helper.rb +6 -0
- data/vendor/rails/actionpack/test/fixtures/implicit_render_test/empty_action_with_mobile_variant.html+mobile.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/implicit_render_test/empty_action_with_template.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/_customers.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/block_with_layout.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/builder.builder +3 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/partial_with_layout.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/standard.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/talk_from_action.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/with_html_partial.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/xhr.html.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/yield.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/load_me.rb +4 -0
- data/vendor/rails/actionpack/test/fixtures/localized/hello_world.de.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/localized/hello_world.en.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/localized/hello_world.it.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/binary_file +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/boundary_problem_file +10 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/bracketed_param +5 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/bracketed_utf8_param +5 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/empty +10 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/hello.txt +1 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/large_text_file +10 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/mixed_files +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/none +9 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/ruby_on_rails.jpg +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/single_parameter +5 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/single_utf8_param +5 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/text_file +10 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/utf8_filename +10 -0
- data/vendor/rails/actionpack/test/fixtures/namespaced/implicit_render_test/hello_world.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/old_content_type/render_default_content_types_for_respond_to.xml.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/old_content_type/render_default_for_builder.builder +1 -0
- data/vendor/rails/actionpack/test/fixtures/old_content_type/render_default_for_erb.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/layouts/post.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/layouts/super_post.iphone.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/post/index.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/post/index.iphone.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.iphone.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/400.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/404.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/500.da.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/500.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/bar.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/bar/index.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/foo/bar.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/foo/baz.css +3 -0
- data/vendor/rails/actionpack/test/fixtures/public/foo/index.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/foo/other-index.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/foo//343/201/223/343/202/223/343/201/253/343/201/241/343/201/257.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/foo//343/201/225/343/202/210/343/201/206/343/201/252/343/202/211.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/foo//343/201/225/343/202/210/343/201/206/343/201/252/343/202/211.html.gz +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/gzip/application-a71b3024f80aea3181c09774ca17e712.js +4 -0
- data/vendor/rails/actionpack/test/fixtures/public/gzip/application-a71b3024f80aea3181c09774ca17e712.js.gz +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/gzip/foo.zoo +4 -0
- data/vendor/rails/actionpack/test/fixtures/public/gzip/foo.zoo.gz +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/index.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/other-index.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/all_types_with_layout.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/custom_constant_handling_without_block.mobile.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.iphone.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/missing.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.iphone.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.xml.builder +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_all.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/variant_any_implicit_render.html+phablet.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/variant_any_implicit_render.html+tablet.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/variant_inline_syntax_without_block.html+phone.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/variant_plus_none_for_format.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/variant_with_implicit_template_rendering.html+mobile.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/ruby_template.ruby +2 -0
- data/vendor/rails/actionpack/test/fixtures/session_autoload_test/session_autoload_test/foo.rb +12 -0
- data/vendor/rails/actionpack/test/fixtures/shared.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/star_star_mime/index.js.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial.js.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.builder +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.xml.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello/hello.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_world.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_world_with_partial.html.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_xml_world.builder +11 -0
- data/vendor/rails/actionpack/test/fixtures/test/implicit_content_type.atom.builder +2 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_file_with_ivar.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_file_with_locals.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/with_implicit_template.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/bar.html +1 -0
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/bar/index.html +1 -0
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/bar.html +1 -0
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/baz.css +3 -0
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/index.html +1 -0
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/other-index.html +1 -0
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo//343/201/223/343/202/223/343/201/253/343/201/241/343/201/257.html +1 -0
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo//343/201/225/343/202/210/343/201/206/343/201/252/343/202/211.html +1 -0
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo//343/201/225/343/202/210/343/201/206/343/201/252/343/202/211.html.gz +0 -0
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/gzip/application-a71b3024f80aea3181c09774ca17e712.js +4 -0
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/gzip/application-a71b3024f80aea3181c09774ca17e712.js.gz +0 -0
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/gzip/foo.zoo +4 -0
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/gzip/foo.zoo.gz +0 -0
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/index.html +1 -0
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/other-index.html +1 -0
- data/vendor/rails/actionpack/test/journey/gtg/builder_test.rb +81 -0
- data/vendor/rails/actionpack/test/journey/gtg/transition_table_test.rb +125 -0
- data/vendor/rails/actionpack/test/journey/nfa/simulator_test.rb +100 -0
- data/vendor/rails/actionpack/test/journey/nfa/transition_table_test.rb +74 -0
- data/vendor/rails/actionpack/test/journey/nodes/symbol_test.rb +19 -0
- data/vendor/rails/actionpack/test/journey/path/pattern_test.rb +286 -0
- data/vendor/rails/actionpack/test/journey/route/definition/parser_test.rb +112 -0
- data/vendor/rails/actionpack/test/journey/route/definition/scanner_test.rb +71 -0
- data/vendor/rails/actionpack/test/journey/route_test.rb +113 -0
- data/vendor/rails/actionpack/test/journey/router/utils_test.rb +48 -0
- data/vendor/rails/actionpack/test/journey/router_test.rb +544 -0
- data/vendor/rails/actionpack/test/journey/routes_test.rb +62 -0
- data/vendor/rails/actionpack/test/lib/controller/fake_controllers.rb +37 -0
- data/vendor/rails/actionpack/test/lib/controller/fake_models.rb +79 -0
- data/vendor/rails/actionpack/test/routing/helper_test.rb +33 -0
- data/vendor/rails/actionview/CHANGELOG.md +122 -0
- data/vendor/rails/actionview/MIT-LICENSE +21 -0
- data/vendor/rails/actionview/README.rdoc +38 -0
- data/vendor/rails/actionview/RUNNING_UJS_TESTS.rdoc +8 -0
- data/vendor/rails/actionview/RUNNING_UNIT_TESTS.rdoc +26 -0
- data/vendor/rails/actionview/Rakefile +136 -0
- data/vendor/rails/actionview/actionview.gemspec +38 -0
- data/vendor/rails/actionview/app/assets/javascripts/MIT-LICENSE +20 -0
- data/vendor/rails/actionview/app/assets/javascripts/README.md +55 -0
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs.coffee +39 -0
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/BANNER.js +5 -0
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/features/confirm.coffee +26 -0
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/features/disable.coffee +82 -0
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/features/method.coffee +34 -0
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/features/remote.coffee +90 -0
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/start.coffee +71 -0
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee +97 -0
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/csp.coffee +4 -0
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/csrf.coffee +25 -0
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/dom.coffee +35 -0
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/event.coffee +68 -0
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/form.coffee +36 -0
- data/vendor/rails/actionview/bin/test +5 -0
- data/vendor/rails/actionview/blade.yml +11 -0
- data/vendor/rails/actionview/coffeelint.json +135 -0
- data/vendor/rails/actionview/lib/action_view.rb +97 -0
- data/vendor/rails/actionview/lib/action_view/base.rb +215 -0
- data/vendor/rails/actionview/lib/action_view/buffers.rb +52 -0
- data/vendor/rails/actionview/lib/action_view/context.rb +36 -0
- data/vendor/rails/actionview/lib/action_view/dependency_tracker.rb +175 -0
- data/vendor/rails/actionview/lib/action_view/digestor.rb +136 -0
- data/vendor/rails/actionview/lib/action_view/flows.rb +76 -0
- data/vendor/rails/actionview/lib/action_view/gem_version.rb +17 -0
- data/vendor/rails/actionview/lib/action_view/helpers.rb +68 -0
- data/vendor/rails/actionview/lib/action_view/helpers/active_model_helper.rb +55 -0
- data/vendor/rails/actionview/lib/action_view/helpers/asset_tag_helper.rb +511 -0
- data/vendor/rails/actionview/lib/action_view/helpers/asset_url_helper.rb +469 -0
- data/vendor/rails/actionview/lib/action_view/helpers/atom_feed_helper.rb +205 -0
- data/vendor/rails/actionview/lib/action_view/helpers/cache_helper.rb +263 -0
- data/vendor/rails/actionview/lib/action_view/helpers/capture_helper.rb +212 -0
- data/vendor/rails/actionview/lib/action_view/helpers/controller_helper.rb +36 -0
- data/vendor/rails/actionview/lib/action_view/helpers/csp_helper.rb +24 -0
- data/vendor/rails/actionview/lib/action_view/helpers/csrf_helper.rb +35 -0
- data/vendor/rails/actionview/lib/action_view/helpers/date_helper.rb +1156 -0
- data/vendor/rails/actionview/lib/action_view/helpers/debug_helper.rb +36 -0
- data/vendor/rails/actionview/lib/action_view/helpers/form_helper.rb +2337 -0
- data/vendor/rails/actionview/lib/action_view/helpers/form_options_helper.rb +887 -0
- data/vendor/rails/actionview/lib/action_view/helpers/form_tag_helper.rb +917 -0
- data/vendor/rails/actionview/lib/action_view/helpers/javascript_helper.rb +94 -0
- data/vendor/rails/actionview/lib/action_view/helpers/number_helper.rb +451 -0
- data/vendor/rails/actionview/lib/action_view/helpers/output_safety_helper.rb +70 -0
- data/vendor/rails/actionview/lib/action_view/helpers/record_tag_helper.rb +23 -0
- data/vendor/rails/actionview/lib/action_view/helpers/rendering_helper.rb +99 -0
- data/vendor/rails/actionview/lib/action_view/helpers/sanitize_helper.rb +177 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tag_helper.rb +313 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags.rb +44 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/base.rb +192 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/check_box.rb +66 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/checkable.rb +18 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/collection_check_boxes.rb +36 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/collection_helpers.rb +119 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/collection_radio_buttons.rb +31 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/collection_select.rb +30 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/color_field.rb +27 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/date_field.rb +15 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/date_select.rb +74 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/datetime_field.rb +32 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/datetime_local_field.rb +21 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/datetime_select.rb +10 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/email_field.rb +10 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/file_field.rb +10 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/grouped_collection_select.rb +31 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/hidden_field.rb +10 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/label.rb +81 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/month_field.rb +15 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/number_field.rb +20 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/password_field.rb +14 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/placeholderable.rb +24 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/radio_button.rb +33 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/range_field.rb +10 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/search_field.rb +27 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/select.rb +43 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/tel_field.rb +10 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/text_area.rb +24 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/text_field.rb +34 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/time_field.rb +15 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/time_select.rb +10 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/time_zone_select.rb +22 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/translator.rb +44 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/url_field.rb +10 -0
- data/vendor/rails/actionview/lib/action_view/helpers/tags/week_field.rb +15 -0
- data/vendor/rails/actionview/lib/action_view/helpers/text_helper.rb +486 -0
- data/vendor/rails/actionview/lib/action_view/helpers/translation_helper.rb +141 -0
- data/vendor/rails/actionview/lib/action_view/helpers/url_helper.rb +676 -0
- data/vendor/rails/actionview/lib/action_view/layouts.rb +433 -0
- data/vendor/rails/actionview/lib/action_view/locale/en.yml +56 -0
- data/vendor/rails/actionview/lib/action_view/log_subscriber.rb +96 -0
- data/vendor/rails/actionview/lib/action_view/lookup_context.rb +274 -0
- data/vendor/rails/actionview/lib/action_view/model_naming.rb +14 -0
- data/vendor/rails/actionview/lib/action_view/path_set.rb +100 -0
- data/vendor/rails/actionview/lib/action_view/railtie.rb +82 -0
- data/vendor/rails/actionview/lib/action_view/record_identifier.rb +112 -0
- data/vendor/rails/actionview/lib/action_view/renderer/abstract_renderer.rb +55 -0
- data/vendor/rails/actionview/lib/action_view/renderer/partial_renderer.rb +552 -0
- data/vendor/rails/actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb +57 -0
- data/vendor/rails/actionview/lib/action_view/renderer/renderer.rb +56 -0
- data/vendor/rails/actionview/lib/action_view/renderer/streaming_template_renderer.rb +105 -0
- data/vendor/rails/actionview/lib/action_view/renderer/template_renderer.rb +102 -0
- data/vendor/rails/actionview/lib/action_view/rendering.rb +151 -0
- data/vendor/rails/actionview/lib/action_view/routing_url_for.rb +145 -0
- data/vendor/rails/actionview/lib/action_view/tasks/cache_digests.rake +25 -0
- data/vendor/rails/actionview/lib/action_view/template.rb +361 -0
- data/vendor/rails/actionview/lib/action_view/template/error.rb +141 -0
- data/vendor/rails/actionview/lib/action_view/template/handlers.rb +66 -0
- data/vendor/rails/actionview/lib/action_view/template/handlers/builder.rb +25 -0
- data/vendor/rails/actionview/lib/action_view/template/handlers/erb.rb +74 -0
- data/vendor/rails/actionview/lib/action_view/template/handlers/erb/erubi.rb +83 -0
- data/vendor/rails/actionview/lib/action_view/template/handlers/html.rb +11 -0
- data/vendor/rails/actionview/lib/action_view/template/handlers/raw.rb +11 -0
- data/vendor/rails/actionview/lib/action_view/template/html.rb +34 -0
- data/vendor/rails/actionview/lib/action_view/template/resolver.rb +391 -0
- data/vendor/rails/actionview/lib/action_view/template/text.rb +33 -0
- data/vendor/rails/actionview/lib/action_view/template/types.rb +57 -0
- data/vendor/rails/actionview/lib/action_view/test_case.rb +300 -0
- data/vendor/rails/actionview/lib/action_view/testing/resolvers.rb +54 -0
- data/vendor/rails/actionview/lib/action_view/version.rb +10 -0
- data/vendor/rails/actionview/lib/action_view/view_paths.rb +105 -0
- data/vendor/rails/actionview/package.json +36 -0
- data/vendor/rails/actionview/test/abstract_unit.rb +236 -0
- data/vendor/rails/actionview/test/actionpack/abstract/abstract_controller_test.rb +292 -0
- data/vendor/rails/actionview/test/actionpack/abstract/helper_test.rb +128 -0
- data/vendor/rails/actionview/test/actionpack/abstract/layouts_test.rb +568 -0
- data/vendor/rails/actionview/test/actionpack/abstract/render_test.rb +103 -0
- data/vendor/rails/actionview/test/actionpack/abstract/views/abstract_controller/testing/me3/formatted.html.erb +1 -0
- data/vendor/rails/actionview/test/actionpack/abstract/views/abstract_controller/testing/me3/index.erb +1 -0
- data/vendor/rails/actionview/test/actionpack/abstract/views/abstract_controller/testing/me4/index.erb +1 -0
- data/vendor/rails/actionview/test/actionpack/abstract/views/action_with_ivars.erb +1 -0
- data/vendor/rails/actionview/test/actionpack/abstract/views/helper_test.erb +1 -0
- data/vendor/rails/actionview/test/actionpack/abstract/views/index.erb +1 -0
- data/vendor/rails/actionview/test/actionpack/abstract/views/layouts/abstract_controller/testing/me4.erb +1 -0
- data/vendor/rails/actionview/test/actionpack/abstract/views/layouts/application.erb +1 -0
- data/vendor/rails/actionview/test/actionpack/abstract/views/naked_render.erb +1 -0
- data/vendor/rails/actionview/test/actionpack/controller/capture_test.rb +83 -0
- data/vendor/rails/actionview/test/actionpack/controller/layout_test.rb +270 -0
- data/vendor/rails/actionview/test/actionpack/controller/render_test.rb +1294 -0
- data/vendor/rails/actionview/test/actionpack/controller/view_paths_test.rb +174 -0
- data/vendor/rails/actionview/test/active_record_unit.rb +92 -0
- data/vendor/rails/actionview/test/activerecord/controller_runtime_test.rb +95 -0
- data/vendor/rails/actionview/test/activerecord/debug_helper_test.rb +19 -0
- data/vendor/rails/actionview/test/activerecord/form_helper_activerecord_test.rb +90 -0
- data/vendor/rails/actionview/test/activerecord/polymorphic_routes_test.rb +780 -0
- data/vendor/rails/actionview/test/activerecord/relation_cache_test.rb +23 -0
- data/vendor/rails/actionview/test/activerecord/render_partial_with_record_identification_test.rb +188 -0
- data/vendor/rails/actionview/test/fixtures/_top_level_partial.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/_top_level_partial_only.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/bad_customers/_bad_customer.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/customers/_customer.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/fun/games/_form.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/fun/games/hello_world.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/good_customers/_good_customer.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/hello.html +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/alt/layouts/alt.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/controller_name_space/nested.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/item.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/layout_test.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/multiple_extensions.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/symlinked/symlinked_layout.erb +5 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/third_party_template_library.mab +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/views/goodbye.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/views/hello.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_column.html.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_customers.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_partial_and_yield.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_yield_only.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_yield_with_params.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/block_with_layout.erb +3 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/builder.builder +3 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/partial_with_layout.erb +3 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/standard.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/standard.text.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/streaming.erb +4 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/talk_from_action.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/with_html_partial.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/xhr.html.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/yield.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/yield_with_render_inline_inside.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/yield_with_render_partial_inside.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/quiz/questions/_question.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/shared.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_changing_priority.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_changing_priority.json.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_counter.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_counter.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_counter_with_as.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_greeting.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_iteration.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_iteration_with_as.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_with_var.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_directory/_partial_with_locales.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_first_json_partial.json.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_form.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_hash_greeting.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_hash_object.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_hello.builder +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_json_change_priority.json.erb +0 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_labelling_form.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_layout_for_partial.html.erb +3 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial.js.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_for_use_in_layout.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_html_erb.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_name_local_variable.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_only.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_only_html.html +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_with_partial.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_person.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_raise_indentation.html.erb +13 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_second_json_partial.json.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/action_talk_to_layout.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/calling_partial_with_layout.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/capturing.erb +4 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/change_priority.html.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/content_for.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/content_for_concatenated.erb +3 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/content_for_with_parameter.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/dot.directory/render_file_with_ivar.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/formatted_html_erb.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/formatted_xml_erb.builder +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/formatted_xml_erb.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/formatted_xml_erb.xml.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/greeting.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/greeting.xml.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello,world.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello.builder +4 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello/hello.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world_container.builder +3 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world_from_rxml.builder +3 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world_with_layout_false.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world_with_partial.html.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_xml_world.builder +11 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/html_template.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hyphen-ated.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/implicit_content_type.atom.builder +2 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/list.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/non_erb_block_content_for.builder +4 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/potential_conflicts.erb +4 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/proper_block_detection.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_file_from_template.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_file_with_ivar.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_file_with_locals.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_file_with_locals_and_default.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_implicit_html_template_from_xhr_request.da.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_implicit_html_template_from_xhr_request.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_implicit_js_template_without_layout.js.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_partial_inside_directory.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_to_string_test.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_two_partials.html.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/using_layout_around_block.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/with_html_partial.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/with_partial.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/with_partial.text.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/actionpack/test/with_xml_template.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/comments/empty.de.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/comments/empty.html+grid.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/comments/empty.html.builder +1 -0
- data/vendor/rails/actionview/test/fixtures/comments/empty.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/comments/empty.xml.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/companies.yml +24 -0
- data/vendor/rails/actionview/test/fixtures/company.rb +11 -0
- data/vendor/rails/actionview/test/fixtures/custom_pattern/another.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/custom_pattern/html/another.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/custom_pattern/html/path.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/customers/_customer.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/customers/_customer.xml.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/db_definitions/sqlite.sql +49 -0
- data/vendor/rails/actionview/test/fixtures/developer.rb +8 -0
- data/vendor/rails/actionview/test/fixtures/developers.yml +21 -0
- data/vendor/rails/actionview/test/fixtures/developers/_developer.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/developers_projects.yml +13 -0
- data/vendor/rails/actionview/test/fixtures/digestor/api/comments/_comment.json.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/digestor/api/comments/_comments.json.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/digestor/comments/_comment.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/digestor/comments/_comments.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/digestor/comments/show.js.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/digestor/events/_completed.html.erb +0 -0
- data/vendor/rails/actionview/test/fixtures/digestor/events/_event.html.erb +0 -0
- data/vendor/rails/actionview/test/fixtures/digestor/events/index.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/digestor/level/_recursion.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/digestor/level/below/_header.html.erb +0 -0
- data/vendor/rails/actionview/test/fixtures/digestor/level/below/index.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/digestor/level/recursion.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/digestor/messages/_form.html.erb +0 -0
- data/vendor/rails/actionview/test/fixtures/digestor/messages/_header.html.erb +0 -0
- data/vendor/rails/actionview/test/fixtures/digestor/messages/_message.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/digestor/messages/actions/_move.html.erb +0 -0
- data/vendor/rails/actionview/test/fixtures/digestor/messages/edit.html.erb +5 -0
- data/vendor/rails/actionview/test/fixtures/digestor/messages/index.html.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/digestor/messages/new.html+iphone.erb +15 -0
- data/vendor/rails/actionview/test/fixtures/digestor/messages/peek.html.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/digestor/messages/show.html.erb +14 -0
- data/vendor/rails/actionview/test/fixtures/digestor/messages/thread.json.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/fun/games/_game.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/fun/games/hello_world.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/fun/serious/games/_game.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/games/_game.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/good_customers/_good_customer.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/helpers/abc_helper.rb +5 -0
- data/vendor/rails/actionview/test/fixtures/helpers/helpery_test_helper.rb +7 -0
- data/vendor/rails/actionview/test/fixtures/helpers_missing/invalid_require_helper.rb +6 -0
- data/vendor/rails/actionview/test/fixtures/layout_tests/alt/hello.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/layouts/_column.html.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/layouts/_customers.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/layouts/_partial_and_yield.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/layouts/_yield_only.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/layouts/_yield_with_params.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/layouts/render_partial_html.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/layouts/streaming.erb +4 -0
- data/vendor/rails/actionview/test/fixtures/layouts/streaming_with_capture.erb +6 -0
- data/vendor/rails/actionview/test/fixtures/layouts/streaming_with_locale.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/layouts/yield.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/layouts/yield_with_render_inline_inside.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/layouts/yield_with_render_partial_inside.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/mascot.rb +5 -0
- data/vendor/rails/actionview/test/fixtures/mascots.yml +4 -0
- data/vendor/rails/actionview/test/fixtures/mascots/_mascot.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/override/test/hello_world.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/override2/layouts/test/sub.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/plain_text.raw +1 -0
- data/vendor/rails/actionview/test/fixtures/plain_text_with_characters.raw +1 -0
- data/vendor/rails/actionview/test/fixtures/project.rb +9 -0
- data/vendor/rails/actionview/test/fixtures/projects.yml +7 -0
- data/vendor/rails/actionview/test/fixtures/projects/_project.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/public/elsewhere/cools.js +1 -0
- data/vendor/rails/actionview/test/fixtures/public/elsewhere/file.css +1 -0
- data/vendor/rails/actionview/test/fixtures/public/foo/baz.css +3 -0
- data/vendor/rails/actionview/test/fixtures/public/javascripts/application.js +1 -0
- data/vendor/rails/actionview/test/fixtures/public/javascripts/bank.js +1 -0
- data/vendor/rails/actionview/test/fixtures/public/javascripts/common.javascript +1 -0
- data/vendor/rails/actionview/test/fixtures/public/javascripts/controls.js +1 -0
- data/vendor/rails/actionview/test/fixtures/public/javascripts/dragdrop.js +1 -0
- data/vendor/rails/actionview/test/fixtures/public/javascripts/effects.js +1 -0
- data/vendor/rails/actionview/test/fixtures/public/javascripts/prototype.js +1 -0
- data/vendor/rails/actionview/test/fixtures/public/javascripts/robber.js +1 -0
- data/vendor/rails/actionview/test/fixtures/public/javascripts/subdir/subdir.js +1 -0
- data/vendor/rails/actionview/test/fixtures/public/javascripts/version.1.0.js +1 -0
- data/vendor/rails/actionview/test/fixtures/public/stylesheets/bank.css +1 -0
- data/vendor/rails/actionview/test/fixtures/public/stylesheets/random.styles +1 -0
- data/vendor/rails/actionview/test/fixtures/public/stylesheets/robber.css +1 -0
- data/vendor/rails/actionview/test/fixtures/public/stylesheets/subdir/subdir.css +1 -0
- data/vendor/rails/actionview/test/fixtures/public/stylesheets/version.1.0.css +1 -0
- data/vendor/rails/actionview/test/fixtures/replies.yml +15 -0
- data/vendor/rails/actionview/test/fixtures/replies/_reply.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/reply.rb +9 -0
- data/vendor/rails/actionview/test/fixtures/respond_to/using_defaults_with_all.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/ruby_template.ruby +2 -0
- data/vendor/rails/actionview/test/fixtures/shared.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_200.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_FooBar.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_a-in.html.erb +0 -0
- data/vendor/rails/actionview/test/fixtures/test/_b_layout_for_partial.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_b_layout_for_partial_with_object.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_builder_tag_nested_in_content_tag.erb +3 -0
- data/vendor/rails/actionview/test/fixtures/test/_cached_customer.erb +3 -0
- data/vendor/rails/actionview/test/fixtures/test/_cached_customer_as.erb +3 -0
- data/vendor/rails/actionview/test/fixtures/test/_cached_nested_cached_customer.erb +3 -0
- data/vendor/rails/actionview/test/fixtures/test/_changing_priority.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_changing_priority.json.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_content_tag_nested_in_content_tag.erb +3 -0
- data/vendor/rails/actionview/test/fixtures/test/_counter.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_customer.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_customer.mobile.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_customer_greeting.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_customer_with_var.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_directory/_partial_with_locales.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_first_json_partial.json.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_from_helper.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_json_change_priority.json.erb +0 -0
- data/vendor/rails/actionview/test/fixtures/test/_klass.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_label_with_block.erb +4 -0
- data/vendor/rails/actionview/test/fixtures/test/_layout_for_block_with_args.html.erb +3 -0
- data/vendor/rails/actionview/test/fixtures/test/_layout_for_partial.html.erb +3 -0
- data/vendor/rails/actionview/test/fixtures/test/_layout_with_partial_and_yield.html.erb +4 -0
- data/vendor/rails/actionview/test/fixtures/test/_local_inspector.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_nested_cached_customer.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_object_inspector.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_one.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_partial.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_partial.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_partial.js.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_partial_for_use_in_layout.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_partial_iteration_1.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_partial_iteration_2.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_partial_name_in_local_assigns.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_partial_name_local_variable.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_partial_only.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_partial_shortcut_with_block_content.html.erb +3 -0
- data/vendor/rails/actionview/test/fixtures/test/_partial_with_layout.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/test/_partial_with_layout_block_content.erb +4 -0
- data/vendor/rails/actionview/test/fixtures/test/_partial_with_layout_block_partial.erb +4 -0
- data/vendor/rails/actionview/test/fixtures/test/_partial_with_only_html_version.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_partial_with_partial.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/test/_partial_with_variants.html+grid.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_partialhtml.html +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_raise.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_raise_indentation.html.erb +13 -0
- data/vendor/rails/actionview/test/fixtures/test/_second_json_partial.json.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_two.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_utf8_partial.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/_utf8_partial_magic.html.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/test/_/360/237/215/243.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/basic.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/calling_partial_with_layout.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/change_priority.html.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/test/dont_pick_me +1 -0
- data/vendor/rails/actionview/test/fixtures/test/dot.directory/render_file_with_ivar.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/greeting.xml.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/hello.builder +4 -0
- data/vendor/rails/actionview/test/fixtures/test/hello/hello.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/hello_world.da.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/hello_world.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/hello_world.erb~ +1 -0
- data/vendor/rails/actionview/test/fixtures/test/hello_world.html+phone.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/hello_world.pt-BR.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/hello_world.text+phone.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/hello_world_with_partial.html.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/test/html_template.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/layout_render_file.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/test/layout_render_object.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/list.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/malformed/malformed.en.html.erb~ +1 -0
- data/vendor/rails/actionview/test/fixtures/test/malformed/malformed.erb~ +1 -0
- data/vendor/rails/actionview/test/fixtures/test/malformed/malformed.html.erb~ +1 -0
- data/vendor/rails/actionview/test/fixtures/test/malformed/malformed~ +1 -0
- data/vendor/rails/actionview/test/fixtures/test/nested_layout.erb +3 -0
- data/vendor/rails/actionview/test/fixtures/test/nested_streaming.erb +3 -0
- data/vendor/rails/actionview/test/fixtures/test/nil_return.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/one.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/render_file_inspect_local_assigns.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/render_file_instance_variable.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/render_file_unicode_local.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/render_file_with_ivar.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/render_file_with_locals.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/render_file_with_locals_and_default.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/render_file_with_ruby_keyword_locals.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/render_partial_inside_directory.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/render_two_partials.html.erb +2 -0
- data/vendor/rails/actionview/test/fixtures/test/streaming.erb +3 -0
- data/vendor/rails/actionview/test/fixtures/test/streaming_buster.erb +3 -0
- data/vendor/rails/actionview/test/fixtures/test/streaming_with_locale.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/sub_template_raise.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/template.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/test_template_with_delegation_reserved_keywords.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/test/update_element_with_capture.erb +9 -0
- data/vendor/rails/actionview/test/fixtures/test/utf8.html.erb +4 -0
- data/vendor/rails/actionview/test/fixtures/test/utf8_magic.html.erb +5 -0
- data/vendor/rails/actionview/test/fixtures/test/utf8_magic_with_bare_partial.html.erb +5 -0
- data/vendor/rails/actionview/test/fixtures/topic.rb +5 -0
- data/vendor/rails/actionview/test/fixtures/topics.yml +22 -0
- data/vendor/rails/actionview/test/fixtures/topics/_topic.html.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/translations/templates/array.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/translations/templates/default.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/translations/templates/found.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/translations/templates/missing.erb +1 -0
- data/vendor/rails/actionview/test/fixtures/with_format.json.erb +1 -0
- data/vendor/rails/actionview/test/lib/controller/fake_models.rb +204 -0
- data/vendor/rails/actionview/test/template/active_model_helper_test.rb +172 -0
- data/vendor/rails/actionview/test/template/asset_tag_helper_test.rb +913 -0
- data/vendor/rails/actionview/test/template/atom_feed_helper_test.rb +375 -0
- data/vendor/rails/actionview/test/template/capture_helper_test.rb +228 -0
- data/vendor/rails/actionview/test/template/compiled_templates_test.rb +94 -0
- data/vendor/rails/actionview/test/template/controller_helper_test.rb +34 -0
- data/vendor/rails/actionview/test/template/date_helper_i18n_test.rb +166 -0
- data/vendor/rails/actionview/test/template/date_helper_test.rb +3642 -0
- data/vendor/rails/actionview/test/template/dependency_tracker_test.rb +195 -0
- data/vendor/rails/actionview/test/template/digestor_test.rb +389 -0
- data/vendor/rails/actionview/test/template/erb/form_for_test.rb +13 -0
- data/vendor/rails/actionview/test/template/erb/helper.rb +26 -0
- data/vendor/rails/actionview/test/template/erb/tag_helper_test.rb +32 -0
- data/vendor/rails/actionview/test/template/erb_util_test.rb +114 -0
- data/vendor/rails/actionview/test/template/form_collections_helper_test.rb +527 -0
- data/vendor/rails/actionview/test/template/form_helper/form_with_test.rb +2293 -0
- data/vendor/rails/actionview/test/template/form_helper_test.rb +3554 -0
- data/vendor/rails/actionview/test/template/form_options_helper_i18n_test.rb +30 -0
- data/vendor/rails/actionview/test/template/form_options_helper_test.rb +1452 -0
- data/vendor/rails/actionview/test/template/form_tag_helper_test.rb +785 -0
- data/vendor/rails/actionview/test/template/html_test.rb +19 -0
- data/vendor/rails/actionview/test/template/javascript_helper_test.rb +68 -0
- data/vendor/rails/actionview/test/template/log_subscriber_test.rb +224 -0
- data/vendor/rails/actionview/test/template/lookup_context_test.rb +289 -0
- data/vendor/rails/actionview/test/template/number_helper_test.rb +204 -0
- data/vendor/rails/actionview/test/template/output_safety_helper_test.rb +119 -0
- data/vendor/rails/actionview/test/template/partial_iteration_test.rb +35 -0
- data/vendor/rails/actionview/test/template/record_identifier_test.rb +93 -0
- data/vendor/rails/actionview/test/template/record_tag_helper_test.rb +33 -0
- data/vendor/rails/actionview/test/template/render_test.rb +725 -0
- data/vendor/rails/actionview/test/template/resolver_cache_test.rb +9 -0
- data/vendor/rails/actionview/test/template/resolver_patterns_test.rb +44 -0
- data/vendor/rails/actionview/test/template/sanitize_helper_test.rb +43 -0
- data/vendor/rails/actionview/test/template/streaming_render_test.rb +132 -0
- data/vendor/rails/actionview/test/template/tag_helper_test.rb +357 -0
- data/vendor/rails/actionview/test/template/template_error_test.rb +37 -0
- data/vendor/rails/actionview/test/template/template_test.rb +207 -0
- data/vendor/rails/actionview/test/template/test_case_test.rb +335 -0
- data/vendor/rails/actionview/test/template/test_test.rb +94 -0
- data/vendor/rails/actionview/test/template/testing/fixture_resolver_test.rb +20 -0
- data/vendor/rails/actionview/test/template/testing/null_resolver_test.rb +14 -0
- data/vendor/rails/actionview/test/template/text_helper_test.rb +535 -0
- data/vendor/rails/actionview/test/template/text_test.rb +25 -0
- data/vendor/rails/actionview/test/template/translation_helper_test.rb +238 -0
- data/vendor/rails/actionview/test/template/url_helper_test.rb +976 -0
- data/vendor/rails/actionview/test/ujs/config.ru +6 -0
- data/vendor/rails/actionview/test/ujs/public/test/call-ajax.js +26 -0
- data/vendor/rails/actionview/test/ujs/public/test/call-remote-callbacks.js +239 -0
- data/vendor/rails/actionview/test/ujs/public/test/call-remote.js +275 -0
- data/vendor/rails/actionview/test/ujs/public/test/csrf-refresh.js +24 -0
- data/vendor/rails/actionview/test/ujs/public/test/csrf-token.js +27 -0
- data/vendor/rails/actionview/test/ujs/public/test/data-confirm.js +316 -0
- data/vendor/rails/actionview/test/ujs/public/test/data-disable-with.js +394 -0
- data/vendor/rails/actionview/test/ujs/public/test/data-disable.js +322 -0
- data/vendor/rails/actionview/test/ujs/public/test/data-method.js +85 -0
- data/vendor/rails/actionview/test/ujs/public/test/data-remote.js +441 -0
- data/vendor/rails/actionview/test/ujs/public/test/override.js +56 -0
- data/vendor/rails/actionview/test/ujs/public/test/settings.js +118 -0
- data/vendor/rails/actionview/test/ujs/public/vendor/jquery-2.2.0.js +9831 -0
- data/vendor/rails/actionview/test/ujs/public/vendor/jquery.metadata.js +122 -0
- data/vendor/rails/actionview/test/ujs/public/vendor/qunit.css +237 -0
- data/vendor/rails/actionview/test/ujs/public/vendor/qunit.js +2288 -0
- data/vendor/rails/actionview/test/ujs/server.rb +86 -0
- data/vendor/rails/actionview/test/ujs/views/layouts/application.html.erb +26 -0
- data/vendor/rails/actionview/test/ujs/views/tests/index.html.erb +11 -0
- data/vendor/rails/ci/qunit-selenium-runner.rb +16 -0
- data/vendor/rails/ci/travis.rb +187 -0
- data/vendor/rails/rails.gemspec +36 -0
- data/vendor/rails/version.rb +17 -0
- metadata +1030 -30
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "abstract_unit"
|
4
|
+
|
5
|
+
class FormOptionsHelperI18nTests < ActionView::TestCase
|
6
|
+
tests ActionView::Helpers::FormOptionsHelper
|
7
|
+
|
8
|
+
def setup
|
9
|
+
@prompt_message = "Select!"
|
10
|
+
I18n.backend.send(:init_translations)
|
11
|
+
I18n.backend.store_translations :en, helpers: { select: { prompt: @prompt_message } }
|
12
|
+
end
|
13
|
+
|
14
|
+
def teardown
|
15
|
+
I18n.backend = I18n::Backend::Simple.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_select_with_prompt_true_translates_prompt_message
|
19
|
+
assert_called_with(I18n, :translate, ["helpers.select.prompt", { default: "Please select" }]) do
|
20
|
+
select("post", "category", [], prompt: true)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_select_with_translated_prompt
|
25
|
+
assert_dom_equal(
|
26
|
+
%Q(<select id="post_category" name="post[category]"><option value="">#{@prompt_message}</option>\n</select>),
|
27
|
+
select("post", "category", [], prompt: true)
|
28
|
+
)
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,1452 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "abstract_unit"
|
4
|
+
|
5
|
+
class Map < Hash
|
6
|
+
def category
|
7
|
+
"<mus>"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class CustomEnumerable
|
12
|
+
include Enumerable
|
13
|
+
|
14
|
+
def each
|
15
|
+
yield "one"
|
16
|
+
yield "two"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class FormOptionsHelperTest < ActionView::TestCase
|
21
|
+
tests ActionView::Helpers::FormOptionsHelper
|
22
|
+
|
23
|
+
silence_warnings do
|
24
|
+
Post = Struct.new("Post", :title, :author_name, :body, :secret, :written_on, :category, :origin, :allow_comments)
|
25
|
+
Continent = Struct.new("Continent", :continent_name, :countries)
|
26
|
+
Country = Struct.new("Country", :country_id, :country_name)
|
27
|
+
Firm = Struct.new("Firm", :time_zone)
|
28
|
+
Album = Struct.new("Album", :id, :title, :genre)
|
29
|
+
end
|
30
|
+
|
31
|
+
module FakeZones
|
32
|
+
FakeZone = Struct.new(:name) do
|
33
|
+
def to_s; name; end
|
34
|
+
end
|
35
|
+
|
36
|
+
module ClassMethods
|
37
|
+
def [](id); fake_zones ? fake_zones[id] : super; end
|
38
|
+
def all; fake_zones ? fake_zones.values : super; end
|
39
|
+
def dummy; :test; end
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.prepended(base)
|
43
|
+
class << base
|
44
|
+
mattr_accessor(:fake_zones)
|
45
|
+
prepend ClassMethods
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
ActiveSupport::TimeZone.prepend FakeZones
|
51
|
+
|
52
|
+
setup do
|
53
|
+
ActiveSupport::TimeZone.fake_zones = %w(A B C D E).map do |id|
|
54
|
+
[ id, FakeZones::FakeZone.new(id) ]
|
55
|
+
end.to_h
|
56
|
+
|
57
|
+
@fake_timezones = ActiveSupport::TimeZone.all
|
58
|
+
end
|
59
|
+
|
60
|
+
teardown do
|
61
|
+
ActiveSupport::TimeZone.fake_zones = nil
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_collection_options
|
65
|
+
assert_dom_equal(
|
66
|
+
"<option value=\"<Abe>\"><Abe> went home</option>\n<option value=\"Babe\">Babe went home</option>\n<option value=\"Cabe\">Cabe went home</option>",
|
67
|
+
options_from_collection_for_select(dummy_posts, "author_name", "title")
|
68
|
+
)
|
69
|
+
end
|
70
|
+
|
71
|
+
def test_collection_options_with_preselected_value
|
72
|
+
assert_dom_equal(
|
73
|
+
"<option value=\"<Abe>\"><Abe> went home</option>\n<option value=\"Babe\" selected=\"selected\">Babe went home</option>\n<option value=\"Cabe\">Cabe went home</option>",
|
74
|
+
options_from_collection_for_select(dummy_posts, "author_name", "title", "Babe")
|
75
|
+
)
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_collection_options_with_preselected_value_array
|
79
|
+
assert_dom_equal(
|
80
|
+
"<option value=\"<Abe>\"><Abe> went home</option>\n<option value=\"Babe\" selected=\"selected\">Babe went home</option>\n<option value=\"Cabe\" selected=\"selected\">Cabe went home</option>",
|
81
|
+
options_from_collection_for_select(dummy_posts, "author_name", "title", [ "Babe", "Cabe" ])
|
82
|
+
)
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_collection_options_with_proc_for_selected
|
86
|
+
assert_dom_equal(
|
87
|
+
"<option value=\"<Abe>\"><Abe> went home</option>\n<option value=\"Babe\" selected=\"selected\">Babe went home</option>\n<option value=\"Cabe\">Cabe went home</option>",
|
88
|
+
options_from_collection_for_select(dummy_posts, "author_name", "title", lambda { |p| p.author_name == "Babe" })
|
89
|
+
)
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_collection_options_with_disabled_value
|
93
|
+
assert_dom_equal(
|
94
|
+
"<option value=\"<Abe>\"><Abe> went home</option>\n<option value=\"Babe\" disabled=\"disabled\">Babe went home</option>\n<option value=\"Cabe\">Cabe went home</option>",
|
95
|
+
options_from_collection_for_select(dummy_posts, "author_name", "title", disabled: "Babe")
|
96
|
+
)
|
97
|
+
end
|
98
|
+
|
99
|
+
def test_collection_options_with_disabled_array
|
100
|
+
assert_dom_equal(
|
101
|
+
"<option value=\"<Abe>\"><Abe> went home</option>\n<option value=\"Babe\" disabled=\"disabled\">Babe went home</option>\n<option value=\"Cabe\" disabled=\"disabled\">Cabe went home</option>",
|
102
|
+
options_from_collection_for_select(dummy_posts, "author_name", "title", disabled: [ "Babe", "Cabe" ])
|
103
|
+
)
|
104
|
+
end
|
105
|
+
|
106
|
+
def test_collection_options_with_preselected_and_disabled_value
|
107
|
+
assert_dom_equal(
|
108
|
+
"<option value=\"<Abe>\"><Abe> went home</option>\n<option value=\"Babe\" disabled=\"disabled\">Babe went home</option>\n<option value=\"Cabe\" selected=\"selected\">Cabe went home</option>",
|
109
|
+
options_from_collection_for_select(dummy_posts, "author_name", "title", selected: "Cabe", disabled: "Babe")
|
110
|
+
)
|
111
|
+
end
|
112
|
+
|
113
|
+
def test_collection_options_with_proc_for_disabled
|
114
|
+
assert_dom_equal(
|
115
|
+
"<option value=\"<Abe>\"><Abe> went home</option>\n<option value=\"Babe\" disabled=\"disabled\">Babe went home</option>\n<option value=\"Cabe\" disabled=\"disabled\">Cabe went home</option>",
|
116
|
+
options_from_collection_for_select(dummy_posts, "author_name", "title", disabled: lambda { |p| %w(Babe Cabe).include?(p.author_name) })
|
117
|
+
)
|
118
|
+
end
|
119
|
+
|
120
|
+
def test_collection_options_with_proc_for_value_method
|
121
|
+
assert_dom_equal(
|
122
|
+
"<option value=\"<Abe>\"><Abe> went home</option>\n<option value=\"Babe\">Babe went home</option>\n<option value=\"Cabe\">Cabe went home</option>",
|
123
|
+
options_from_collection_for_select(dummy_posts, lambda { |p| p.author_name }, "title")
|
124
|
+
)
|
125
|
+
end
|
126
|
+
|
127
|
+
def test_collection_options_with_proc_for_text_method
|
128
|
+
assert_dom_equal(
|
129
|
+
"<option value=\"<Abe>\"><Abe> went home</option>\n<option value=\"Babe\">Babe went home</option>\n<option value=\"Cabe\">Cabe went home</option>",
|
130
|
+
options_from_collection_for_select(dummy_posts, "author_name", lambda { |p| p.title })
|
131
|
+
)
|
132
|
+
end
|
133
|
+
|
134
|
+
def test_collection_options_with_element_attributes
|
135
|
+
assert_dom_equal(
|
136
|
+
"<option value=\"USA\" class=\"bold\">USA</option>",
|
137
|
+
options_from_collection_for_select([[ "USA", "USA", { class: "bold" } ]], :first, :second)
|
138
|
+
)
|
139
|
+
end
|
140
|
+
|
141
|
+
def test_string_options_for_select
|
142
|
+
options = "<option value=\"Denmark\">Denmark</option><option value=\"USA\">USA</option><option value=\"Sweden\">Sweden</option>"
|
143
|
+
assert_dom_equal(
|
144
|
+
options,
|
145
|
+
options_for_select(options)
|
146
|
+
)
|
147
|
+
end
|
148
|
+
|
149
|
+
def test_array_options_for_select
|
150
|
+
assert_dom_equal(
|
151
|
+
"<option value=\"<Denmark>\"><Denmark></option>\n<option value=\"USA\">USA</option>\n<option value=\"Sweden\">Sweden</option>",
|
152
|
+
options_for_select([ "<Denmark>", "USA", "Sweden" ])
|
153
|
+
)
|
154
|
+
end
|
155
|
+
|
156
|
+
def test_array_options_for_select_with_custom_defined_selected
|
157
|
+
assert_dom_equal(
|
158
|
+
"<option selected=\"selected\" type=\"Coach\" value=\"1\">Richard Bandler</option>\n<option type=\"Coachee\" value=\"1\">Richard Bandler</option>",
|
159
|
+
options_for_select([
|
160
|
+
["Richard Bandler", 1, { type: "Coach", selected: "selected" }],
|
161
|
+
["Richard Bandler", 1, { type: "Coachee" }]
|
162
|
+
])
|
163
|
+
)
|
164
|
+
end
|
165
|
+
|
166
|
+
def test_array_options_for_select_with_custom_defined_disabled
|
167
|
+
assert_dom_equal(
|
168
|
+
"<option disabled=\"disabled\" type=\"Coach\" value=\"1\">Richard Bandler</option>\n<option type=\"Coachee\" value=\"1\">Richard Bandler</option>",
|
169
|
+
options_for_select([
|
170
|
+
["Richard Bandler", 1, { type: "Coach", disabled: "disabled" }],
|
171
|
+
["Richard Bandler", 1, { type: "Coachee" }]
|
172
|
+
])
|
173
|
+
)
|
174
|
+
end
|
175
|
+
|
176
|
+
def test_array_options_for_select_with_selection
|
177
|
+
assert_dom_equal(
|
178
|
+
"<option value=\"Denmark\">Denmark</option>\n<option value=\"<USA>\" selected=\"selected\"><USA></option>\n<option value=\"Sweden\">Sweden</option>",
|
179
|
+
options_for_select([ "Denmark", "<USA>", "Sweden" ], "<USA>")
|
180
|
+
)
|
181
|
+
end
|
182
|
+
|
183
|
+
def test_array_options_for_select_with_selection_array
|
184
|
+
assert_dom_equal(
|
185
|
+
"<option value=\"Denmark\">Denmark</option>\n<option value=\"<USA>\" selected=\"selected\"><USA></option>\n<option value=\"Sweden\" selected=\"selected\">Sweden</option>",
|
186
|
+
options_for_select([ "Denmark", "<USA>", "Sweden" ], [ "<USA>", "Sweden" ])
|
187
|
+
)
|
188
|
+
end
|
189
|
+
|
190
|
+
def test_array_options_for_select_with_disabled_value
|
191
|
+
assert_dom_equal(
|
192
|
+
"<option value=\"Denmark\">Denmark</option>\n<option value=\"<USA>\" disabled=\"disabled\"><USA></option>\n<option value=\"Sweden\">Sweden</option>",
|
193
|
+
options_for_select([ "Denmark", "<USA>", "Sweden" ], disabled: "<USA>")
|
194
|
+
)
|
195
|
+
end
|
196
|
+
|
197
|
+
def test_array_options_for_select_with_disabled_array
|
198
|
+
assert_dom_equal(
|
199
|
+
"<option value=\"Denmark\">Denmark</option>\n<option value=\"<USA>\" disabled=\"disabled\"><USA></option>\n<option value=\"Sweden\" disabled=\"disabled\">Sweden</option>",
|
200
|
+
options_for_select([ "Denmark", "<USA>", "Sweden" ], disabled: ["<USA>", "Sweden"])
|
201
|
+
)
|
202
|
+
end
|
203
|
+
|
204
|
+
def test_array_options_for_select_with_selection_and_disabled_value
|
205
|
+
assert_dom_equal(
|
206
|
+
"<option value=\"Denmark\" selected=\"selected\">Denmark</option>\n<option value=\"<USA>\" disabled=\"disabled\"><USA></option>\n<option value=\"Sweden\">Sweden</option>",
|
207
|
+
options_for_select([ "Denmark", "<USA>", "Sweden" ], selected: "Denmark", disabled: "<USA>")
|
208
|
+
)
|
209
|
+
end
|
210
|
+
|
211
|
+
def test_boolean_array_options_for_select_with_selection_and_disabled_value
|
212
|
+
assert_dom_equal(
|
213
|
+
"<option value=\"true\">true</option>\n<option value=\"false\" selected=\"selected\">false</option>",
|
214
|
+
options_for_select([ true, false ], selected: false, disabled: nil)
|
215
|
+
)
|
216
|
+
end
|
217
|
+
|
218
|
+
def test_range_options_for_select
|
219
|
+
assert_dom_equal(
|
220
|
+
"<option value=\"1\">1</option>\n<option value=\"2\">2</option>\n<option value=\"3\">3</option>",
|
221
|
+
options_for_select(1..3)
|
222
|
+
)
|
223
|
+
end
|
224
|
+
|
225
|
+
def test_array_options_for_string_include_in_other_string_bug_fix
|
226
|
+
assert_dom_equal(
|
227
|
+
"<option value=\"ruby\">ruby</option>\n<option value=\"rubyonrails\" selected=\"selected\">rubyonrails</option>",
|
228
|
+
options_for_select([ "ruby", "rubyonrails" ], "rubyonrails")
|
229
|
+
)
|
230
|
+
assert_dom_equal(
|
231
|
+
"<option value=\"ruby\" selected=\"selected\">ruby</option>\n<option value=\"rubyonrails\">rubyonrails</option>",
|
232
|
+
options_for_select([ "ruby", "rubyonrails" ], "ruby")
|
233
|
+
)
|
234
|
+
assert_dom_equal(
|
235
|
+
%(<option value="ruby" selected="selected">ruby</option>\n<option value="rubyonrails">rubyonrails</option>\n<option value=""></option>),
|
236
|
+
options_for_select([ "ruby", "rubyonrails", nil ], "ruby")
|
237
|
+
)
|
238
|
+
end
|
239
|
+
|
240
|
+
def test_hash_options_for_select
|
241
|
+
assert_dom_equal(
|
242
|
+
"<option value=\"Dollar\">$</option>\n<option value=\"<Kroner>\"><DKR></option>",
|
243
|
+
options_for_select("$" => "Dollar", "<DKR>" => "<Kroner>").split("\n").join("\n")
|
244
|
+
)
|
245
|
+
assert_dom_equal(
|
246
|
+
"<option value=\"Dollar\" selected=\"selected\">$</option>\n<option value=\"<Kroner>\"><DKR></option>",
|
247
|
+
options_for_select({ "$" => "Dollar", "<DKR>" => "<Kroner>" }, "Dollar").split("\n").join("\n")
|
248
|
+
)
|
249
|
+
assert_dom_equal(
|
250
|
+
"<option value=\"Dollar\" selected=\"selected\">$</option>\n<option value=\"<Kroner>\" selected=\"selected\"><DKR></option>",
|
251
|
+
options_for_select({ "$" => "Dollar", "<DKR>" => "<Kroner>" }, [ "Dollar", "<Kroner>" ]).split("\n").join("\n")
|
252
|
+
)
|
253
|
+
end
|
254
|
+
|
255
|
+
def test_ducktyped_options_for_select
|
256
|
+
quack = Struct.new(:first, :last)
|
257
|
+
assert_dom_equal(
|
258
|
+
"<option value=\"<Kroner>\"><DKR></option>\n<option value=\"Dollar\">$</option>",
|
259
|
+
options_for_select([quack.new("<DKR>", "<Kroner>"), quack.new("$", "Dollar")])
|
260
|
+
)
|
261
|
+
assert_dom_equal(
|
262
|
+
"<option value=\"<Kroner>\"><DKR></option>\n<option value=\"Dollar\" selected=\"selected\">$</option>",
|
263
|
+
options_for_select([quack.new("<DKR>", "<Kroner>"), quack.new("$", "Dollar")], "Dollar")
|
264
|
+
)
|
265
|
+
assert_dom_equal(
|
266
|
+
"<option value=\"<Kroner>\" selected=\"selected\"><DKR></option>\n<option value=\"Dollar\" selected=\"selected\">$</option>",
|
267
|
+
options_for_select([quack.new("<DKR>", "<Kroner>"), quack.new("$", "Dollar")], ["Dollar", "<Kroner>"])
|
268
|
+
)
|
269
|
+
end
|
270
|
+
|
271
|
+
def test_collection_options_with_preselected_value_as_string_and_option_value_is_integer
|
272
|
+
albums = [ Album.new(1, "first", "rap"), Album.new(2, "second", "pop")]
|
273
|
+
assert_dom_equal(
|
274
|
+
%(<option selected="selected" value="1">rap</option>\n<option value="2">pop</option>),
|
275
|
+
options_from_collection_for_select(albums, "id", "genre", selected: "1")
|
276
|
+
)
|
277
|
+
end
|
278
|
+
|
279
|
+
def test_collection_options_with_preselected_value_as_integer_and_option_value_is_string
|
280
|
+
albums = [ Album.new("1", "first", "rap"), Album.new("2", "second", "pop")]
|
281
|
+
|
282
|
+
assert_dom_equal(
|
283
|
+
%(<option selected="selected" value="1">rap</option>\n<option value="2">pop</option>),
|
284
|
+
options_from_collection_for_select(albums, "id", "genre", selected: 1)
|
285
|
+
)
|
286
|
+
end
|
287
|
+
|
288
|
+
def test_collection_options_with_preselected_value_as_string_and_option_value_is_float
|
289
|
+
albums = [ Album.new(1.0, "first", "rap"), Album.new(2.0, "second", "pop")]
|
290
|
+
|
291
|
+
assert_dom_equal(
|
292
|
+
%(<option value="1.0">rap</option>\n<option value="2.0" selected="selected">pop</option>),
|
293
|
+
options_from_collection_for_select(albums, "id", "genre", selected: "2.0")
|
294
|
+
)
|
295
|
+
end
|
296
|
+
|
297
|
+
def test_collection_options_with_preselected_value_as_nil
|
298
|
+
albums = [ Album.new(1.0, "first", "rap"), Album.new(2.0, "second", "pop")]
|
299
|
+
|
300
|
+
assert_dom_equal(
|
301
|
+
%(<option value="1.0">rap</option>\n<option value="2.0">pop</option>),
|
302
|
+
options_from_collection_for_select(albums, "id", "genre", selected: nil)
|
303
|
+
)
|
304
|
+
end
|
305
|
+
|
306
|
+
def test_collection_options_with_disabled_value_as_nil
|
307
|
+
albums = [ Album.new(1.0, "first", "rap"), Album.new(2.0, "second", "pop")]
|
308
|
+
|
309
|
+
assert_dom_equal(
|
310
|
+
%(<option value="1.0">rap</option>\n<option value="2.0">pop</option>),
|
311
|
+
options_from_collection_for_select(albums, "id", "genre", disabled: nil)
|
312
|
+
)
|
313
|
+
end
|
314
|
+
|
315
|
+
def test_collection_options_with_disabled_value_as_array
|
316
|
+
albums = [ Album.new(1.0, "first", "rap"), Album.new(2.0, "second", "pop")]
|
317
|
+
|
318
|
+
assert_dom_equal(
|
319
|
+
%(<option disabled="disabled" value="1.0">rap</option>\n<option disabled="disabled" value="2.0">pop</option>),
|
320
|
+
options_from_collection_for_select(albums, "id", "genre", disabled: ["1.0", 2.0])
|
321
|
+
)
|
322
|
+
end
|
323
|
+
|
324
|
+
def test_collection_options_with_preselected_values_as_string_array_and_option_value_is_float
|
325
|
+
albums = [ Album.new(1.0, "first", "rap"), Album.new(2.0, "second", "pop"), Album.new(3.0, "third", "country") ]
|
326
|
+
|
327
|
+
assert_dom_equal(
|
328
|
+
%(<option value="1.0" selected="selected">rap</option>\n<option value="2.0">pop</option>\n<option value="3.0" selected="selected">country</option>),
|
329
|
+
options_from_collection_for_select(albums, "id", "genre", ["1.0", "3.0"])
|
330
|
+
)
|
331
|
+
end
|
332
|
+
|
333
|
+
def test_option_groups_from_collection_for_select
|
334
|
+
assert_dom_equal(
|
335
|
+
"<optgroup label=\"<Africa>\"><option value=\"<sa>\"><South Africa></option>\n<option value=\"so\">Somalia</option></optgroup><optgroup label=\"Europe\"><option value=\"dk\" selected=\"selected\">Denmark</option>\n<option value=\"ie\">Ireland</option></optgroup>",
|
336
|
+
option_groups_from_collection_for_select(dummy_continents, "countries", "continent_name", "country_id", "country_name", "dk")
|
337
|
+
)
|
338
|
+
end
|
339
|
+
|
340
|
+
def test_option_groups_from_collection_for_select_with_callable_group_method
|
341
|
+
group_proc = Proc.new { |c| c.countries }
|
342
|
+
assert_dom_equal(
|
343
|
+
"<optgroup label=\"<Africa>\"><option value=\"<sa>\"><South Africa></option>\n<option value=\"so\">Somalia</option></optgroup><optgroup label=\"Europe\"><option value=\"dk\" selected=\"selected\">Denmark</option>\n<option value=\"ie\">Ireland</option></optgroup>",
|
344
|
+
option_groups_from_collection_for_select(dummy_continents, group_proc, "continent_name", "country_id", "country_name", "dk")
|
345
|
+
)
|
346
|
+
end
|
347
|
+
|
348
|
+
def test_option_groups_from_collection_for_select_with_callable_group_label_method
|
349
|
+
label_proc = Proc.new { |c| c.continent_name }
|
350
|
+
assert_dom_equal(
|
351
|
+
"<optgroup label=\"<Africa>\"><option value=\"<sa>\"><South Africa></option>\n<option value=\"so\">Somalia</option></optgroup><optgroup label=\"Europe\"><option value=\"dk\" selected=\"selected\">Denmark</option>\n<option value=\"ie\">Ireland</option></optgroup>",
|
352
|
+
option_groups_from_collection_for_select(dummy_continents, "countries", label_proc, "country_id", "country_name", "dk")
|
353
|
+
)
|
354
|
+
end
|
355
|
+
|
356
|
+
def test_option_groups_from_collection_for_select_returns_html_safe_string
|
357
|
+
assert_predicate option_groups_from_collection_for_select(dummy_continents, "countries", "continent_name", "country_id", "country_name", "dk"), :html_safe?
|
358
|
+
end
|
359
|
+
|
360
|
+
def test_grouped_options_for_select_with_array
|
361
|
+
assert_dom_equal(
|
362
|
+
"<optgroup label=\"North America\"><option value=\"US\">United States</option>\n<option value=\"Canada\">Canada</option></optgroup><optgroup label=\"Europe\"><option value=\"GB\">Great Britain</option>\n<option value=\"Germany\">Germany</option></optgroup>",
|
363
|
+
grouped_options_for_select([
|
364
|
+
["North America",
|
365
|
+
[["United States", "US"], "Canada"]],
|
366
|
+
["Europe",
|
367
|
+
[["Great Britain", "GB"], "Germany"]]
|
368
|
+
])
|
369
|
+
)
|
370
|
+
end
|
371
|
+
|
372
|
+
def test_grouped_options_for_select_with_array_and_html_attributes
|
373
|
+
assert_dom_equal(
|
374
|
+
"<optgroup label=\"North America\" data-foo=\"bar\"><option value=\"US\">United States</option>\n<option value=\"Canada\">Canada</option></optgroup><optgroup label=\"Europe\" disabled=\"disabled\"><option value=\"GB\">Great Britain</option>\n<option value=\"Germany\">Germany</option></optgroup>",
|
375
|
+
grouped_options_for_select([
|
376
|
+
["North America", [["United States", "US"], "Canada"], data: { foo: "bar" }],
|
377
|
+
["Europe", [["Great Britain", "GB"], "Germany"], disabled: "disabled"]
|
378
|
+
])
|
379
|
+
)
|
380
|
+
end
|
381
|
+
|
382
|
+
def test_grouped_options_for_select_with_optional_divider
|
383
|
+
assert_dom_equal(
|
384
|
+
"<optgroup label=\"----------\"><option value=\"US\">US</option>\n<option value=\"Canada\">Canada</option></optgroup><optgroup label=\"----------\"><option value=\"GB\">GB</option>\n<option value=\"Germany\">Germany</option></optgroup>",
|
385
|
+
|
386
|
+
grouped_options_for_select([["US", "Canada"], ["GB", "Germany"]], nil, divider: "----------")
|
387
|
+
)
|
388
|
+
end
|
389
|
+
|
390
|
+
def test_grouped_options_for_select_with_selected_and_prompt
|
391
|
+
assert_dom_equal(
|
392
|
+
"<option value=\"\">Choose a product...</option><optgroup label=\"Hats\"><option value=\"Baseball Cap\">Baseball Cap</option>\n<option selected=\"selected\" value=\"Cowboy Hat\">Cowboy Hat</option></optgroup>",
|
393
|
+
grouped_options_for_select([["Hats", ["Baseball Cap", "Cowboy Hat"]]], "Cowboy Hat", prompt: "Choose a product...")
|
394
|
+
)
|
395
|
+
end
|
396
|
+
|
397
|
+
def test_grouped_options_for_select_with_selected_and_prompt_true
|
398
|
+
assert_dom_equal(
|
399
|
+
"<option value=\"\">Please select</option><optgroup label=\"Hats\"><option value=\"Baseball Cap\">Baseball Cap</option>\n<option selected=\"selected\" value=\"Cowboy Hat\">Cowboy Hat</option></optgroup>",
|
400
|
+
grouped_options_for_select([["Hats", ["Baseball Cap", "Cowboy Hat"]]], "Cowboy Hat", prompt: true)
|
401
|
+
)
|
402
|
+
end
|
403
|
+
|
404
|
+
def test_grouped_options_for_select_returns_html_safe_string
|
405
|
+
assert_predicate grouped_options_for_select([["Hats", ["Baseball Cap", "Cowboy Hat"]]]), :html_safe?
|
406
|
+
end
|
407
|
+
|
408
|
+
def test_grouped_options_for_select_with_prompt_returns_html_escaped_string
|
409
|
+
assert_dom_equal(
|
410
|
+
"<option value=\"\"><Choose One></option><optgroup label=\"Hats\"><option value=\"Baseball Cap\">Baseball Cap</option>\n<option value=\"Cowboy Hat\">Cowboy Hat</option></optgroup>",
|
411
|
+
grouped_options_for_select([["Hats", ["Baseball Cap", "Cowboy Hat"]]], nil, prompt: "<Choose One>"))
|
412
|
+
end
|
413
|
+
|
414
|
+
def test_optgroups_with_with_options_with_hash
|
415
|
+
assert_dom_equal(
|
416
|
+
"<optgroup label=\"North America\"><option value=\"United States\">United States</option>\n<option value=\"Canada\">Canada</option></optgroup><optgroup label=\"Europe\"><option value=\"Denmark\">Denmark</option>\n<option value=\"Germany\">Germany</option></optgroup>",
|
417
|
+
grouped_options_for_select("North America" => ["United States", "Canada"], "Europe" => ["Denmark", "Germany"])
|
418
|
+
)
|
419
|
+
end
|
420
|
+
|
421
|
+
def test_time_zone_options_no_params
|
422
|
+
opts = time_zone_options_for_select
|
423
|
+
assert_dom_equal "<option value=\"A\">A</option>\n" \
|
424
|
+
"<option value=\"B\">B</option>\n" \
|
425
|
+
"<option value=\"C\">C</option>\n" \
|
426
|
+
"<option value=\"D\">D</option>\n" \
|
427
|
+
"<option value=\"E\">E</option>",
|
428
|
+
opts
|
429
|
+
end
|
430
|
+
|
431
|
+
def test_time_zone_options_with_selected
|
432
|
+
opts = time_zone_options_for_select("D")
|
433
|
+
assert_dom_equal "<option value=\"A\">A</option>\n" \
|
434
|
+
"<option value=\"B\">B</option>\n" \
|
435
|
+
"<option value=\"C\">C</option>\n" \
|
436
|
+
"<option value=\"D\" selected=\"selected\">D</option>\n" \
|
437
|
+
"<option value=\"E\">E</option>",
|
438
|
+
opts
|
439
|
+
end
|
440
|
+
|
441
|
+
def test_time_zone_options_with_unknown_selected
|
442
|
+
opts = time_zone_options_for_select("K")
|
443
|
+
assert_dom_equal "<option value=\"A\">A</option>\n" \
|
444
|
+
"<option value=\"B\">B</option>\n" \
|
445
|
+
"<option value=\"C\">C</option>\n" \
|
446
|
+
"<option value=\"D\">D</option>\n" \
|
447
|
+
"<option value=\"E\">E</option>",
|
448
|
+
opts
|
449
|
+
end
|
450
|
+
|
451
|
+
def test_time_zone_options_with_priority_zones
|
452
|
+
zones = [ ActiveSupport::TimeZone.new("B"), ActiveSupport::TimeZone.new("E") ]
|
453
|
+
opts = time_zone_options_for_select(nil, zones)
|
454
|
+
assert_dom_equal "<option value=\"B\">B</option>\n" \
|
455
|
+
"<option value=\"E\">E</option>" \
|
456
|
+
"<option value=\"\" disabled=\"disabled\">-------------</option>\n" \
|
457
|
+
"<option value=\"A\">A</option>\n" \
|
458
|
+
"<option value=\"C\">C</option>\n" \
|
459
|
+
"<option value=\"D\">D</option>",
|
460
|
+
opts
|
461
|
+
end
|
462
|
+
|
463
|
+
def test_time_zone_options_with_selected_priority_zones
|
464
|
+
zones = [ ActiveSupport::TimeZone.new("B"), ActiveSupport::TimeZone.new("E") ]
|
465
|
+
opts = time_zone_options_for_select("E", zones)
|
466
|
+
assert_dom_equal "<option value=\"B\">B</option>\n" \
|
467
|
+
"<option value=\"E\" selected=\"selected\">E</option>" \
|
468
|
+
"<option value=\"\" disabled=\"disabled\">-------------</option>\n" \
|
469
|
+
"<option value=\"A\">A</option>\n" \
|
470
|
+
"<option value=\"C\">C</option>\n" \
|
471
|
+
"<option value=\"D\">D</option>",
|
472
|
+
opts
|
473
|
+
end
|
474
|
+
|
475
|
+
def test_time_zone_options_with_unselected_priority_zones
|
476
|
+
zones = [ ActiveSupport::TimeZone.new("B"), ActiveSupport::TimeZone.new("E") ]
|
477
|
+
opts = time_zone_options_for_select("C", zones)
|
478
|
+
assert_dom_equal "<option value=\"B\">B</option>\n" \
|
479
|
+
"<option value=\"E\">E</option>" \
|
480
|
+
"<option value=\"\" disabled=\"disabled\">-------------</option>\n" \
|
481
|
+
"<option value=\"A\">A</option>\n" \
|
482
|
+
"<option value=\"C\" selected=\"selected\">C</option>\n" \
|
483
|
+
"<option value=\"D\">D</option>",
|
484
|
+
opts
|
485
|
+
end
|
486
|
+
|
487
|
+
def test_time_zone_options_with_priority_zones_does_not_mutate_time_zones
|
488
|
+
original_zones = ActiveSupport::TimeZone.all.dup
|
489
|
+
zones = [ ActiveSupport::TimeZone.new("B"), ActiveSupport::TimeZone.new("E") ]
|
490
|
+
time_zone_options_for_select(nil, zones)
|
491
|
+
assert_equal original_zones, ActiveSupport::TimeZone.all
|
492
|
+
end
|
493
|
+
|
494
|
+
def test_time_zone_options_returns_html_safe_string
|
495
|
+
assert_predicate time_zone_options_for_select, :html_safe?
|
496
|
+
end
|
497
|
+
|
498
|
+
def test_select
|
499
|
+
@post = Post.new
|
500
|
+
@post.category = "<mus>"
|
501
|
+
assert_dom_equal(
|
502
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"abe\">abe</option>\n<option value=\"<mus>\" selected=\"selected\"><mus></option>\n<option value=\"hest\">hest</option></select>",
|
503
|
+
select("post", "category", %w( abe <mus> hest))
|
504
|
+
)
|
505
|
+
end
|
506
|
+
|
507
|
+
def test_select_without_multiple
|
508
|
+
assert_dom_equal(
|
509
|
+
"<select id=\"post_category\" name=\"post[category]\"></select>",
|
510
|
+
select(:post, :category, "", {}, { multiple: false })
|
511
|
+
)
|
512
|
+
end
|
513
|
+
|
514
|
+
def test_select_with_grouped_collection_as_nested_array
|
515
|
+
@post = Post.new
|
516
|
+
|
517
|
+
countries_by_continent = [
|
518
|
+
["<Africa>", [["<South Africa>", "<sa>"], ["Somalia", "so"]]],
|
519
|
+
["Europe", [["Denmark", "dk"], ["Ireland", "ie"]]],
|
520
|
+
]
|
521
|
+
|
522
|
+
assert_dom_equal(
|
523
|
+
[
|
524
|
+
'<select id="post_origin" name="post[origin]"><optgroup label="<Africa>"><option value="<sa>"><South Africa></option>',
|
525
|
+
'<option value="so">Somalia</option></optgroup><optgroup label="Europe"><option value="dk">Denmark</option>',
|
526
|
+
'<option value="ie">Ireland</option></optgroup></select>',
|
527
|
+
].join("\n"),
|
528
|
+
select("post", "origin", countries_by_continent)
|
529
|
+
)
|
530
|
+
end
|
531
|
+
|
532
|
+
def test_select_with_grouped_collection_as_hash
|
533
|
+
@post = Post.new
|
534
|
+
|
535
|
+
countries_by_continent = {
|
536
|
+
"<Africa>" => [["<South Africa>", "<sa>"], ["Somalia", "so"]],
|
537
|
+
"Europe" => [["Denmark", "dk"], ["Ireland", "ie"]],
|
538
|
+
}
|
539
|
+
|
540
|
+
assert_dom_equal(
|
541
|
+
[
|
542
|
+
'<select id="post_origin" name="post[origin]"><optgroup label="<Africa>"><option value="<sa>"><South Africa></option>',
|
543
|
+
'<option value="so">Somalia</option></optgroup><optgroup label="Europe"><option value="dk">Denmark</option>',
|
544
|
+
'<option value="ie">Ireland</option></optgroup></select>',
|
545
|
+
].join("\n"),
|
546
|
+
select("post", "origin", countries_by_continent)
|
547
|
+
)
|
548
|
+
end
|
549
|
+
|
550
|
+
def test_select_with_boolean_method
|
551
|
+
@post = Post.new
|
552
|
+
@post.allow_comments = false
|
553
|
+
assert_dom_equal(
|
554
|
+
"<select id=\"post_allow_comments\" name=\"post[allow_comments]\"><option value=\"true\">true</option>\n<option value=\"false\" selected=\"selected\">false</option></select>",
|
555
|
+
select("post", "allow_comments", %w( true false ))
|
556
|
+
)
|
557
|
+
end
|
558
|
+
|
559
|
+
def test_select_under_fields_for
|
560
|
+
@post = Post.new
|
561
|
+
@post.category = "<mus>"
|
562
|
+
|
563
|
+
output_buffer = fields_for :post, @post do |f|
|
564
|
+
concat f.select(:category, %w( abe <mus> hest))
|
565
|
+
end
|
566
|
+
|
567
|
+
assert_dom_equal(
|
568
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"abe\">abe</option>\n<option value=\"<mus>\" selected=\"selected\"><mus></option>\n<option value=\"hest\">hest</option></select>",
|
569
|
+
output_buffer
|
570
|
+
)
|
571
|
+
end
|
572
|
+
|
573
|
+
def test_fields_for_with_record_inherited_from_hash
|
574
|
+
map = Map.new
|
575
|
+
|
576
|
+
output_buffer = fields_for :map, map do |f|
|
577
|
+
concat f.select(:category, %w( abe <mus> hest))
|
578
|
+
end
|
579
|
+
|
580
|
+
assert_dom_equal(
|
581
|
+
"<select id=\"map_category\" name=\"map[category]\"><option value=\"abe\">abe</option>\n<option value=\"<mus>\" selected=\"selected\"><mus></option>\n<option value=\"hest\">hest</option></select>",
|
582
|
+
output_buffer
|
583
|
+
)
|
584
|
+
end
|
585
|
+
|
586
|
+
def test_select_under_fields_for_with_index
|
587
|
+
@post = Post.new
|
588
|
+
@post.category = "<mus>"
|
589
|
+
|
590
|
+
output_buffer = fields_for :post, @post, index: 108 do |f|
|
591
|
+
concat f.select(:category, %w( abe <mus> hest))
|
592
|
+
end
|
593
|
+
|
594
|
+
assert_dom_equal(
|
595
|
+
"<select id=\"post_108_category\" name=\"post[108][category]\"><option value=\"abe\">abe</option>\n<option value=\"<mus>\" selected=\"selected\"><mus></option>\n<option value=\"hest\">hest</option></select>",
|
596
|
+
output_buffer
|
597
|
+
)
|
598
|
+
end
|
599
|
+
|
600
|
+
def test_select_under_fields_for_with_auto_index
|
601
|
+
@post = Post.new
|
602
|
+
@post.category = "<mus>"
|
603
|
+
def @post.to_param; 108; end
|
604
|
+
|
605
|
+
output_buffer = fields_for "post[]", @post do |f|
|
606
|
+
concat f.select(:category, %w( abe <mus> hest))
|
607
|
+
end
|
608
|
+
|
609
|
+
assert_dom_equal(
|
610
|
+
"<select id=\"post_108_category\" name=\"post[108][category]\"><option value=\"abe\">abe</option>\n<option value=\"<mus>\" selected=\"selected\"><mus></option>\n<option value=\"hest\">hest</option></select>",
|
611
|
+
output_buffer
|
612
|
+
)
|
613
|
+
end
|
614
|
+
|
615
|
+
def test_select_under_fields_for_with_string_and_given_prompt
|
616
|
+
@post = Post.new
|
617
|
+
options = raw("<option value=\"abe\">abe</option><option value=\"mus\">mus</option><option value=\"hest\">hest</option>")
|
618
|
+
|
619
|
+
output_buffer = fields_for :post, @post do |f|
|
620
|
+
concat f.select(:category, options, prompt: "The prompt")
|
621
|
+
end
|
622
|
+
|
623
|
+
assert_dom_equal(
|
624
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"\">The prompt</option>\n#{options}</select>",
|
625
|
+
output_buffer
|
626
|
+
)
|
627
|
+
end
|
628
|
+
|
629
|
+
def test_select_under_fields_for_with_block
|
630
|
+
@post = Post.new
|
631
|
+
|
632
|
+
output_buffer = fields_for :post, @post do |f|
|
633
|
+
concat(f.select(:category) do
|
634
|
+
concat content_tag(:option, "hello world")
|
635
|
+
end)
|
636
|
+
end
|
637
|
+
|
638
|
+
assert_dom_equal(
|
639
|
+
"<select id=\"post_category\" name=\"post[category]\"><option>hello world</option></select>",
|
640
|
+
output_buffer
|
641
|
+
)
|
642
|
+
end
|
643
|
+
|
644
|
+
def test_select_under_fields_for_with_block_without_options
|
645
|
+
@post = Post.new
|
646
|
+
|
647
|
+
output_buffer = fields_for :post, @post do |f|
|
648
|
+
concat(f.select(:category) {})
|
649
|
+
end
|
650
|
+
|
651
|
+
assert_dom_equal(
|
652
|
+
"<select id=\"post_category\" name=\"post[category]\"></select>",
|
653
|
+
output_buffer
|
654
|
+
)
|
655
|
+
end
|
656
|
+
|
657
|
+
def test_select_with_multiple_to_add_hidden_input
|
658
|
+
output_buffer = select(:post, :category, "", {}, { multiple: true })
|
659
|
+
assert_dom_equal(
|
660
|
+
"<input type=\"hidden\" name=\"post[category][]\" value=\"\"/><select multiple=\"multiple\" id=\"post_category\" name=\"post[category][]\"></select>",
|
661
|
+
output_buffer
|
662
|
+
)
|
663
|
+
end
|
664
|
+
|
665
|
+
def test_select_with_multiple_and_without_hidden_input
|
666
|
+
output_buffer = select(:post, :category, "", { include_hidden: false }, { multiple: true })
|
667
|
+
assert_dom_equal(
|
668
|
+
"<select multiple=\"multiple\" id=\"post_category\" name=\"post[category][]\"></select>",
|
669
|
+
output_buffer
|
670
|
+
)
|
671
|
+
end
|
672
|
+
|
673
|
+
def test_select_with_multiple_and_with_explicit_name_ending_with_brackets
|
674
|
+
output_buffer = select(:post, :category, [], { include_hidden: false }, { multiple: true, name: "post[category][]" })
|
675
|
+
assert_dom_equal(
|
676
|
+
"<select multiple=\"multiple\" id=\"post_category\" name=\"post[category][]\"></select>",
|
677
|
+
output_buffer
|
678
|
+
)
|
679
|
+
end
|
680
|
+
|
681
|
+
def test_select_with_multiple_and_disabled_to_add_disabled_hidden_input
|
682
|
+
output_buffer = select(:post, :category, "", {}, { multiple: true, disabled: true })
|
683
|
+
assert_dom_equal(
|
684
|
+
"<input disabled=\"disabled\"type=\"hidden\" name=\"post[category][]\" value=\"\"/><select multiple=\"multiple\" disabled=\"disabled\" id=\"post_category\" name=\"post[category][]\"></select>",
|
685
|
+
output_buffer
|
686
|
+
)
|
687
|
+
end
|
688
|
+
|
689
|
+
def test_select_with_blank
|
690
|
+
@post = Post.new
|
691
|
+
@post.category = "<mus>"
|
692
|
+
assert_dom_equal(
|
693
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"\"></option>\n<option value=\"abe\">abe</option>\n<option value=\"<mus>\" selected=\"selected\"><mus></option>\n<option value=\"hest\">hest</option></select>",
|
694
|
+
select("post", "category", %w( abe <mus> hest), include_blank: true)
|
695
|
+
)
|
696
|
+
end
|
697
|
+
|
698
|
+
def test_select_with_include_blank_false_and_required
|
699
|
+
@post = Post.new
|
700
|
+
@post.category = "<mus>"
|
701
|
+
e = assert_raises(ArgumentError) { select("post", "category", %w( abe <mus> hest), { include_blank: false }, { required: "required" }) }
|
702
|
+
assert_match(/include_blank cannot be false for a required field./, e.message)
|
703
|
+
end
|
704
|
+
|
705
|
+
def test_select_with_blank_as_string
|
706
|
+
@post = Post.new
|
707
|
+
@post.category = "<mus>"
|
708
|
+
assert_dom_equal(
|
709
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"\">None</option>\n<option value=\"abe\">abe</option>\n<option value=\"<mus>\" selected=\"selected\"><mus></option>\n<option value=\"hest\">hest</option></select>",
|
710
|
+
select("post", "category", %w( abe <mus> hest), include_blank: "None")
|
711
|
+
)
|
712
|
+
end
|
713
|
+
|
714
|
+
def test_select_with_blank_as_string_escaped
|
715
|
+
@post = Post.new
|
716
|
+
@post.category = "<mus>"
|
717
|
+
assert_dom_equal(
|
718
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"\"><None></option>\n<option value=\"abe\">abe</option>\n<option value=\"<mus>\" selected=\"selected\"><mus></option>\n<option value=\"hest\">hest</option></select>",
|
719
|
+
select("post", "category", %w( abe <mus> hest), include_blank: "<None>")
|
720
|
+
)
|
721
|
+
end
|
722
|
+
|
723
|
+
def test_select_with_default_prompt
|
724
|
+
@post = Post.new
|
725
|
+
@post.category = ""
|
726
|
+
assert_dom_equal(
|
727
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"\">Please select</option>\n<option value=\"abe\">abe</option>\n<option value=\"<mus>\"><mus></option>\n<option value=\"hest\">hest</option></select>",
|
728
|
+
select("post", "category", %w( abe <mus> hest), prompt: true)
|
729
|
+
)
|
730
|
+
end
|
731
|
+
|
732
|
+
def test_select_no_prompt_when_select_has_value
|
733
|
+
@post = Post.new
|
734
|
+
@post.category = "<mus>"
|
735
|
+
assert_dom_equal(
|
736
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"abe\">abe</option>\n<option value=\"<mus>\" selected=\"selected\"><mus></option>\n<option value=\"hest\">hest</option></select>",
|
737
|
+
select("post", "category", %w( abe <mus> hest), prompt: true)
|
738
|
+
)
|
739
|
+
end
|
740
|
+
|
741
|
+
def test_select_with_given_prompt
|
742
|
+
@post = Post.new
|
743
|
+
@post.category = ""
|
744
|
+
assert_dom_equal(
|
745
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"\">The prompt</option>\n<option value=\"abe\">abe</option>\n<option value=\"<mus>\"><mus></option>\n<option value=\"hest\">hest</option></select>",
|
746
|
+
select("post", "category", %w( abe <mus> hest), prompt: "The prompt")
|
747
|
+
)
|
748
|
+
end
|
749
|
+
|
750
|
+
def test_select_with_given_prompt_escaped
|
751
|
+
@post = Post.new
|
752
|
+
assert_dom_equal(
|
753
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"\"><The prompt></option>\n<option value=\"abe\">abe</option>\n<option value=\"<mus>\"><mus></option>\n<option value=\"hest\">hest</option></select>",
|
754
|
+
select("post", "category", %w( abe <mus> hest), prompt: "<The prompt>")
|
755
|
+
)
|
756
|
+
end
|
757
|
+
|
758
|
+
def test_select_with_prompt_and_blank
|
759
|
+
@post = Post.new
|
760
|
+
@post.category = ""
|
761
|
+
assert_dom_equal(
|
762
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"\">Please select</option>\n<option value=\"\"></option>\n<option value=\"abe\">abe</option>\n<option value=\"<mus>\"><mus></option>\n<option value=\"hest\">hest</option></select>",
|
763
|
+
select("post", "category", %w( abe <mus> hest), prompt: true, include_blank: true)
|
764
|
+
)
|
765
|
+
end
|
766
|
+
|
767
|
+
def test_select_with_empty
|
768
|
+
@post = Post.new
|
769
|
+
@post.category = ""
|
770
|
+
assert_dom_equal(
|
771
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"\">Please select</option>\n<option value=\"\"></option>\n</select>",
|
772
|
+
select("post", "category", [], prompt: true, include_blank: true)
|
773
|
+
)
|
774
|
+
end
|
775
|
+
|
776
|
+
def test_select_with_html_options
|
777
|
+
@post = Post.new
|
778
|
+
@post.category = ""
|
779
|
+
assert_dom_equal(
|
780
|
+
"<select class=\"disabled\" disabled=\"disabled\" name=\"post[category]\" id=\"post_category\"><option value=\"\">Please select</option>\n<option value=\"\"></option>\n</select>",
|
781
|
+
select("post", "category", [], { prompt: true, include_blank: true }, { class: "disabled", disabled: true })
|
782
|
+
)
|
783
|
+
end
|
784
|
+
|
785
|
+
def test_select_with_nil
|
786
|
+
@post = Post.new
|
787
|
+
@post.category = "othervalue"
|
788
|
+
assert_dom_equal(
|
789
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"\"></option>\n<option value=\"othervalue\" selected=\"selected\">othervalue</option></select>",
|
790
|
+
select("post", "category", [nil, "othervalue"])
|
791
|
+
)
|
792
|
+
end
|
793
|
+
|
794
|
+
def test_required_select
|
795
|
+
assert_dom_equal(
|
796
|
+
%(<select id="post_category" name="post[category]" required="required"><option value=""></option>\n<option value="abe">abe</option>\n<option value="mus">mus</option>\n<option value="hest">hest</option></select>),
|
797
|
+
select("post", "category", %w(abe mus hest), {}, { required: true })
|
798
|
+
)
|
799
|
+
end
|
800
|
+
|
801
|
+
def test_required_select_with_include_blank_prompt
|
802
|
+
assert_dom_equal(
|
803
|
+
%(<select id="post_category" name="post[category]" required="required"><option value="">Select one</option>\n<option value="abe">abe</option>\n<option value="mus">mus</option>\n<option value="hest">hest</option></select>),
|
804
|
+
select("post", "category", %w(abe mus hest), { include_blank: "Select one" }, { required: true })
|
805
|
+
)
|
806
|
+
end
|
807
|
+
|
808
|
+
def test_required_select_with_prompt
|
809
|
+
assert_dom_equal(
|
810
|
+
%(<select id="post_category" name="post[category]" required="required"><option value="">Select one</option>\n<option value="abe">abe</option>\n<option value="mus">mus</option>\n<option value="hest">hest</option></select>),
|
811
|
+
select("post", "category", %w(abe mus hest), { prompt: "Select one" }, { required: true })
|
812
|
+
)
|
813
|
+
end
|
814
|
+
|
815
|
+
def test_required_select_display_size_equals_to_one
|
816
|
+
assert_dom_equal(
|
817
|
+
%(<select id="post_category" name="post[category]" required="required" size="1"><option value=""></option>\n<option value="abe">abe</option>\n<option value="mus">mus</option>\n<option value="hest">hest</option></select>),
|
818
|
+
select("post", "category", %w(abe mus hest), {}, { required: true, size: 1 })
|
819
|
+
)
|
820
|
+
end
|
821
|
+
|
822
|
+
def test_required_select_with_display_size_bigger_than_one
|
823
|
+
assert_dom_equal(
|
824
|
+
%(<select id="post_category" name="post[category]" required="required" size="2"><option value="abe">abe</option>\n<option value="mus">mus</option>\n<option value="hest">hest</option></select>),
|
825
|
+
select("post", "category", %w(abe mus hest), {}, { required: true, size: 2 })
|
826
|
+
)
|
827
|
+
end
|
828
|
+
|
829
|
+
def test_required_select_with_multiple_option
|
830
|
+
assert_dom_equal(
|
831
|
+
%(<input name="post[category][]" type="hidden" value=""/><select id="post_category" multiple="multiple" name="post[category][]" required="required"><option value="abe">abe</option>\n<option value="mus">mus</option>\n<option value="hest">hest</option></select>),
|
832
|
+
select("post", "category", %w(abe mus hest), {}, { required: true, multiple: true })
|
833
|
+
)
|
834
|
+
end
|
835
|
+
|
836
|
+
def test_select_with_integer
|
837
|
+
@post = Post.new
|
838
|
+
@post.category = ""
|
839
|
+
assert_dom_equal(
|
840
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"\">Please select</option>\n<option value=\"\"></option>\n<option value=\"1\">1</option></select>",
|
841
|
+
select("post", "category", [1], prompt: true, include_blank: true)
|
842
|
+
)
|
843
|
+
end
|
844
|
+
|
845
|
+
def test_list_of_lists
|
846
|
+
@post = Post.new
|
847
|
+
@post.category = ""
|
848
|
+
assert_dom_equal(
|
849
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"\">Please select</option>\n<option value=\"\"></option>\n<option value=\"number\">Number</option>\n<option value=\"text\">Text</option>\n<option value=\"boolean\">Yes/No</option></select>",
|
850
|
+
select("post", "category", [["Number", "number"], ["Text", "text"], ["Yes/No", "boolean"]], prompt: true, include_blank: true)
|
851
|
+
)
|
852
|
+
end
|
853
|
+
|
854
|
+
def test_select_with_selected_value
|
855
|
+
@post = Post.new
|
856
|
+
@post.category = "<mus>"
|
857
|
+
assert_dom_equal(
|
858
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"abe\" selected=\"selected\">abe</option>\n<option value=\"<mus>\"><mus></option>\n<option value=\"hest\">hest</option></select>",
|
859
|
+
select("post", "category", %w( abe <mus> hest ), selected: "abe")
|
860
|
+
)
|
861
|
+
end
|
862
|
+
|
863
|
+
def test_select_with_index_option
|
864
|
+
@album = Album.new
|
865
|
+
@album.id = 1
|
866
|
+
|
867
|
+
expected = "<select id=\"album__genre\" name=\"album[][genre]\"><option value=\"rap\">rap</option>\n<option value=\"rock\">rock</option>\n<option value=\"country\">country</option></select>"
|
868
|
+
|
869
|
+
assert_dom_equal(
|
870
|
+
expected,
|
871
|
+
select("album[]", "genre", %w[rap rock country], {}, { index: nil })
|
872
|
+
)
|
873
|
+
end
|
874
|
+
|
875
|
+
def test_select_escapes_options
|
876
|
+
assert_dom_equal(
|
877
|
+
'<select id="post_title" name="post[title]"><script>alert(1)</script></select>',
|
878
|
+
select("post", "title", "<script>alert(1)</script>")
|
879
|
+
)
|
880
|
+
end
|
881
|
+
|
882
|
+
def test_select_with_selected_nil
|
883
|
+
@post = Post.new
|
884
|
+
@post.category = "<mus>"
|
885
|
+
assert_dom_equal(
|
886
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"abe\">abe</option>\n<option value=\"<mus>\"><mus></option>\n<option value=\"hest\">hest</option></select>",
|
887
|
+
select("post", "category", %w( abe <mus> hest ), selected: nil)
|
888
|
+
)
|
889
|
+
end
|
890
|
+
|
891
|
+
def test_select_with_disabled_value
|
892
|
+
@post = Post.new
|
893
|
+
@post.category = "<mus>"
|
894
|
+
assert_dom_equal(
|
895
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"abe\">abe</option>\n<option value=\"<mus>\" selected=\"selected\"><mus></option>\n<option value=\"hest\" disabled=\"disabled\">hest</option></select>",
|
896
|
+
select("post", "category", %w( abe <mus> hest ), disabled: "hest")
|
897
|
+
)
|
898
|
+
end
|
899
|
+
|
900
|
+
def test_select_not_existing_method_with_selected_value
|
901
|
+
@post = Post.new
|
902
|
+
assert_dom_equal(
|
903
|
+
"<select id=\"post_locale\" name=\"post[locale]\"><option value=\"en\">en</option>\n<option value=\"ru\" selected=\"selected\">ru</option></select>",
|
904
|
+
select("post", "locale", %w( en ru ), selected: "ru")
|
905
|
+
)
|
906
|
+
end
|
907
|
+
|
908
|
+
def test_select_with_prompt_and_selected_value
|
909
|
+
@post = Post.new
|
910
|
+
assert_dom_equal(
|
911
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"one\">one</option>\n<option selected=\"selected\" value=\"two\">two</option></select>",
|
912
|
+
select("post", "category", %w( one two ), selected: "two", prompt: true)
|
913
|
+
)
|
914
|
+
end
|
915
|
+
|
916
|
+
def test_select_with_disabled_array
|
917
|
+
@post = Post.new
|
918
|
+
@post.category = "<mus>"
|
919
|
+
assert_dom_equal(
|
920
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"abe\" disabled=\"disabled\">abe</option>\n<option value=\"<mus>\" selected=\"selected\"><mus></option>\n<option value=\"hest\" disabled=\"disabled\">hest</option></select>",
|
921
|
+
select("post", "category", %w( abe <mus> hest ), disabled: ["hest", "abe"])
|
922
|
+
)
|
923
|
+
end
|
924
|
+
|
925
|
+
def test_select_with_range
|
926
|
+
@post = Post.new
|
927
|
+
@post.category = 0
|
928
|
+
assert_dom_equal(
|
929
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"1\">1</option>\n<option value=\"2\">2</option>\n<option value=\"3\">3</option></select>",
|
930
|
+
select("post", "category", 1..3)
|
931
|
+
)
|
932
|
+
end
|
933
|
+
|
934
|
+
def test_select_with_enumerable
|
935
|
+
@post = Post.new
|
936
|
+
assert_dom_equal(
|
937
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"one\">one</option>\n<option value=\"two\">two</option></select>",
|
938
|
+
select("post", "category", CustomEnumerable.new)
|
939
|
+
)
|
940
|
+
end
|
941
|
+
|
942
|
+
def test_collection_select
|
943
|
+
@post = Post.new
|
944
|
+
@post.author_name = "Babe"
|
945
|
+
|
946
|
+
assert_dom_equal(
|
947
|
+
"<select id=\"post_author_name\" name=\"post[author_name]\"><option value=\"<Abe>\"><Abe></option>\n<option value=\"Babe\" selected=\"selected\">Babe</option>\n<option value=\"Cabe\">Cabe</option></select>",
|
948
|
+
collection_select("post", "author_name", dummy_posts, "author_name", "author_name")
|
949
|
+
)
|
950
|
+
end
|
951
|
+
|
952
|
+
def test_collection_select_under_fields_for
|
953
|
+
@post = Post.new
|
954
|
+
@post.author_name = "Babe"
|
955
|
+
|
956
|
+
output_buffer = fields_for :post, @post do |f|
|
957
|
+
concat f.collection_select(:author_name, dummy_posts, :author_name, :author_name)
|
958
|
+
end
|
959
|
+
|
960
|
+
assert_dom_equal(
|
961
|
+
"<select id=\"post_author_name\" name=\"post[author_name]\"><option value=\"<Abe>\"><Abe></option>\n<option value=\"Babe\" selected=\"selected\">Babe</option>\n<option value=\"Cabe\">Cabe</option></select>",
|
962
|
+
output_buffer
|
963
|
+
)
|
964
|
+
end
|
965
|
+
|
966
|
+
def test_collection_select_under_fields_for_with_index
|
967
|
+
@post = Post.new
|
968
|
+
@post.author_name = "Babe"
|
969
|
+
|
970
|
+
output_buffer = fields_for :post, @post, index: 815 do |f|
|
971
|
+
concat f.collection_select(:author_name, dummy_posts, :author_name, :author_name)
|
972
|
+
end
|
973
|
+
|
974
|
+
assert_dom_equal(
|
975
|
+
"<select id=\"post_815_author_name\" name=\"post[815][author_name]\"><option value=\"<Abe>\"><Abe></option>\n<option value=\"Babe\" selected=\"selected\">Babe</option>\n<option value=\"Cabe\">Cabe</option></select>",
|
976
|
+
output_buffer
|
977
|
+
)
|
978
|
+
end
|
979
|
+
|
980
|
+
def test_collection_select_under_fields_for_with_auto_index
|
981
|
+
@post = Post.new
|
982
|
+
@post.author_name = "Babe"
|
983
|
+
def @post.to_param; 815; end
|
984
|
+
|
985
|
+
output_buffer = fields_for "post[]", @post do |f|
|
986
|
+
concat f.collection_select(:author_name, dummy_posts, :author_name, :author_name)
|
987
|
+
end
|
988
|
+
|
989
|
+
assert_dom_equal(
|
990
|
+
"<select id=\"post_815_author_name\" name=\"post[815][author_name]\"><option value=\"<Abe>\"><Abe></option>\n<option value=\"Babe\" selected=\"selected\">Babe</option>\n<option value=\"Cabe\">Cabe</option></select>",
|
991
|
+
output_buffer
|
992
|
+
)
|
993
|
+
end
|
994
|
+
|
995
|
+
def test_collection_select_with_blank_and_style
|
996
|
+
@post = Post.new
|
997
|
+
@post.author_name = "Babe"
|
998
|
+
|
999
|
+
assert_dom_equal(
|
1000
|
+
"<select id=\"post_author_name\" name=\"post[author_name]\" style=\"width: 200px\"><option value=\"\"></option>\n<option value=\"<Abe>\"><Abe></option>\n<option value=\"Babe\" selected=\"selected\">Babe</option>\n<option value=\"Cabe\">Cabe</option></select>",
|
1001
|
+
collection_select("post", "author_name", dummy_posts, "author_name", "author_name", { include_blank: true }, { "style" => "width: 200px" })
|
1002
|
+
)
|
1003
|
+
end
|
1004
|
+
|
1005
|
+
def test_collection_select_with_blank_as_string_and_style
|
1006
|
+
@post = Post.new
|
1007
|
+
@post.author_name = "Babe"
|
1008
|
+
|
1009
|
+
assert_dom_equal(
|
1010
|
+
"<select id=\"post_author_name\" name=\"post[author_name]\" style=\"width: 200px\"><option value=\"\">No Selection</option>\n<option value=\"<Abe>\"><Abe></option>\n<option value=\"Babe\" selected=\"selected\">Babe</option>\n<option value=\"Cabe\">Cabe</option></select>",
|
1011
|
+
collection_select("post", "author_name", dummy_posts, "author_name", "author_name", { include_blank: "No Selection" }, { "style" => "width: 200px" })
|
1012
|
+
)
|
1013
|
+
end
|
1014
|
+
|
1015
|
+
def test_collection_select_with_multiple_option_appends_array_brackets_and_hidden_input
|
1016
|
+
@post = Post.new
|
1017
|
+
@post.author_name = "Babe"
|
1018
|
+
|
1019
|
+
expected = "<input type=\"hidden\" name=\"post[author_name][]\" value=\"\"/><select id=\"post_author_name\" name=\"post[author_name][]\" multiple=\"multiple\"><option value=\"\"></option>\n<option value=\"<Abe>\"><Abe></option>\n<option value=\"Babe\" selected=\"selected\">Babe</option>\n<option value=\"Cabe\">Cabe</option></select>"
|
1020
|
+
|
1021
|
+
# Should suffix default name with [].
|
1022
|
+
assert_dom_equal expected, collection_select("post", "author_name", dummy_posts, "author_name", "author_name", { include_blank: true }, { multiple: true })
|
1023
|
+
|
1024
|
+
# Shouldn't suffix custom name with [].
|
1025
|
+
assert_dom_equal expected, collection_select("post", "author_name", dummy_posts, "author_name", "author_name", { include_blank: true, name: "post[author_name][]" }, { multiple: true })
|
1026
|
+
end
|
1027
|
+
|
1028
|
+
def test_collection_select_with_blank_and_selected
|
1029
|
+
@post = Post.new
|
1030
|
+
@post.author_name = "Babe"
|
1031
|
+
|
1032
|
+
assert_dom_equal(
|
1033
|
+
%{<select id="post_author_name" name="post[author_name]"><option value=""></option>\n<option value="<Abe>" selected="selected"><Abe></option>\n<option value="Babe">Babe</option>\n<option value="Cabe">Cabe</option></select>},
|
1034
|
+
collection_select("post", "author_name", dummy_posts, "author_name", "author_name", include_blank: true, selected: "<Abe>")
|
1035
|
+
)
|
1036
|
+
end
|
1037
|
+
|
1038
|
+
def test_collection_select_with_disabled
|
1039
|
+
@post = Post.new
|
1040
|
+
@post.author_name = "Babe"
|
1041
|
+
|
1042
|
+
assert_dom_equal(
|
1043
|
+
"<select id=\"post_author_name\" name=\"post[author_name]\"><option value=\"<Abe>\"><Abe></option>\n<option value=\"Babe\" selected=\"selected\">Babe</option>\n<option value=\"Cabe\" disabled=\"disabled\">Cabe</option></select>",
|
1044
|
+
collection_select("post", "author_name", dummy_posts, "author_name", "author_name", disabled: "Cabe")
|
1045
|
+
)
|
1046
|
+
end
|
1047
|
+
|
1048
|
+
def test_collection_select_with_proc_for_value_method
|
1049
|
+
@post = Post.new
|
1050
|
+
|
1051
|
+
assert_dom_equal(
|
1052
|
+
"<select id=\"post_author_name\" name=\"post[author_name]\"><option value=\"<Abe>\"><Abe> went home</option>\n<option value=\"Babe\">Babe went home</option>\n<option value=\"Cabe\">Cabe went home</option></select>",
|
1053
|
+
collection_select("post", "author_name", dummy_posts, lambda { |p| p.author_name }, "title")
|
1054
|
+
)
|
1055
|
+
end
|
1056
|
+
|
1057
|
+
def test_collection_select_with_proc_for_text_method
|
1058
|
+
@post = Post.new
|
1059
|
+
|
1060
|
+
assert_dom_equal(
|
1061
|
+
"<select id=\"post_author_name\" name=\"post[author_name]\"><option value=\"<Abe>\"><Abe> went home</option>\n<option value=\"Babe\">Babe went home</option>\n<option value=\"Cabe\">Cabe went home</option></select>",
|
1062
|
+
collection_select("post", "author_name", dummy_posts, "author_name", lambda { |p| p.title })
|
1063
|
+
)
|
1064
|
+
end
|
1065
|
+
|
1066
|
+
def test_time_zone_select
|
1067
|
+
@firm = Firm.new("D")
|
1068
|
+
html = time_zone_select("firm", "time_zone")
|
1069
|
+
assert_dom_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" \
|
1070
|
+
"<option value=\"A\">A</option>\n" \
|
1071
|
+
"<option value=\"B\">B</option>\n" \
|
1072
|
+
"<option value=\"C\">C</option>\n" \
|
1073
|
+
"<option value=\"D\" selected=\"selected\">D</option>\n" \
|
1074
|
+
"<option value=\"E\">E</option>" \
|
1075
|
+
"</select>",
|
1076
|
+
html
|
1077
|
+
end
|
1078
|
+
|
1079
|
+
def test_time_zone_select_under_fields_for
|
1080
|
+
@firm = Firm.new("D")
|
1081
|
+
|
1082
|
+
output_buffer = fields_for :firm, @firm do |f|
|
1083
|
+
concat f.time_zone_select(:time_zone)
|
1084
|
+
end
|
1085
|
+
|
1086
|
+
assert_dom_equal(
|
1087
|
+
"<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" \
|
1088
|
+
"<option value=\"A\">A</option>\n" \
|
1089
|
+
"<option value=\"B\">B</option>\n" \
|
1090
|
+
"<option value=\"C\">C</option>\n" \
|
1091
|
+
"<option value=\"D\" selected=\"selected\">D</option>\n" \
|
1092
|
+
"<option value=\"E\">E</option>" \
|
1093
|
+
"</select>",
|
1094
|
+
output_buffer
|
1095
|
+
)
|
1096
|
+
end
|
1097
|
+
|
1098
|
+
def test_time_zone_select_under_fields_for_with_index
|
1099
|
+
@firm = Firm.new("D")
|
1100
|
+
|
1101
|
+
output_buffer = fields_for :firm, @firm, index: 305 do |f|
|
1102
|
+
concat f.time_zone_select(:time_zone)
|
1103
|
+
end
|
1104
|
+
|
1105
|
+
assert_dom_equal(
|
1106
|
+
"<select id=\"firm_305_time_zone\" name=\"firm[305][time_zone]\">" \
|
1107
|
+
"<option value=\"A\">A</option>\n" \
|
1108
|
+
"<option value=\"B\">B</option>\n" \
|
1109
|
+
"<option value=\"C\">C</option>\n" \
|
1110
|
+
"<option value=\"D\" selected=\"selected\">D</option>\n" \
|
1111
|
+
"<option value=\"E\">E</option>" \
|
1112
|
+
"</select>",
|
1113
|
+
output_buffer
|
1114
|
+
)
|
1115
|
+
end
|
1116
|
+
|
1117
|
+
def test_time_zone_select_under_fields_for_with_auto_index
|
1118
|
+
@firm = Firm.new("D")
|
1119
|
+
def @firm.to_param; 305; end
|
1120
|
+
|
1121
|
+
output_buffer = fields_for "firm[]", @firm do |f|
|
1122
|
+
concat f.time_zone_select(:time_zone)
|
1123
|
+
end
|
1124
|
+
|
1125
|
+
assert_dom_equal(
|
1126
|
+
"<select id=\"firm_305_time_zone\" name=\"firm[305][time_zone]\">" \
|
1127
|
+
"<option value=\"A\">A</option>\n" \
|
1128
|
+
"<option value=\"B\">B</option>\n" \
|
1129
|
+
"<option value=\"C\">C</option>\n" \
|
1130
|
+
"<option value=\"D\" selected=\"selected\">D</option>\n" \
|
1131
|
+
"<option value=\"E\">E</option>" \
|
1132
|
+
"</select>",
|
1133
|
+
output_buffer
|
1134
|
+
)
|
1135
|
+
end
|
1136
|
+
|
1137
|
+
def test_time_zone_select_with_blank
|
1138
|
+
@firm = Firm.new("D")
|
1139
|
+
html = time_zone_select("firm", "time_zone", nil, include_blank: true)
|
1140
|
+
assert_dom_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" \
|
1141
|
+
"<option value=\"\"></option>\n" \
|
1142
|
+
"<option value=\"A\">A</option>\n" \
|
1143
|
+
"<option value=\"B\">B</option>\n" \
|
1144
|
+
"<option value=\"C\">C</option>\n" \
|
1145
|
+
"<option value=\"D\" selected=\"selected\">D</option>\n" \
|
1146
|
+
"<option value=\"E\">E</option>" \
|
1147
|
+
"</select>",
|
1148
|
+
html
|
1149
|
+
end
|
1150
|
+
|
1151
|
+
def test_time_zone_select_with_blank_as_string
|
1152
|
+
@firm = Firm.new("D")
|
1153
|
+
html = time_zone_select("firm", "time_zone", nil, include_blank: "No Zone")
|
1154
|
+
assert_dom_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" \
|
1155
|
+
"<option value=\"\">No Zone</option>\n" \
|
1156
|
+
"<option value=\"A\">A</option>\n" \
|
1157
|
+
"<option value=\"B\">B</option>\n" \
|
1158
|
+
"<option value=\"C\">C</option>\n" \
|
1159
|
+
"<option value=\"D\" selected=\"selected\">D</option>\n" \
|
1160
|
+
"<option value=\"E\">E</option>" \
|
1161
|
+
"</select>",
|
1162
|
+
html
|
1163
|
+
end
|
1164
|
+
|
1165
|
+
def test_time_zone_select_with_style
|
1166
|
+
@firm = Firm.new("D")
|
1167
|
+
html = time_zone_select("firm", "time_zone", nil, {},
|
1168
|
+
{ "style" => "color: red" })
|
1169
|
+
assert_dom_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\" style=\"color: red\">" \
|
1170
|
+
"<option value=\"A\">A</option>\n" \
|
1171
|
+
"<option value=\"B\">B</option>\n" \
|
1172
|
+
"<option value=\"C\">C</option>\n" \
|
1173
|
+
"<option value=\"D\" selected=\"selected\">D</option>\n" \
|
1174
|
+
"<option value=\"E\">E</option>" \
|
1175
|
+
"</select>",
|
1176
|
+
html
|
1177
|
+
assert_dom_equal html, time_zone_select("firm", "time_zone", nil, {},
|
1178
|
+
{ style: "color: red" })
|
1179
|
+
end
|
1180
|
+
|
1181
|
+
def test_time_zone_select_with_blank_and_style
|
1182
|
+
@firm = Firm.new("D")
|
1183
|
+
html = time_zone_select("firm", "time_zone", nil,
|
1184
|
+
{ include_blank: true }, { "style" => "color: red" })
|
1185
|
+
assert_dom_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\" style=\"color: red\">" \
|
1186
|
+
"<option value=\"\"></option>\n" \
|
1187
|
+
"<option value=\"A\">A</option>\n" \
|
1188
|
+
"<option value=\"B\">B</option>\n" \
|
1189
|
+
"<option value=\"C\">C</option>\n" \
|
1190
|
+
"<option value=\"D\" selected=\"selected\">D</option>\n" \
|
1191
|
+
"<option value=\"E\">E</option>" \
|
1192
|
+
"</select>",
|
1193
|
+
html
|
1194
|
+
assert_dom_equal html, time_zone_select("firm", "time_zone", nil,
|
1195
|
+
{ include_blank: true }, { style: "color: red" })
|
1196
|
+
end
|
1197
|
+
|
1198
|
+
def test_time_zone_select_with_blank_as_string_and_style
|
1199
|
+
@firm = Firm.new("D")
|
1200
|
+
html = time_zone_select("firm", "time_zone", nil,
|
1201
|
+
{ include_blank: "No Zone" }, { "style" => "color: red" })
|
1202
|
+
assert_dom_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\" style=\"color: red\">" \
|
1203
|
+
"<option value=\"\">No Zone</option>\n" \
|
1204
|
+
"<option value=\"A\">A</option>\n" \
|
1205
|
+
"<option value=\"B\">B</option>\n" \
|
1206
|
+
"<option value=\"C\">C</option>\n" \
|
1207
|
+
"<option value=\"D\" selected=\"selected\">D</option>\n" \
|
1208
|
+
"<option value=\"E\">E</option>" \
|
1209
|
+
"</select>",
|
1210
|
+
html
|
1211
|
+
assert_dom_equal html, time_zone_select("firm", "time_zone", nil,
|
1212
|
+
{ include_blank: "No Zone" }, { style: "color: red" })
|
1213
|
+
end
|
1214
|
+
|
1215
|
+
def test_time_zone_select_with_priority_zones
|
1216
|
+
@firm = Firm.new("D")
|
1217
|
+
zones = [ ActiveSupport::TimeZone.new("A"), ActiveSupport::TimeZone.new("D") ]
|
1218
|
+
html = time_zone_select("firm", "time_zone", zones)
|
1219
|
+
assert_dom_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" \
|
1220
|
+
"<option value=\"A\">A</option>\n" \
|
1221
|
+
"<option value=\"D\" selected=\"selected\">D</option>" \
|
1222
|
+
"<option value=\"\" disabled=\"disabled\">-------------</option>\n" \
|
1223
|
+
"<option value=\"B\">B</option>\n" \
|
1224
|
+
"<option value=\"C\">C</option>\n" \
|
1225
|
+
"<option value=\"E\">E</option>" \
|
1226
|
+
"</select>",
|
1227
|
+
html
|
1228
|
+
end
|
1229
|
+
|
1230
|
+
def test_time_zone_select_with_priority_zones_as_regexp
|
1231
|
+
@firm = Firm.new("D")
|
1232
|
+
|
1233
|
+
@fake_timezones.each do |tz|
|
1234
|
+
def tz.=~(re); %(A D).include?(name) end
|
1235
|
+
end
|
1236
|
+
|
1237
|
+
html = time_zone_select("firm", "time_zone", /A|D/)
|
1238
|
+
assert_dom_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" \
|
1239
|
+
"<option value=\"A\">A</option>\n" \
|
1240
|
+
"<option value=\"D\" selected=\"selected\">D</option>" \
|
1241
|
+
"<option value=\"\" disabled=\"disabled\">-------------</option>\n" \
|
1242
|
+
"<option value=\"B\">B</option>\n" \
|
1243
|
+
"<option value=\"C\">C</option>\n" \
|
1244
|
+
"<option value=\"E\">E</option>" \
|
1245
|
+
"</select>",
|
1246
|
+
html
|
1247
|
+
end
|
1248
|
+
|
1249
|
+
def test_time_zone_select_with_priority_zones_is_not_implemented_with_grep
|
1250
|
+
@firm = Firm.new("D")
|
1251
|
+
|
1252
|
+
# `time_zone_select` can't be written with `grep` because Active Support
|
1253
|
+
# time zones don't support implicit string coercion with `to_str`.
|
1254
|
+
@fake_timezones.each do |tz|
|
1255
|
+
def tz.===(zone); raise Exception; end
|
1256
|
+
end
|
1257
|
+
|
1258
|
+
html = time_zone_select("firm", "time_zone", /A|D/)
|
1259
|
+
assert_dom_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" \
|
1260
|
+
"<option value=\"\" disabled=\"disabled\">-------------</option>\n" \
|
1261
|
+
"<option value=\"A\">A</option>\n" \
|
1262
|
+
"<option value=\"B\">B</option>\n" \
|
1263
|
+
"<option value=\"C\">C</option>\n" \
|
1264
|
+
"<option value=\"D\" selected=\"selected\">D</option>\n" \
|
1265
|
+
"<option value=\"E\">E</option>" \
|
1266
|
+
"</select>",
|
1267
|
+
html
|
1268
|
+
end
|
1269
|
+
|
1270
|
+
def test_time_zone_select_with_priority_zones_and_errors
|
1271
|
+
@firm = Firm.new("D")
|
1272
|
+
@firm.extend ActiveModel::Validations
|
1273
|
+
@firm.errors[:time_zone] << "invalid"
|
1274
|
+
zones = [ ActiveSupport::TimeZone.new("A"), ActiveSupport::TimeZone.new("D") ]
|
1275
|
+
html = time_zone_select("firm", "time_zone", zones)
|
1276
|
+
assert_dom_equal "<div class=\"field_with_errors\">" \
|
1277
|
+
"<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" \
|
1278
|
+
"<option value=\"A\">A</option>\n" \
|
1279
|
+
"<option value=\"D\" selected=\"selected\">D</option>" \
|
1280
|
+
"<option value=\"\" disabled=\"disabled\">-------------</option>\n" \
|
1281
|
+
"<option value=\"B\">B</option>\n" \
|
1282
|
+
"<option value=\"C\">C</option>\n" \
|
1283
|
+
"<option value=\"E\">E</option>" \
|
1284
|
+
"</select>" \
|
1285
|
+
"</div>",
|
1286
|
+
html
|
1287
|
+
end
|
1288
|
+
|
1289
|
+
def test_time_zone_select_with_default_time_zone_and_nil_value
|
1290
|
+
@firm = Firm.new()
|
1291
|
+
@firm.time_zone = nil
|
1292
|
+
|
1293
|
+
html = time_zone_select("firm", "time_zone", nil, default: "B")
|
1294
|
+
assert_dom_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" \
|
1295
|
+
"<option value=\"A\">A</option>\n" \
|
1296
|
+
"<option value=\"B\" selected=\"selected\">B</option>\n" \
|
1297
|
+
"<option value=\"C\">C</option>\n" \
|
1298
|
+
"<option value=\"D\">D</option>\n" \
|
1299
|
+
"<option value=\"E\">E</option>" \
|
1300
|
+
"</select>",
|
1301
|
+
html
|
1302
|
+
end
|
1303
|
+
|
1304
|
+
def test_time_zone_select_with_default_time_zone_and_value
|
1305
|
+
@firm = Firm.new("D")
|
1306
|
+
|
1307
|
+
html = time_zone_select("firm", "time_zone", nil, default: "B")
|
1308
|
+
assert_dom_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" \
|
1309
|
+
"<option value=\"A\">A</option>\n" \
|
1310
|
+
"<option value=\"B\">B</option>\n" \
|
1311
|
+
"<option value=\"C\">C</option>\n" \
|
1312
|
+
"<option value=\"D\" selected=\"selected\">D</option>\n" \
|
1313
|
+
"<option value=\"E\">E</option>" \
|
1314
|
+
"</select>",
|
1315
|
+
html
|
1316
|
+
end
|
1317
|
+
|
1318
|
+
def test_options_for_select_with_element_attributes
|
1319
|
+
assert_dom_equal(
|
1320
|
+
"<option value=\"<Denmark>\" class=\"bold\"><Denmark></option>\n<option value=\"USA\" onclick=\"alert('Hello World');\">USA</option>\n<option value=\"Sweden\">Sweden</option>\n<option value=\"Germany\">Germany</option>",
|
1321
|
+
options_for_select([ [ "<Denmark>", { class: "bold" } ], [ "USA", { onclick: "alert('Hello World');" } ], [ "Sweden" ], "Germany" ])
|
1322
|
+
)
|
1323
|
+
end
|
1324
|
+
|
1325
|
+
def test_options_for_select_with_data_element
|
1326
|
+
assert_dom_equal(
|
1327
|
+
"<option value=\"<Denmark>\" data-test=\"bold\"><Denmark></option>",
|
1328
|
+
options_for_select([ [ "<Denmark>", { data: { test: "bold" } } ] ])
|
1329
|
+
)
|
1330
|
+
end
|
1331
|
+
|
1332
|
+
def test_options_for_select_with_data_element_with_special_characters
|
1333
|
+
assert_dom_equal(
|
1334
|
+
"<option value=\"<Denmark>\" data-test=\"<bold>\"><Denmark></option>",
|
1335
|
+
options_for_select([ [ "<Denmark>", { data: { test: "<bold>" } } ] ])
|
1336
|
+
)
|
1337
|
+
end
|
1338
|
+
|
1339
|
+
def test_options_for_select_with_element_attributes_and_selection
|
1340
|
+
assert_dom_equal(
|
1341
|
+
"<option value=\"<Denmark>\"><Denmark></option>\n<option value=\"USA\" class=\"bold\" selected=\"selected\">USA</option>\n<option value=\"Sweden\">Sweden</option>",
|
1342
|
+
options_for_select([ "<Denmark>", [ "USA", { class: "bold" } ], "Sweden" ], "USA")
|
1343
|
+
)
|
1344
|
+
end
|
1345
|
+
|
1346
|
+
def test_options_for_select_with_element_attributes_and_selection_array
|
1347
|
+
assert_dom_equal(
|
1348
|
+
"<option value=\"<Denmark>\"><Denmark></option>\n<option value=\"USA\" class=\"bold\" selected=\"selected\">USA</option>\n<option value=\"Sweden\" selected=\"selected\">Sweden</option>",
|
1349
|
+
options_for_select([ "<Denmark>", [ "USA", { class: "bold" } ], "Sweden" ], [ "USA", "Sweden" ])
|
1350
|
+
)
|
1351
|
+
end
|
1352
|
+
|
1353
|
+
def test_options_for_select_with_special_characters
|
1354
|
+
assert_dom_equal(
|
1355
|
+
"<option value=\"<Denmark>\" onclick=\"alert("<code>")\"><Denmark></option>",
|
1356
|
+
options_for_select([ [ "<Denmark>", { onclick: %(alert("<code>")) } ] ])
|
1357
|
+
)
|
1358
|
+
end
|
1359
|
+
|
1360
|
+
def test_option_html_attributes_with_no_array_element
|
1361
|
+
assert_equal({}, option_html_attributes("foo"))
|
1362
|
+
end
|
1363
|
+
|
1364
|
+
def test_option_html_attributes_without_hash
|
1365
|
+
assert_equal({}, option_html_attributes([ "foo", "bar" ]))
|
1366
|
+
end
|
1367
|
+
|
1368
|
+
def test_option_html_attributes_with_single_element_hash
|
1369
|
+
assert_equal(
|
1370
|
+
{ class: "fancy" },
|
1371
|
+
option_html_attributes([ "foo", "bar", { class: "fancy" } ])
|
1372
|
+
)
|
1373
|
+
end
|
1374
|
+
|
1375
|
+
def test_option_html_attributes_with_multiple_element_hash
|
1376
|
+
assert_equal(
|
1377
|
+
{ :class => "fancy", "onclick" => "alert('Hello World');" },
|
1378
|
+
option_html_attributes([ "foo", "bar", { :class => "fancy", "onclick" => "alert('Hello World');" } ])
|
1379
|
+
)
|
1380
|
+
end
|
1381
|
+
|
1382
|
+
def test_option_html_attributes_with_multiple_hashes
|
1383
|
+
assert_equal(
|
1384
|
+
{ :class => "fancy", "onclick" => "alert('Hello World');" },
|
1385
|
+
option_html_attributes([ "foo", "bar", { class: "fancy" }, { "onclick" => "alert('Hello World');" } ])
|
1386
|
+
)
|
1387
|
+
end
|
1388
|
+
|
1389
|
+
def test_option_html_attributes_with_multiple_hashes_does_not_modify_them
|
1390
|
+
options1 = { class: "fancy" }
|
1391
|
+
options2 = { onclick: "alert('Hello World');" }
|
1392
|
+
option_html_attributes([ "foo", "bar", options1, options2 ])
|
1393
|
+
|
1394
|
+
assert_equal({ class: "fancy" }, options1)
|
1395
|
+
assert_equal({ onclick: "alert('Hello World');" }, options2)
|
1396
|
+
end
|
1397
|
+
|
1398
|
+
def test_grouped_collection_select
|
1399
|
+
@post = Post.new
|
1400
|
+
@post.origin = "dk"
|
1401
|
+
|
1402
|
+
assert_dom_equal(
|
1403
|
+
%Q{<select id="post_origin" name="post[origin]"><optgroup label="<Africa>"><option value="<sa>"><South Africa></option>\n<option value="so">Somalia</option></optgroup><optgroup label="Europe"><option value="dk" selected="selected">Denmark</option>\n<option value="ie">Ireland</option></optgroup></select>},
|
1404
|
+
grouped_collection_select("post", "origin", dummy_continents, :countries, :continent_name, :country_id, :country_name)
|
1405
|
+
)
|
1406
|
+
end
|
1407
|
+
|
1408
|
+
def test_grouped_collection_select_with_selected
|
1409
|
+
@post = Post.new
|
1410
|
+
|
1411
|
+
assert_dom_equal(
|
1412
|
+
%Q{<select id="post_origin" name="post[origin]"><optgroup label="<Africa>"><option value="<sa>"><South Africa></option>\n<option value="so">Somalia</option></optgroup><optgroup label="Europe"><option value="dk" selected="selected">Denmark</option>\n<option value="ie">Ireland</option></optgroup></select>},
|
1413
|
+
grouped_collection_select("post", "origin", dummy_continents, :countries, :continent_name, :country_id, :country_name, selected: "dk")
|
1414
|
+
)
|
1415
|
+
end
|
1416
|
+
|
1417
|
+
def test_grouped_collection_select_with_disabled_value
|
1418
|
+
@post = Post.new
|
1419
|
+
|
1420
|
+
assert_dom_equal(
|
1421
|
+
%Q{<select id="post_origin" name="post[origin]"><optgroup label="<Africa>"><option value="<sa>"><South Africa></option>\n<option value="so">Somalia</option></optgroup><optgroup label="Europe"><option disabled="disabled" value="dk">Denmark</option>\n<option value="ie">Ireland</option></optgroup></select>},
|
1422
|
+
grouped_collection_select("post", "origin", dummy_continents, :countries, :continent_name, :country_id, :country_name, disabled: "dk")
|
1423
|
+
)
|
1424
|
+
end
|
1425
|
+
|
1426
|
+
def test_grouped_collection_select_under_fields_for
|
1427
|
+
@post = Post.new
|
1428
|
+
@post.origin = "dk"
|
1429
|
+
|
1430
|
+
output_buffer = fields_for :post, @post do |f|
|
1431
|
+
concat f.grouped_collection_select("origin", dummy_continents, :countries, :continent_name, :country_id, :country_name)
|
1432
|
+
end
|
1433
|
+
|
1434
|
+
assert_dom_equal(
|
1435
|
+
%Q{<select id="post_origin" name="post[origin]"><optgroup label="<Africa>"><option value="<sa>"><South Africa></option>\n<option value="so">Somalia</option></optgroup><optgroup label="Europe"><option value="dk" selected="selected">Denmark</option>\n<option value="ie">Ireland</option></optgroup></select>},
|
1436
|
+
output_buffer
|
1437
|
+
)
|
1438
|
+
end
|
1439
|
+
|
1440
|
+
private
|
1441
|
+
|
1442
|
+
def dummy_posts
|
1443
|
+
[ Post.new("<Abe> went home", "<Abe>", "To a little house", "shh!"),
|
1444
|
+
Post.new("Babe went home", "Babe", "To a little house", "shh!"),
|
1445
|
+
Post.new("Cabe went home", "Cabe", "To a little house", "shh!") ]
|
1446
|
+
end
|
1447
|
+
|
1448
|
+
def dummy_continents
|
1449
|
+
[ Continent.new("<Africa>", [Country.new("<sa>", "<South Africa>"), Country.new("so", "Somalia")]),
|
1450
|
+
Continent.new("Europe", [Country.new("dk", "Denmark"), Country.new("ie", "Ireland")]) ]
|
1451
|
+
end
|
1452
|
+
end
|