jets 1.9.7 → 1.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitmodules +0 -6
- data/CHANGELOG.md +5 -0
- data/Rakefile +3 -0
- data/jets.gemspec +3 -2
- data/lib/jets.rb +5 -66
- data/lib/jets/application.rb +29 -112
- data/lib/jets/application/default_config.rb +95 -0
- data/lib/jets/autoloaders.rb +96 -0
- data/lib/jets/aws_services.rb +0 -4
- data/lib/jets/booter.rb +24 -127
- data/lib/jets/builders/code_builder.rb +1 -1
- data/lib/jets/builders/code_size.rb +1 -1
- data/lib/jets/builders/gem_replacer.rb +1 -1
- data/lib/jets/builders/handler_generator.rb +1 -1
- data/lib/jets/builders/lambda_layer.rb +1 -1
- data/lib/jets/builders/md5.rb +1 -1
- data/lib/jets/builders/md5_zip.rb +1 -1
- data/lib/jets/builders/purger.rb +1 -1
- data/lib/jets/builders/rack_packager.rb +1 -1
- data/lib/jets/builders/reconfigure_rails.rb +1 -1
- data/lib/jets/builders/ruby_packager.rb +1 -1
- data/lib/jets/builders/tidy.rb +1 -1
- data/lib/jets/builders/util.rb +1 -1
- data/lib/jets/bundle.rb +59 -0
- data/lib/jets/cfn/builders/api_deployment_builder.rb +1 -1
- data/lib/jets/cfn/builders/api_gateway_builder.rb +1 -1
- data/lib/jets/cfn/builders/base_child_builder.rb +1 -1
- data/lib/jets/cfn/builders/controller_builder.rb +1 -1
- data/lib/jets/cfn/builders/function_builder.rb +1 -1
- data/lib/jets/cfn/builders/interface.rb +1 -1
- data/lib/jets/cfn/builders/job_builder.rb +1 -1
- data/lib/jets/cfn/builders/parent_builder.rb +1 -1
- data/lib/jets/cfn/builders/rule_builder.rb +1 -1
- data/lib/jets/cfn/builders/shared_builder.rb +1 -1
- data/lib/jets/cfn/ship.rb +2 -6
- data/lib/jets/cfn/status.rb +1 -1
- data/lib/jets/cfn/upload.rb +1 -1
- data/lib/jets/cli.rb +39 -34
- data/lib/jets/commands/base.rb +12 -30
- data/lib/jets/commands/call.rb +0 -5
- data/lib/jets/commands/clean.rb +0 -4
- data/lib/jets/commands/console.rb +0 -1
- data/lib/jets/commands/db.rb +0 -2
- data/lib/jets/commands/dynamodb.rb +0 -3
- data/lib/jets/commands/help/call.md +3 -3
- data/lib/jets/commands/import.rb +1 -7
- data/lib/jets/commands/import/{rail.rb → rails.rb} +1 -1
- data/lib/jets/commands/main.rb +3 -1
- data/lib/jets/commands/new.rb +1 -1
- data/lib/jets/commands/rake_tasks.rb +2 -1
- data/lib/jets/commands/runner.rb +0 -2
- data/lib/jets/controller.rb +0 -14
- data/lib/jets/controller/base.rb +1 -1
- data/lib/jets/controller/cookies.rb +0 -2
- data/lib/jets/controller/middleware/local.rb +0 -4
- data/lib/jets/controller/rendering.rb +0 -1
- data/lib/jets/controller/rendering/rack_renderer.rb +1 -2
- data/lib/jets/core.rb +2 -7
- data/lib/jets/core_ext/kernel.rb +9 -52
- data/lib/jets/internal/app/jobs/jets/preheat_job.rb +8 -0
- data/lib/jets/{mailer.rb → internal/turbines/jets/mailer.rb} +0 -0
- data/lib/jets/job/base.rb +1 -3
- data/lib/jets/job/dsl.rb +0 -9
- data/lib/jets/logger.rb +0 -3
- data/lib/jets/mega/request.rb +0 -1
- data/lib/jets/middleware.rb +0 -5
- data/lib/jets/poly_fun.rb +0 -9
- data/lib/jets/resource.rb +0 -18
- data/lib/jets/resource/api_gateway/rest_api.rb +0 -4
- data/lib/jets/resource/api_gateway/rest_api/routes.rb +0 -4
- data/lib/jets/resource/api_gateway/rest_api/routes/change.rb +0 -4
- data/lib/jets/resource/api_gateway/rest_api/routes/collision.rb +0 -2
- data/lib/jets/resource/iot/topic_rule.rb +1 -1
- data/lib/jets/resource/lambda/function.rb +0 -1
- data/lib/jets/router.rb +0 -2
- data/lib/jets/rule/base.rb +1 -1
- data/lib/jets/spec_helpers.rb +1 -4
- data/lib/jets/stack.rb +1 -24
- data/lib/jets/stack/depends.rb +0 -2
- data/lib/jets/stack/main.rb +0 -1
- data/lib/jets/stack/main/dsl.rb +0 -7
- data/lib/jets/stack/main/{extensions → dsl}/base.rb +0 -0
- data/lib/jets/stack/main/{extensions → dsl}/cloudwatch.rb +0 -0
- data/lib/jets/stack/main/{extensions → dsl}/iam.rb +0 -0
- data/lib/jets/stack/main/{extensions → dsl}/lambda.rb +0 -0
- data/lib/jets/stack/main/{extensions → dsl}/s3.rb +0 -0
- data/lib/jets/stack/main/{extensions → dsl}/sns.rb +0 -0
- data/lib/jets/stack/main/{extensions → dsl}/sqs.rb +0 -0
- data/lib/jets/stack/output.rb +0 -3
- data/lib/jets/stack/parameter.rb +0 -1
- data/lib/jets/stack/resource.rb +0 -1
- data/lib/jets/turbo.rb +11 -4
- data/lib/jets/turbo/{rail.rb → rails.rb} +1 -1
- data/lib/jets/version.rb +1 -1
- metadata +58 -1075
- data/lib/jets/builders.rb +0 -16
- data/lib/jets/builders/shim_vars.rb +0 -5
- data/lib/jets/cfn.rb +0 -6
- data/lib/jets/cfn/builders.rb +0 -20
- data/lib/jets/commands.rb +0 -27
- data/lib/jets/commands/markdown.rb +0 -8
- data/lib/jets/controller/middleware.rb +0 -5
- data/lib/jets/controller/rack.rb +0 -5
- data/lib/jets/io.rb +0 -14
- data/lib/jets/job.rb +0 -4
- data/lib/jets/job/helpers.rb +0 -5
- data/lib/jets/lambda.rb +0 -18
- data/lib/jets/mega.rb +0 -7
- data/lib/jets/processors.rb +0 -4
- data/lib/jets/resource/api_gateway.rb +0 -9
- data/lib/jets/resource/api_gateway/base_path.rb +0 -5
- data/lib/jets/resource/child_stack.rb +0 -7
- data/lib/jets/resource/config.rb +0 -4
- data/lib/jets/resource/events.rb +0 -3
- data/lib/jets/resource/iam.rb +0 -8
- data/lib/jets/resource/iot.rb +0 -3
- data/lib/jets/resource/lambda.rb +0 -6
- data/lib/jets/resource/logs.rb +0 -3
- data/lib/jets/resource/route53.rb +0 -3
- data/lib/jets/resource/s3.rb +0 -3
- data/lib/jets/resource/sns.rb +0 -5
- data/lib/jets/resource/sqs.rb +0 -3
- data/lib/jets/rule.rb +0 -4
- data/vendor/jets-gems/Gemfile +0 -6
- data/vendor/jets-gems/LICENSE.txt +0 -21
- data/vendor/jets-gems/README.md +0 -19
- data/vendor/jets-gems/Rakefile +0 -6
- data/vendor/jets-gems/bin/console +0 -14
- data/vendor/jets-gems/bin/setup +0 -8
- data/vendor/jets-gems/jets-gems.gemspec +0 -30
- data/vendor/jets-gems/lib/jets-gems.rb +0 -1
- data/vendor/jets-gems/lib/jets/gems.rb +0 -17
- data/vendor/jets-gems/lib/jets/gems/agree.rb +0 -60
- data/vendor/jets-gems/lib/jets/gems/check.rb +0 -190
- data/vendor/jets-gems/lib/jets/gems/exist.rb +0 -56
- data/vendor/jets-gems/lib/jets/gems/extract.rb +0 -7
- data/vendor/jets-gems/lib/jets/gems/extract/base.rb +0 -74
- data/vendor/jets-gems/lib/jets/gems/extract/gem.rb +0 -105
- data/vendor/jets-gems/lib/jets/gems/extract/ruby.rb +0 -71
- data/vendor/jets-gems/lib/jets/gems/report.rb +0 -69
- data/vendor/jets-gems/lib/jets/gems/version.rb +0 -5
- data/vendor/jets-gems/spec/jets/gems_spec.rb +0 -5
- data/vendor/jets-gems/spec/spec_helper.rb +0 -14
- data/vendor/rails/Brewfile +0 -13
- data/vendor/rails/CODE_OF_CONDUCT.md +0 -12
- data/vendor/rails/CONTRIBUTING.md +0 -49
- data/vendor/rails/Gemfile +0 -174
- data/vendor/rails/MIT-LICENSE +0 -20
- data/vendor/rails/RAILS_VERSION +0 -1
- data/vendor/rails/README.md +0 -97
- data/vendor/rails/RELEASING_RAILS.md +0 -225
- data/vendor/rails/Rakefile +0 -72
- data/vendor/rails/actionpack/CHANGELOG.md +0 -407
- data/vendor/rails/actionpack/MIT-LICENSE +0 -21
- data/vendor/rails/actionpack/README.rdoc +0 -57
- data/vendor/rails/actionpack/Rakefile +0 -40
- data/vendor/rails/actionpack/actionpack.gemspec +0 -38
- data/vendor/rails/actionpack/bin/test +0 -5
- data/vendor/rails/actionpack/lib/abstract_controller.rb +0 -27
- data/vendor/rails/actionpack/lib/abstract_controller/asset_paths.rb +0 -12
- data/vendor/rails/actionpack/lib/abstract_controller/base.rb +0 -265
- data/vendor/rails/actionpack/lib/abstract_controller/caching.rb +0 -66
- data/vendor/rails/actionpack/lib/abstract_controller/caching/fragments.rb +0 -166
- data/vendor/rails/actionpack/lib/abstract_controller/callbacks.rb +0 -212
- data/vendor/rails/actionpack/lib/abstract_controller/collector.rb +0 -43
- data/vendor/rails/actionpack/lib/abstract_controller/error.rb +0 -6
- data/vendor/rails/actionpack/lib/abstract_controller/helpers.rb +0 -194
- data/vendor/rails/actionpack/lib/abstract_controller/logger.rb +0 -14
- data/vendor/rails/actionpack/lib/abstract_controller/railties/routes_helpers.rb +0 -20
- data/vendor/rails/actionpack/lib/abstract_controller/rendering.rb +0 -127
- data/vendor/rails/actionpack/lib/abstract_controller/translation.rb +0 -31
- data/vendor/rails/actionpack/lib/abstract_controller/url_for.rb +0 -35
- data/vendor/rails/actionpack/lib/action_controller.rb +0 -66
- data/vendor/rails/actionpack/lib/action_controller/api.rb +0 -149
- data/vendor/rails/actionpack/lib/action_controller/api/api_rendering.rb +0 -16
- data/vendor/rails/actionpack/lib/action_controller/base.rb +0 -276
- data/vendor/rails/actionpack/lib/action_controller/caching.rb +0 -46
- data/vendor/rails/actionpack/lib/action_controller/form_builder.rb +0 -50
- data/vendor/rails/actionpack/lib/action_controller/log_subscriber.rb +0 -78
- data/vendor/rails/actionpack/lib/action_controller/metal.rb +0 -256
- data/vendor/rails/actionpack/lib/action_controller/metal/basic_implicit_render.rb +0 -13
- data/vendor/rails/actionpack/lib/action_controller/metal/conditional_get.rb +0 -274
- data/vendor/rails/actionpack/lib/action_controller/metal/content_security_policy.rb +0 -52
- data/vendor/rails/actionpack/lib/action_controller/metal/cookies.rb +0 -16
- data/vendor/rails/actionpack/lib/action_controller/metal/data_streaming.rb +0 -152
- data/vendor/rails/actionpack/lib/action_controller/metal/etag_with_flash.rb +0 -18
- data/vendor/rails/actionpack/lib/action_controller/metal/etag_with_template_digest.rb +0 -57
- data/vendor/rails/actionpack/lib/action_controller/metal/exceptions.rb +0 -53
- data/vendor/rails/actionpack/lib/action_controller/metal/flash.rb +0 -61
- data/vendor/rails/actionpack/lib/action_controller/metal/force_ssl.rb +0 -99
- data/vendor/rails/actionpack/lib/action_controller/metal/head.rb +0 -60
- data/vendor/rails/actionpack/lib/action_controller/metal/helpers.rb +0 -123
- data/vendor/rails/actionpack/lib/action_controller/metal/http_authentication.rb +0 -519
- data/vendor/rails/actionpack/lib/action_controller/metal/implicit_render.rb +0 -73
- data/vendor/rails/actionpack/lib/action_controller/metal/instrumentation.rb +0 -107
- data/vendor/rails/actionpack/lib/action_controller/metal/live.rb +0 -312
- data/vendor/rails/actionpack/lib/action_controller/metal/mime_responds.rb +0 -313
- data/vendor/rails/actionpack/lib/action_controller/metal/parameter_encoding.rb +0 -51
- data/vendor/rails/actionpack/lib/action_controller/metal/params_wrapper.rb +0 -293
- data/vendor/rails/actionpack/lib/action_controller/metal/redirecting.rb +0 -133
- data/vendor/rails/actionpack/lib/action_controller/metal/renderers.rb +0 -181
- data/vendor/rails/actionpack/lib/action_controller/metal/rendering.rb +0 -122
- data/vendor/rails/actionpack/lib/action_controller/metal/request_forgery_protection.rb +0 -445
- data/vendor/rails/actionpack/lib/action_controller/metal/rescue.rb +0 -28
- data/vendor/rails/actionpack/lib/action_controller/metal/streaming.rb +0 -223
- data/vendor/rails/actionpack/lib/action_controller/metal/strong_parameters.rb +0 -1086
- data/vendor/rails/actionpack/lib/action_controller/metal/testing.rb +0 -16
- data/vendor/rails/actionpack/lib/action_controller/metal/url_for.rb +0 -58
- data/vendor/rails/actionpack/lib/action_controller/railtie.rb +0 -89
- data/vendor/rails/actionpack/lib/action_controller/railties/helpers.rb +0 -24
- data/vendor/rails/actionpack/lib/action_controller/renderer.rb +0 -117
- data/vendor/rails/actionpack/lib/action_controller/template_assertions.rb +0 -11
- data/vendor/rails/actionpack/lib/action_controller/test_case.rb +0 -629
- data/vendor/rails/actionpack/lib/action_dispatch.rb +0 -112
- data/vendor/rails/actionpack/lib/action_dispatch/http/cache.rb +0 -220
- data/vendor/rails/actionpack/lib/action_dispatch/http/content_security_policy.rb +0 -272
- data/vendor/rails/actionpack/lib/action_dispatch/http/filter_parameters.rb +0 -84
- data/vendor/rails/actionpack/lib/action_dispatch/http/filter_redirect.rb +0 -37
- data/vendor/rails/actionpack/lib/action_dispatch/http/headers.rb +0 -132
- data/vendor/rails/actionpack/lib/action_dispatch/http/mime_negotiation.rb +0 -170
- data/vendor/rails/actionpack/lib/action_dispatch/http/mime_type.rb +0 -342
- data/vendor/rails/actionpack/lib/action_dispatch/http/mime_types.rb +0 -50
- data/vendor/rails/actionpack/lib/action_dispatch/http/parameter_filter.rb +0 -86
- data/vendor/rails/actionpack/lib/action_dispatch/http/parameters.rb +0 -126
- data/vendor/rails/actionpack/lib/action_dispatch/http/rack_cache.rb +0 -63
- data/vendor/rails/actionpack/lib/action_dispatch/http/request.rb +0 -430
- data/vendor/rails/actionpack/lib/action_dispatch/http/response.rb +0 -520
- data/vendor/rails/actionpack/lib/action_dispatch/http/upload.rb +0 -84
- data/vendor/rails/actionpack/lib/action_dispatch/http/url.rb +0 -350
- data/vendor/rails/actionpack/lib/action_dispatch/journey.rb +0 -7
- data/vendor/rails/actionpack/lib/action_dispatch/journey/formatter.rb +0 -189
- data/vendor/rails/actionpack/lib/action_dispatch/journey/gtg/builder.rb +0 -164
- data/vendor/rails/actionpack/lib/action_dispatch/journey/gtg/simulator.rb +0 -41
- data/vendor/rails/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb +0 -158
- data/vendor/rails/actionpack/lib/action_dispatch/journey/nfa/builder.rb +0 -78
- data/vendor/rails/actionpack/lib/action_dispatch/journey/nfa/dot.rb +0 -36
- data/vendor/rails/actionpack/lib/action_dispatch/journey/nfa/simulator.rb +0 -49
- data/vendor/rails/actionpack/lib/action_dispatch/journey/nfa/transition_table.rb +0 -120
- data/vendor/rails/actionpack/lib/action_dispatch/journey/nodes/node.rb +0 -140
- data/vendor/rails/actionpack/lib/action_dispatch/journey/parser.rb +0 -199
- data/vendor/rails/actionpack/lib/action_dispatch/journey/parser.y +0 -50
- data/vendor/rails/actionpack/lib/action_dispatch/journey/parser_extras.rb +0 -31
- data/vendor/rails/actionpack/lib/action_dispatch/journey/path/pattern.rb +0 -198
- data/vendor/rails/actionpack/lib/action_dispatch/journey/route.rb +0 -203
- data/vendor/rails/actionpack/lib/action_dispatch/journey/router.rb +0 -156
- data/vendor/rails/actionpack/lib/action_dispatch/journey/router/utils.rb +0 -102
- data/vendor/rails/actionpack/lib/action_dispatch/journey/routes.rb +0 -82
- data/vendor/rails/actionpack/lib/action_dispatch/journey/scanner.rb +0 -64
- data/vendor/rails/actionpack/lib/action_dispatch/journey/visitors.rb +0 -268
- data/vendor/rails/actionpack/lib/action_dispatch/journey/visualizer/fsm.css +0 -30
- data/vendor/rails/actionpack/lib/action_dispatch/journey/visualizer/fsm.js +0 -134
- data/vendor/rails/actionpack/lib/action_dispatch/journey/visualizer/index.html.erb +0 -52
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb +0 -36
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/cookies.rb +0 -685
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb +0 -205
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/debug_locks.rb +0 -124
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb +0 -147
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/executor.rb +0 -21
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/flash.rb +0 -300
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/public_exceptions.rb +0 -57
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/reloader.rb +0 -12
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb +0 -183
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/request_id.rb +0 -43
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb +0 -92
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/session/cache_store.rb +0 -54
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb +0 -117
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb +0 -28
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb +0 -62
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/ssl.rb +0 -150
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/stack.rb +0 -116
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/static.rb +0 -130
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +0 -22
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb +0 -23
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.html.erb +0 -27
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.text.erb +0 -8
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb +0 -52
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb +0 -9
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +0 -16
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb +0 -9
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb +0 -21
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb +0 -13
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/layout.erb +0 -161
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb +0 -11
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.text.erb +0 -3
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb +0 -32
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.text.erb +0 -11
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +0 -20
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.text.erb +0 -7
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.html.erb +0 -6
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.text.erb +0 -3
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/routes/_route.html.erb +0 -16
- data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/routes/_table.html.erb +0 -200
- data/vendor/rails/actionpack/lib/action_dispatch/railtie.rb +0 -55
- data/vendor/rails/actionpack/lib/action_dispatch/request/session.rb +0 -234
- data/vendor/rails/actionpack/lib/action_dispatch/request/utils.rb +0 -78
- data/vendor/rails/actionpack/lib/action_dispatch/routing.rb +0 -260
- data/vendor/rails/actionpack/lib/action_dispatch/routing/endpoint.rb +0 -17
- data/vendor/rails/actionpack/lib/action_dispatch/routing/inspector.rb +0 -225
- data/vendor/rails/actionpack/lib/action_dispatch/routing/mapper.rb +0 -2267
- data/vendor/rails/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +0 -352
- data/vendor/rails/actionpack/lib/action_dispatch/routing/redirection.rb +0 -201
- data/vendor/rails/actionpack/lib/action_dispatch/routing/route_set.rb +0 -890
- data/vendor/rails/actionpack/lib/action_dispatch/routing/routes_proxy.rb +0 -69
- data/vendor/rails/actionpack/lib/action_dispatch/routing/url_for.rb +0 -236
- data/vendor/rails/actionpack/lib/action_dispatch/system_test_case.rb +0 -147
- data/vendor/rails/actionpack/lib/action_dispatch/system_testing/browser.rb +0 -49
- data/vendor/rails/actionpack/lib/action_dispatch/system_testing/driver.rb +0 -59
- data/vendor/rails/actionpack/lib/action_dispatch/system_testing/server.rb +0 -31
- data/vendor/rails/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +0 -96
- data/vendor/rails/actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +0 -31
- data/vendor/rails/actionpack/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb +0 -26
- data/vendor/rails/actionpack/lib/action_dispatch/testing/assertion_response.rb +0 -47
- data/vendor/rails/actionpack/lib/action_dispatch/testing/assertions.rb +0 -24
- data/vendor/rails/actionpack/lib/action_dispatch/testing/assertions/response.rb +0 -107
- data/vendor/rails/actionpack/lib/action_dispatch/testing/assertions/routing.rb +0 -222
- data/vendor/rails/actionpack/lib/action_dispatch/testing/integration.rb +0 -652
- data/vendor/rails/actionpack/lib/action_dispatch/testing/request_encoder.rb +0 -55
- data/vendor/rails/actionpack/lib/action_dispatch/testing/test_process.rb +0 -50
- data/vendor/rails/actionpack/lib/action_dispatch/testing/test_request.rb +0 -71
- data/vendor/rails/actionpack/lib/action_dispatch/testing/test_response.rb +0 -53
- data/vendor/rails/actionpack/lib/action_pack.rb +0 -26
- data/vendor/rails/actionpack/lib/action_pack/gem_version.rb +0 -17
- data/vendor/rails/actionpack/lib/action_pack/version.rb +0 -10
- data/vendor/rails/actionpack/test/abstract/callbacks_test.rb +0 -270
- data/vendor/rails/actionpack/test/abstract/collector_test.rb +0 -65
- data/vendor/rails/actionpack/test/abstract/translation_test.rb +0 -79
- data/vendor/rails/actionpack/test/abstract_unit.rb +0 -457
- data/vendor/rails/actionpack/test/assertions/response_assertions_test.rb +0 -141
- data/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +0 -493
- data/vendor/rails/actionpack/test/controller/api/conditional_get_test.rb +0 -59
- data/vendor/rails/actionpack/test/controller/api/data_streaming_test.rb +0 -28
- data/vendor/rails/actionpack/test/controller/api/force_ssl_test.rb +0 -22
- data/vendor/rails/actionpack/test/controller/api/implicit_render_test.rb +0 -17
- data/vendor/rails/actionpack/test/controller/api/params_wrapper_test.rb +0 -28
- data/vendor/rails/actionpack/test/controller/api/redirect_to_test.rb +0 -21
- data/vendor/rails/actionpack/test/controller/api/renderers_test.rb +0 -50
- data/vendor/rails/actionpack/test/controller/api/url_for_test.rb +0 -22
- data/vendor/rails/actionpack/test/controller/api/with_cookies_test.rb +0 -23
- data/vendor/rails/actionpack/test/controller/api/with_helpers_test.rb +0 -44
- data/vendor/rails/actionpack/test/controller/base_test.rb +0 -323
- data/vendor/rails/actionpack/test/controller/caching_test.rb +0 -511
- data/vendor/rails/actionpack/test/controller/content_type_test.rb +0 -169
- 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 +0 -28
- data/vendor/rails/actionpack/test/controller/filters_test.rb +0 -1050
- data/vendor/rails/actionpack/test/controller/flash_hash_test.rb +0 -216
- data/vendor/rails/actionpack/test/controller/flash_test.rb +0 -373
- data/vendor/rails/actionpack/test/controller/force_ssl_test.rb +0 -333
- data/vendor/rails/actionpack/test/controller/form_builder_test.rb +0 -19
- data/vendor/rails/actionpack/test/controller/helper_test.rb +0 -295
- data/vendor/rails/actionpack/test/controller/http_basic_authentication_test.rb +0 -179
- data/vendor/rails/actionpack/test/controller/http_digest_authentication_test.rb +0 -282
- data/vendor/rails/actionpack/test/controller/http_token_authentication_test.rb +0 -216
- data/vendor/rails/actionpack/test/controller/integration_test.rb +0 -1136
- data/vendor/rails/actionpack/test/controller/live_stream_test.rb +0 -518
- data/vendor/rails/actionpack/test/controller/localized_templates_test.rb +0 -48
- data/vendor/rails/actionpack/test/controller/log_subscriber_test.rb +0 -371
- data/vendor/rails/actionpack/test/controller/metal/renderers_test.rb +0 -50
- data/vendor/rails/actionpack/test/controller/metal_test.rb +0 -32
- data/vendor/rails/actionpack/test/controller/mime/accept_format_test.rb +0 -94
- data/vendor/rails/actionpack/test/controller/mime/respond_to_test.rb +0 -843
- data/vendor/rails/actionpack/test/controller/new_base/bare_metal_test.rb +0 -184
- data/vendor/rails/actionpack/test/controller/new_base/base_test.rb +0 -131
- data/vendor/rails/actionpack/test/controller/new_base/content_negotiation_test.rb +0 -28
- data/vendor/rails/actionpack/test/controller/new_base/content_type_test.rb +0 -116
- data/vendor/rails/actionpack/test/controller/new_base/middleware_test.rb +0 -112
- data/vendor/rails/actionpack/test/controller/new_base/render_action_test.rb +0 -314
- data/vendor/rails/actionpack/test/controller/new_base/render_body_test.rb +0 -172
- data/vendor/rails/actionpack/test/controller/new_base/render_context_test.rb +0 -54
- data/vendor/rails/actionpack/test/controller/new_base/render_file_test.rb +0 -72
- data/vendor/rails/actionpack/test/controller/new_base/render_html_test.rb +0 -192
- data/vendor/rails/actionpack/test/controller/new_base/render_implicit_action_test.rb +0 -59
- data/vendor/rails/actionpack/test/controller/new_base/render_layout_test.rb +0 -128
- data/vendor/rails/actionpack/test/controller/new_base/render_partial_test.rb +0 -62
- data/vendor/rails/actionpack/test/controller/new_base/render_plain_test.rb +0 -170
- data/vendor/rails/actionpack/test/controller/new_base/render_streaming_test.rb +0 -116
- data/vendor/rails/actionpack/test/controller/new_base/render_template_test.rb +0 -240
- data/vendor/rails/actionpack/test/controller/new_base/render_test.rb +0 -142
- data/vendor/rails/actionpack/test/controller/new_base/render_xml_test.rb +0 -12
- data/vendor/rails/actionpack/test/controller/output_escaping_test.rb +0 -17
- data/vendor/rails/actionpack/test/controller/parameter_encoding_test.rb +0 -52
- data/vendor/rails/actionpack/test/controller/parameters/accessors_test.rb +0 -324
- data/vendor/rails/actionpack/test/controller/parameters/always_permitted_parameters_test.rb +0 -30
- data/vendor/rails/actionpack/test/controller/parameters/dup_test.rb +0 -67
- data/vendor/rails/actionpack/test/controller/parameters/log_on_unpermitted_params_test.rb +0 -70
- data/vendor/rails/actionpack/test/controller/parameters/multi_parameter_attributes_test.rb +0 -39
- data/vendor/rails/actionpack/test/controller/parameters/mutators_test.rb +0 -122
- data/vendor/rails/actionpack/test/controller/parameters/nested_parameters_permit_test.rb +0 -184
- data/vendor/rails/actionpack/test/controller/parameters/parameters_permit_test.rb +0 -516
- data/vendor/rails/actionpack/test/controller/parameters/raise_on_unpermitted_params_test.rb +0 -33
- data/vendor/rails/actionpack/test/controller/parameters/serialization_test.rb +0 -55
- data/vendor/rails/actionpack/test/controller/params_wrapper_test.rb +0 -422
- data/vendor/rails/actionpack/test/controller/permitted_params_test.rb +0 -27
- data/vendor/rails/actionpack/test/controller/redirect_test.rb +0 -395
- data/vendor/rails/actionpack/test/controller/render_js_test.rb +0 -36
- data/vendor/rails/actionpack/test/controller/render_json_test.rb +0 -137
- data/vendor/rails/actionpack/test/controller/render_test.rb +0 -843
- data/vendor/rails/actionpack/test/controller/render_xml_test.rb +0 -102
- data/vendor/rails/actionpack/test/controller/renderer_test.rb +0 -136
- data/vendor/rails/actionpack/test/controller/renderers_test.rb +0 -91
- data/vendor/rails/actionpack/test/controller/request/test_request_test.rb +0 -42
- data/vendor/rails/actionpack/test/controller/request_forgery_protection_test.rb +0 -1013
- data/vendor/rails/actionpack/test/controller/required_params_test.rb +0 -100
- data/vendor/rails/actionpack/test/controller/rescue_test.rb +0 -364
- data/vendor/rails/actionpack/test/controller/resources_test.rb +0 -1369
- data/vendor/rails/actionpack/test/controller/routing_test.rb +0 -2108
- data/vendor/rails/actionpack/test/controller/runner_test.rb +0 -24
- data/vendor/rails/actionpack/test/controller/send_file_test.rb +0 -259
- data/vendor/rails/actionpack/test/controller/show_exceptions_test.rb +0 -114
- data/vendor/rails/actionpack/test/controller/streaming_test.rb +0 -28
- data/vendor/rails/actionpack/test/controller/test_case_test.rb +0 -1157
- data/vendor/rails/actionpack/test/controller/url_for_integration_test.rb +0 -192
- data/vendor/rails/actionpack/test/controller/url_for_test.rb +0 -519
- data/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +0 -92
- data/vendor/rails/actionpack/test/controller/webservice_test.rb +0 -135
- data/vendor/rails/actionpack/test/dispatch/callbacks_test.rb +0 -47
- data/vendor/rails/actionpack/test/dispatch/content_security_policy_test.rb +0 -525
- data/vendor/rails/actionpack/test/dispatch/cookies_test.rb +0 -1345
- data/vendor/rails/actionpack/test/dispatch/debug_exceptions_test.rb +0 -502
- data/vendor/rails/actionpack/test/dispatch/debug_locks_test.rb +0 -38
- data/vendor/rails/actionpack/test/dispatch/exception_wrapper_test.rb +0 -120
- data/vendor/rails/actionpack/test/dispatch/executor_test.rb +0 -136
- data/vendor/rails/actionpack/test/dispatch/header_test.rb +0 -169
- data/vendor/rails/actionpack/test/dispatch/live_response_test.rb +0 -98
- data/vendor/rails/actionpack/test/dispatch/mapper_test.rb +0 -210
- data/vendor/rails/actionpack/test/dispatch/middleware_stack_test.rb +0 -115
- data/vendor/rails/actionpack/test/dispatch/mime_type_test.rb +0 -187
- data/vendor/rails/actionpack/test/dispatch/mount_test.rb +0 -95
- data/vendor/rails/actionpack/test/dispatch/prefix_generation_test.rb +0 -463
- data/vendor/rails/actionpack/test/dispatch/rack_cache_test.rb +0 -23
- data/vendor/rails/actionpack/test/dispatch/reloader_test.rb +0 -167
- data/vendor/rails/actionpack/test/dispatch/request/json_params_parsing_test.rb +0 -207
- data/vendor/rails/actionpack/test/dispatch/request/multipart_params_parsing_test.rb +0 -202
- data/vendor/rails/actionpack/test/dispatch/request/query_string_parsing_test.rb +0 -176
- data/vendor/rails/actionpack/test/dispatch/request/session_test.rb +0 -165
- data/vendor/rails/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb +0 -181
- data/vendor/rails/actionpack/test/dispatch/request_id_test.rb +0 -75
- data/vendor/rails/actionpack/test/dispatch/request_test.rb +0 -1307
- data/vendor/rails/actionpack/test/dispatch/response_test.rb +0 -542
- data/vendor/rails/actionpack/test/dispatch/routing/concerns_test.rb +0 -124
- data/vendor/rails/actionpack/test/dispatch/routing/custom_url_helpers_test.rb +0 -333
- data/vendor/rails/actionpack/test/dispatch/routing/inspector_test.rb +0 -425
- data/vendor/rails/actionpack/test/dispatch/routing/ipv6_redirect_test.rb +0 -46
- data/vendor/rails/actionpack/test/dispatch/routing/route_set_test.rb +0 -166
- data/vendor/rails/actionpack/test/dispatch/routing_assertions_test.rb +0 -209
- data/vendor/rails/actionpack/test/dispatch/routing_test.rb +0 -5112
- data/vendor/rails/actionpack/test/dispatch/runner_test.rb +0 -19
- data/vendor/rails/actionpack/test/dispatch/session/abstract_store_test.rb +0 -58
- data/vendor/rails/actionpack/test/dispatch/session/cache_store_test.rb +0 -183
- data/vendor/rails/actionpack/test/dispatch/session/cookie_store_test.rb +0 -417
- data/vendor/rails/actionpack/test/dispatch/session/mem_cache_store_test.rb +0 -205
- data/vendor/rails/actionpack/test/dispatch/session/test_session_test.rb +0 -65
- data/vendor/rails/actionpack/test/dispatch/show_exceptions_test.rb +0 -138
- data/vendor/rails/actionpack/test/dispatch/ssl_test.rb +0 -228
- data/vendor/rails/actionpack/test/dispatch/static_test.rb +0 -318
- data/vendor/rails/actionpack/test/dispatch/system_testing/driver_test.rb +0 -54
- data/vendor/rails/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb +0 -81
- data/vendor/rails/actionpack/test/dispatch/system_testing/server_test.rb +0 -32
- data/vendor/rails/actionpack/test/dispatch/system_testing/system_test_case_test.rb +0 -84
- data/vendor/rails/actionpack/test/dispatch/test_request_test.rb +0 -131
- data/vendor/rails/actionpack/test/dispatch/test_response_test.rb +0 -37
- data/vendor/rails/actionpack/test/dispatch/uploaded_file_test.rb +0 -113
- data/vendor/rails/actionpack/test/dispatch/url_generation_test.rb +0 -141
- data/vendor/rails/actionpack/test/fixtures/_top_level_partial_only.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/alternate_helpers/foo_helper.rb +0 -5
- data/vendor/rails/actionpack/test/fixtures/bad_customers/_bad_customer.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/collection_cache/index.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/company.rb +0 -11
- data/vendor/rails/actionpack/test/fixtures/customers/_commented_customer.html.erb +0 -5
- data/vendor/rails/actionpack/test/fixtures/customers/_customer.html.erb +0 -4
- data/vendor/rails/actionpack/test/fixtures/filter_test/implicit_actions/edit.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/filter_test/implicit_actions/show.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/functional_caching/_formatted_partial.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/functional_caching/_partial.erb +0 -3
- data/vendor/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached.html.erb +0 -3
- data/vendor/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached.xml.builder +0 -5
- data/vendor/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached_with_variant.html+phone.erb +0 -3
- data/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached.html.erb +0 -3
- data/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached_with_options.html.erb +0 -3
- data/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb +0 -3
- data/vendor/rails/actionpack/test/fixtures/functional_caching/html_fragment_cached_with_partial.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/functional_caching/inline_fragment_cached.html.erb +0 -2
- data/vendor/rails/actionpack/test/fixtures/functional_caching/xml_fragment_cached_with_html_partial.xml.builder +0 -5
- data/vendor/rails/actionpack/test/fixtures/helpers/abc_helper.rb +0 -5
- data/vendor/rails/actionpack/test/fixtures/helpers/fun/games_helper.rb +0 -7
- data/vendor/rails/actionpack/test/fixtures/helpers/fun/pdf_helper.rb +0 -7
- data/vendor/rails/actionpack/test/fixtures/helpers/just_me_helper.rb +0 -5
- data/vendor/rails/actionpack/test/fixtures/helpers/me_too_helper.rb +0 -5
- data/vendor/rails/actionpack/test/fixtures/helpers1_pack/pack1_helper.rb +0 -7
- data/vendor/rails/actionpack/test/fixtures/helpers2_pack/pack2_helper.rb +0 -7
- data/vendor/rails/actionpack/test/fixtures/helpers_typo/admin/users_helper.rb +0 -6
- data/vendor/rails/actionpack/test/fixtures/implicit_render_test/empty_action_with_mobile_variant.html+mobile.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/implicit_render_test/empty_action_with_template.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/layouts/_customers.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/layouts/block_with_layout.erb +0 -3
- data/vendor/rails/actionpack/test/fixtures/layouts/builder.builder +0 -3
- data/vendor/rails/actionpack/test/fixtures/layouts/partial_with_layout.erb +0 -3
- data/vendor/rails/actionpack/test/fixtures/layouts/standard.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/layouts/talk_from_action.erb +0 -2
- data/vendor/rails/actionpack/test/fixtures/layouts/with_html_partial.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/layouts/xhr.html.erb +0 -2
- data/vendor/rails/actionpack/test/fixtures/layouts/yield.erb +0 -2
- data/vendor/rails/actionpack/test/fixtures/load_me.rb +0 -4
- data/vendor/rails/actionpack/test/fixtures/localized/hello_world.de.html +0 -1
- data/vendor/rails/actionpack/test/fixtures/localized/hello_world.en.html +0 -1
- data/vendor/rails/actionpack/test/fixtures/localized/hello_world.it.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/multipart/binary_file +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/boundary_problem_file +0 -10
- data/vendor/rails/actionpack/test/fixtures/multipart/bracketed_param +0 -5
- data/vendor/rails/actionpack/test/fixtures/multipart/bracketed_utf8_param +0 -5
- data/vendor/rails/actionpack/test/fixtures/multipart/empty +0 -10
- data/vendor/rails/actionpack/test/fixtures/multipart/hello.txt +0 -1
- data/vendor/rails/actionpack/test/fixtures/multipart/large_text_file +0 -10
- data/vendor/rails/actionpack/test/fixtures/multipart/mixed_files +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/none +0 -9
- data/vendor/rails/actionpack/test/fixtures/multipart/ruby_on_rails.jpg +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/single_parameter +0 -5
- data/vendor/rails/actionpack/test/fixtures/multipart/single_utf8_param +0 -5
- data/vendor/rails/actionpack/test/fixtures/multipart/text_file +0 -10
- data/vendor/rails/actionpack/test/fixtures/multipart/utf8_filename +0 -10
- data/vendor/rails/actionpack/test/fixtures/namespaced/implicit_render_test/hello_world.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/old_content_type/render_default_content_types_for_respond_to.xml.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/old_content_type/render_default_for_builder.builder +0 -1
- data/vendor/rails/actionpack/test/fixtures/old_content_type/render_default_for_erb.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/post_test/layouts/post.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/post_test/layouts/super_post.iphone.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/post_test/post/index.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/post_test/post/index.iphone.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.iphone.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/public/400.html +0 -1
- data/vendor/rails/actionpack/test/fixtures/public/404.html +0 -1
- data/vendor/rails/actionpack/test/fixtures/public/500.da.html +0 -1
- data/vendor/rails/actionpack/test/fixtures/public/500.html +0 -1
- data/vendor/rails/actionpack/test/fixtures/public/bar.html +0 -1
- data/vendor/rails/actionpack/test/fixtures/public/bar/index.html +0 -1
- data/vendor/rails/actionpack/test/fixtures/public/foo/bar.html +0 -1
- data/vendor/rails/actionpack/test/fixtures/public/foo/baz.css +0 -3
- data/vendor/rails/actionpack/test/fixtures/public/foo/index.html +0 -1
- data/vendor/rails/actionpack/test/fixtures/public/foo/other-index.html +0 -1
- data/vendor/rails/actionpack/test/fixtures/public/foo//343/201/223/343/202/223/343/201/253/343/201/241/343/201/257.html +0 -1
- data/vendor/rails/actionpack/test/fixtures/public/foo//343/201/225/343/202/210/343/201/206/343/201/252/343/202/211.html +0 -1
- 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 +0 -4
- data/vendor/rails/actionpack/test/fixtures/public/gzip/application-a71b3024f80aea3181c09774ca17e712.js.gz +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/gzip/foo.zoo +0 -4
- data/vendor/rails/actionpack/test/fixtures/public/gzip/foo.zoo.gz +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/index.html +0 -1
- data/vendor/rails/actionpack/test/fixtures/public/other-index.html +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/all_types_with_layout.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/custom_constant_handling_without_block.mobile.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.iphone.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/missing.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.iphone.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.xml.builder +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_all.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/variant_any_implicit_render.html+phablet.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/variant_any_implicit_render.html+tablet.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/variant_inline_syntax_without_block.html+phone.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/variant_plus_none_for_format.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/variant_with_implicit_template_rendering.html+mobile.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/ruby_template.ruby +0 -2
- data/vendor/rails/actionpack/test/fixtures/session_autoload_test/session_autoload_test/foo.rb +0 -12
- data/vendor/rails/actionpack/test/fixtures/shared.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/star_star_mime/index.js.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/test/_partial.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/test/_partial.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/test/_partial.js.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.builder +0 -1
- data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.html.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.xml.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/test/hello/hello.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/test/hello_world.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/test/hello_world_with_partial.html.erb +0 -2
- data/vendor/rails/actionpack/test/fixtures/test/hello_xml_world.builder +0 -11
- data/vendor/rails/actionpack/test/fixtures/test/implicit_content_type.atom.builder +0 -2
- data/vendor/rails/actionpack/test/fixtures/test/render_file_with_ivar.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/test/render_file_with_locals.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures/test/with_implicit_template.erb +0 -1
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/bar.html +0 -1
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/bar/index.html +0 -1
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/bar.html +0 -1
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/baz.css +0 -3
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/index.html +0 -1
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/other-index.html +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -4
- 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 +0 -4
- 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 +0 -1
- data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/other-index.html +0 -1
- data/vendor/rails/actionpack/test/journey/gtg/builder_test.rb +0 -81
- data/vendor/rails/actionpack/test/journey/gtg/transition_table_test.rb +0 -125
- data/vendor/rails/actionpack/test/journey/nfa/simulator_test.rb +0 -100
- data/vendor/rails/actionpack/test/journey/nfa/transition_table_test.rb +0 -74
- data/vendor/rails/actionpack/test/journey/nodes/symbol_test.rb +0 -19
- data/vendor/rails/actionpack/test/journey/path/pattern_test.rb +0 -286
- data/vendor/rails/actionpack/test/journey/route/definition/parser_test.rb +0 -112
- data/vendor/rails/actionpack/test/journey/route/definition/scanner_test.rb +0 -71
- data/vendor/rails/actionpack/test/journey/route_test.rb +0 -113
- data/vendor/rails/actionpack/test/journey/router/utils_test.rb +0 -48
- data/vendor/rails/actionpack/test/journey/router_test.rb +0 -544
- data/vendor/rails/actionpack/test/journey/routes_test.rb +0 -62
- data/vendor/rails/actionpack/test/lib/controller/fake_controllers.rb +0 -37
- data/vendor/rails/actionpack/test/lib/controller/fake_models.rb +0 -79
- data/vendor/rails/actionpack/test/routing/helper_test.rb +0 -33
- data/vendor/rails/actionview/CHANGELOG.md +0 -122
- data/vendor/rails/actionview/MIT-LICENSE +0 -21
- data/vendor/rails/actionview/README.rdoc +0 -38
- data/vendor/rails/actionview/RUNNING_UJS_TESTS.rdoc +0 -8
- data/vendor/rails/actionview/RUNNING_UNIT_TESTS.rdoc +0 -26
- data/vendor/rails/actionview/Rakefile +0 -136
- data/vendor/rails/actionview/actionview.gemspec +0 -38
- data/vendor/rails/actionview/app/assets/javascripts/MIT-LICENSE +0 -20
- data/vendor/rails/actionview/app/assets/javascripts/README.md +0 -55
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs.coffee +0 -39
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/BANNER.js +0 -5
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/features/confirm.coffee +0 -26
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/features/disable.coffee +0 -82
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/features/method.coffee +0 -34
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/features/remote.coffee +0 -90
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/start.coffee +0 -71
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee +0 -97
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/csp.coffee +0 -4
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/csrf.coffee +0 -25
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/dom.coffee +0 -35
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/event.coffee +0 -68
- data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/form.coffee +0 -36
- data/vendor/rails/actionview/bin/test +0 -5
- data/vendor/rails/actionview/blade.yml +0 -11
- data/vendor/rails/actionview/coffeelint.json +0 -135
- data/vendor/rails/actionview/lib/action_view.rb +0 -97
- data/vendor/rails/actionview/lib/action_view/base.rb +0 -215
- data/vendor/rails/actionview/lib/action_view/buffers.rb +0 -52
- data/vendor/rails/actionview/lib/action_view/context.rb +0 -36
- data/vendor/rails/actionview/lib/action_view/dependency_tracker.rb +0 -175
- data/vendor/rails/actionview/lib/action_view/digestor.rb +0 -136
- data/vendor/rails/actionview/lib/action_view/flows.rb +0 -76
- data/vendor/rails/actionview/lib/action_view/gem_version.rb +0 -17
- data/vendor/rails/actionview/lib/action_view/helpers.rb +0 -68
- data/vendor/rails/actionview/lib/action_view/helpers/active_model_helper.rb +0 -55
- data/vendor/rails/actionview/lib/action_view/helpers/asset_tag_helper.rb +0 -511
- data/vendor/rails/actionview/lib/action_view/helpers/asset_url_helper.rb +0 -469
- data/vendor/rails/actionview/lib/action_view/helpers/atom_feed_helper.rb +0 -205
- data/vendor/rails/actionview/lib/action_view/helpers/cache_helper.rb +0 -263
- data/vendor/rails/actionview/lib/action_view/helpers/capture_helper.rb +0 -212
- data/vendor/rails/actionview/lib/action_view/helpers/controller_helper.rb +0 -36
- data/vendor/rails/actionview/lib/action_view/helpers/csp_helper.rb +0 -24
- data/vendor/rails/actionview/lib/action_view/helpers/csrf_helper.rb +0 -35
- data/vendor/rails/actionview/lib/action_view/helpers/date_helper.rb +0 -1156
- data/vendor/rails/actionview/lib/action_view/helpers/debug_helper.rb +0 -36
- data/vendor/rails/actionview/lib/action_view/helpers/form_helper.rb +0 -2337
- data/vendor/rails/actionview/lib/action_view/helpers/form_options_helper.rb +0 -887
- data/vendor/rails/actionview/lib/action_view/helpers/form_tag_helper.rb +0 -917
- data/vendor/rails/actionview/lib/action_view/helpers/javascript_helper.rb +0 -94
- data/vendor/rails/actionview/lib/action_view/helpers/number_helper.rb +0 -451
- data/vendor/rails/actionview/lib/action_view/helpers/output_safety_helper.rb +0 -70
- data/vendor/rails/actionview/lib/action_view/helpers/record_tag_helper.rb +0 -23
- data/vendor/rails/actionview/lib/action_view/helpers/rendering_helper.rb +0 -99
- data/vendor/rails/actionview/lib/action_view/helpers/sanitize_helper.rb +0 -177
- data/vendor/rails/actionview/lib/action_view/helpers/tag_helper.rb +0 -313
- data/vendor/rails/actionview/lib/action_view/helpers/tags.rb +0 -44
- data/vendor/rails/actionview/lib/action_view/helpers/tags/base.rb +0 -192
- data/vendor/rails/actionview/lib/action_view/helpers/tags/check_box.rb +0 -66
- data/vendor/rails/actionview/lib/action_view/helpers/tags/checkable.rb +0 -18
- data/vendor/rails/actionview/lib/action_view/helpers/tags/collection_check_boxes.rb +0 -36
- data/vendor/rails/actionview/lib/action_view/helpers/tags/collection_helpers.rb +0 -119
- data/vendor/rails/actionview/lib/action_view/helpers/tags/collection_radio_buttons.rb +0 -31
- data/vendor/rails/actionview/lib/action_view/helpers/tags/collection_select.rb +0 -30
- data/vendor/rails/actionview/lib/action_view/helpers/tags/color_field.rb +0 -27
- data/vendor/rails/actionview/lib/action_view/helpers/tags/date_field.rb +0 -15
- data/vendor/rails/actionview/lib/action_view/helpers/tags/date_select.rb +0 -74
- data/vendor/rails/actionview/lib/action_view/helpers/tags/datetime_field.rb +0 -32
- data/vendor/rails/actionview/lib/action_view/helpers/tags/datetime_local_field.rb +0 -21
- data/vendor/rails/actionview/lib/action_view/helpers/tags/datetime_select.rb +0 -10
- data/vendor/rails/actionview/lib/action_view/helpers/tags/email_field.rb +0 -10
- data/vendor/rails/actionview/lib/action_view/helpers/tags/file_field.rb +0 -10
- data/vendor/rails/actionview/lib/action_view/helpers/tags/grouped_collection_select.rb +0 -31
- data/vendor/rails/actionview/lib/action_view/helpers/tags/hidden_field.rb +0 -10
- data/vendor/rails/actionview/lib/action_view/helpers/tags/label.rb +0 -81
- data/vendor/rails/actionview/lib/action_view/helpers/tags/month_field.rb +0 -15
- data/vendor/rails/actionview/lib/action_view/helpers/tags/number_field.rb +0 -20
- data/vendor/rails/actionview/lib/action_view/helpers/tags/password_field.rb +0 -14
- data/vendor/rails/actionview/lib/action_view/helpers/tags/placeholderable.rb +0 -24
- data/vendor/rails/actionview/lib/action_view/helpers/tags/radio_button.rb +0 -33
- data/vendor/rails/actionview/lib/action_view/helpers/tags/range_field.rb +0 -10
- data/vendor/rails/actionview/lib/action_view/helpers/tags/search_field.rb +0 -27
- data/vendor/rails/actionview/lib/action_view/helpers/tags/select.rb +0 -43
- data/vendor/rails/actionview/lib/action_view/helpers/tags/tel_field.rb +0 -10
- data/vendor/rails/actionview/lib/action_view/helpers/tags/text_area.rb +0 -24
- data/vendor/rails/actionview/lib/action_view/helpers/tags/text_field.rb +0 -34
- data/vendor/rails/actionview/lib/action_view/helpers/tags/time_field.rb +0 -15
- data/vendor/rails/actionview/lib/action_view/helpers/tags/time_select.rb +0 -10
- data/vendor/rails/actionview/lib/action_view/helpers/tags/time_zone_select.rb +0 -22
- data/vendor/rails/actionview/lib/action_view/helpers/tags/translator.rb +0 -44
- data/vendor/rails/actionview/lib/action_view/helpers/tags/url_field.rb +0 -10
- data/vendor/rails/actionview/lib/action_view/helpers/tags/week_field.rb +0 -15
- data/vendor/rails/actionview/lib/action_view/helpers/text_helper.rb +0 -486
- data/vendor/rails/actionview/lib/action_view/helpers/translation_helper.rb +0 -141
- data/vendor/rails/actionview/lib/action_view/helpers/url_helper.rb +0 -676
- data/vendor/rails/actionview/lib/action_view/layouts.rb +0 -433
- data/vendor/rails/actionview/lib/action_view/locale/en.yml +0 -56
- data/vendor/rails/actionview/lib/action_view/log_subscriber.rb +0 -96
- data/vendor/rails/actionview/lib/action_view/lookup_context.rb +0 -274
- data/vendor/rails/actionview/lib/action_view/model_naming.rb +0 -14
- data/vendor/rails/actionview/lib/action_view/path_set.rb +0 -100
- data/vendor/rails/actionview/lib/action_view/railtie.rb +0 -82
- data/vendor/rails/actionview/lib/action_view/record_identifier.rb +0 -112
- data/vendor/rails/actionview/lib/action_view/renderer/abstract_renderer.rb +0 -55
- data/vendor/rails/actionview/lib/action_view/renderer/partial_renderer.rb +0 -552
- data/vendor/rails/actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb +0 -57
- data/vendor/rails/actionview/lib/action_view/renderer/renderer.rb +0 -56
- data/vendor/rails/actionview/lib/action_view/renderer/streaming_template_renderer.rb +0 -105
- data/vendor/rails/actionview/lib/action_view/renderer/template_renderer.rb +0 -102
- data/vendor/rails/actionview/lib/action_view/rendering.rb +0 -151
- data/vendor/rails/actionview/lib/action_view/routing_url_for.rb +0 -145
- data/vendor/rails/actionview/lib/action_view/tasks/cache_digests.rake +0 -25
- data/vendor/rails/actionview/lib/action_view/template.rb +0 -361
- data/vendor/rails/actionview/lib/action_view/template/error.rb +0 -141
- data/vendor/rails/actionview/lib/action_view/template/handlers.rb +0 -66
- data/vendor/rails/actionview/lib/action_view/template/handlers/builder.rb +0 -25
- data/vendor/rails/actionview/lib/action_view/template/handlers/erb.rb +0 -74
- data/vendor/rails/actionview/lib/action_view/template/handlers/erb/erubi.rb +0 -83
- data/vendor/rails/actionview/lib/action_view/template/handlers/html.rb +0 -11
- data/vendor/rails/actionview/lib/action_view/template/handlers/raw.rb +0 -11
- data/vendor/rails/actionview/lib/action_view/template/html.rb +0 -34
- data/vendor/rails/actionview/lib/action_view/template/resolver.rb +0 -391
- data/vendor/rails/actionview/lib/action_view/template/text.rb +0 -33
- data/vendor/rails/actionview/lib/action_view/template/types.rb +0 -57
- data/vendor/rails/actionview/lib/action_view/test_case.rb +0 -300
- data/vendor/rails/actionview/lib/action_view/testing/resolvers.rb +0 -54
- data/vendor/rails/actionview/lib/action_view/version.rb +0 -10
- data/vendor/rails/actionview/lib/action_view/view_paths.rb +0 -105
- data/vendor/rails/actionview/package.json +0 -36
- data/vendor/rails/actionview/test/abstract_unit.rb +0 -236
- data/vendor/rails/actionview/test/actionpack/abstract/abstract_controller_test.rb +0 -292
- data/vendor/rails/actionview/test/actionpack/abstract/helper_test.rb +0 -128
- data/vendor/rails/actionview/test/actionpack/abstract/layouts_test.rb +0 -568
- data/vendor/rails/actionview/test/actionpack/abstract/render_test.rb +0 -103
- data/vendor/rails/actionview/test/actionpack/abstract/views/abstract_controller/testing/me3/formatted.html.erb +0 -1
- data/vendor/rails/actionview/test/actionpack/abstract/views/abstract_controller/testing/me3/index.erb +0 -1
- data/vendor/rails/actionview/test/actionpack/abstract/views/abstract_controller/testing/me4/index.erb +0 -1
- data/vendor/rails/actionview/test/actionpack/abstract/views/action_with_ivars.erb +0 -1
- data/vendor/rails/actionview/test/actionpack/abstract/views/helper_test.erb +0 -1
- data/vendor/rails/actionview/test/actionpack/abstract/views/index.erb +0 -1
- data/vendor/rails/actionview/test/actionpack/abstract/views/layouts/abstract_controller/testing/me4.erb +0 -1
- data/vendor/rails/actionview/test/actionpack/abstract/views/layouts/application.erb +0 -1
- data/vendor/rails/actionview/test/actionpack/abstract/views/naked_render.erb +0 -1
- data/vendor/rails/actionview/test/actionpack/controller/capture_test.rb +0 -83
- data/vendor/rails/actionview/test/actionpack/controller/layout_test.rb +0 -270
- data/vendor/rails/actionview/test/actionpack/controller/render_test.rb +0 -1294
- data/vendor/rails/actionview/test/actionpack/controller/view_paths_test.rb +0 -174
- data/vendor/rails/actionview/test/active_record_unit.rb +0 -92
- data/vendor/rails/actionview/test/activerecord/controller_runtime_test.rb +0 -95
- data/vendor/rails/actionview/test/activerecord/debug_helper_test.rb +0 -19
- data/vendor/rails/actionview/test/activerecord/form_helper_activerecord_test.rb +0 -90
- data/vendor/rails/actionview/test/activerecord/polymorphic_routes_test.rb +0 -780
- data/vendor/rails/actionview/test/activerecord/relation_cache_test.rb +0 -23
- data/vendor/rails/actionview/test/activerecord/render_partial_with_record_identification_test.rb +0 -188
- data/vendor/rails/actionview/test/fixtures/_top_level_partial.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/_top_level_partial_only.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/bad_customers/_bad_customer.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/customers/_customer.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/fun/games/_form.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/fun/games/hello_world.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/good_customers/_good_customer.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/hello.html +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/alt/layouts/alt.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/controller_name_space/nested.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/item.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/layout_test.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/multiple_extensions.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/symlinked/symlinked_layout.erb +0 -5
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/third_party_template_library.mab +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/views/goodbye.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/views/hello.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_column.html.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_customers.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_partial_and_yield.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_yield_only.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_yield_with_params.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/block_with_layout.erb +0 -3
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/builder.builder +0 -3
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/partial_with_layout.erb +0 -3
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/standard.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/standard.text.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/streaming.erb +0 -4
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/talk_from_action.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/with_html_partial.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/xhr.html.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/yield.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/yield_with_render_inline_inside.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/actionpack/layouts/yield_with_render_partial_inside.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/actionpack/quiz/questions/_question.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/shared.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_changing_priority.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_changing_priority.json.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_counter.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_counter.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_counter_with_as.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_greeting.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_iteration.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_iteration_with_as.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_with_var.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_directory/_partial_with_locales.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_first_json_partial.json.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_form.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_hash_greeting.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_hash_object.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_hello.builder +0 -1
- 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 +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_layout_for_partial.html.erb +0 -3
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial.js.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_for_use_in_layout.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_html_erb.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_name_local_variable.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_only.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_only_html.html +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_with_partial.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_person.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_raise_indentation.html.erb +0 -13
- data/vendor/rails/actionview/test/fixtures/actionpack/test/_second_json_partial.json.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/action_talk_to_layout.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/actionpack/test/calling_partial_with_layout.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/capturing.erb +0 -4
- data/vendor/rails/actionview/test/fixtures/actionpack/test/change_priority.html.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/actionpack/test/content_for.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/content_for_concatenated.erb +0 -3
- data/vendor/rails/actionview/test/fixtures/actionpack/test/content_for_with_parameter.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/actionpack/test/dot.directory/render_file_with_ivar.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/formatted_html_erb.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/formatted_xml_erb.builder +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/formatted_xml_erb.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/formatted_xml_erb.xml.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/greeting.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/greeting.xml.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello,world.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello.builder +0 -4
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello/hello.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world_container.builder +0 -3
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world_from_rxml.builder +0 -3
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world_with_layout_false.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world_with_partial.html.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_xml_world.builder +0 -11
- data/vendor/rails/actionview/test/fixtures/actionpack/test/html_template.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/hyphen-ated.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/implicit_content_type.atom.builder +0 -2
- data/vendor/rails/actionview/test/fixtures/actionpack/test/list.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/non_erb_block_content_for.builder +0 -4
- data/vendor/rails/actionview/test/fixtures/actionpack/test/potential_conflicts.erb +0 -4
- data/vendor/rails/actionview/test/fixtures/actionpack/test/proper_block_detection.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_file_from_template.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_file_with_ivar.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_file_with_locals.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_file_with_locals_and_default.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_implicit_html_template_from_xhr_request.da.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_implicit_html_template_from_xhr_request.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_implicit_js_template_without_layout.js.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_partial_inside_directory.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_to_string_test.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/render_two_partials.html.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/actionpack/test/using_layout_around_block.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/with_html_partial.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/with_partial.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/with_partial.text.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/actionpack/test/with_xml_template.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/comments/empty.de.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/comments/empty.html+grid.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/comments/empty.html.builder +0 -1
- data/vendor/rails/actionview/test/fixtures/comments/empty.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/comments/empty.xml.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/companies.yml +0 -24
- data/vendor/rails/actionview/test/fixtures/company.rb +0 -11
- data/vendor/rails/actionview/test/fixtures/custom_pattern/another.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/custom_pattern/html/another.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/custom_pattern/html/path.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/customers/_customer.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/customers/_customer.xml.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/db_definitions/sqlite.sql +0 -49
- data/vendor/rails/actionview/test/fixtures/developer.rb +0 -8
- data/vendor/rails/actionview/test/fixtures/developers.yml +0 -21
- data/vendor/rails/actionview/test/fixtures/developers/_developer.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/developers_projects.yml +0 -13
- data/vendor/rails/actionview/test/fixtures/digestor/api/comments/_comment.json.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/digestor/api/comments/_comments.json.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/digestor/comments/_comment.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/digestor/comments/_comments.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/digestor/comments/show.js.erb +0 -1
- 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 +0 -1
- data/vendor/rails/actionview/test/fixtures/digestor/level/_recursion.html.erb +0 -1
- 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 +0 -1
- data/vendor/rails/actionview/test/fixtures/digestor/level/recursion.html.erb +0 -1
- 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 +0 -1
- 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 +0 -5
- data/vendor/rails/actionview/test/fixtures/digestor/messages/index.html.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/digestor/messages/new.html+iphone.erb +0 -15
- data/vendor/rails/actionview/test/fixtures/digestor/messages/peek.html.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/digestor/messages/show.html.erb +0 -14
- data/vendor/rails/actionview/test/fixtures/digestor/messages/thread.json.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/fun/games/_game.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/fun/games/hello_world.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/fun/serious/games/_game.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/games/_game.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/good_customers/_good_customer.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/helpers/abc_helper.rb +0 -5
- data/vendor/rails/actionview/test/fixtures/helpers/helpery_test_helper.rb +0 -7
- data/vendor/rails/actionview/test/fixtures/helpers_missing/invalid_require_helper.rb +0 -6
- data/vendor/rails/actionview/test/fixtures/layout_tests/alt/hello.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/layouts/_column.html.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/layouts/_customers.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/layouts/_partial_and_yield.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/layouts/_yield_only.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/layouts/_yield_with_params.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/layouts/render_partial_html.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/layouts/streaming.erb +0 -4
- data/vendor/rails/actionview/test/fixtures/layouts/streaming_with_capture.erb +0 -6
- data/vendor/rails/actionview/test/fixtures/layouts/streaming_with_locale.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/layouts/yield.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/layouts/yield_with_render_inline_inside.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/layouts/yield_with_render_partial_inside.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/mascot.rb +0 -5
- data/vendor/rails/actionview/test/fixtures/mascots.yml +0 -4
- data/vendor/rails/actionview/test/fixtures/mascots/_mascot.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/override/test/hello_world.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/override2/layouts/test/sub.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/plain_text.raw +0 -1
- data/vendor/rails/actionview/test/fixtures/plain_text_with_characters.raw +0 -1
- data/vendor/rails/actionview/test/fixtures/project.rb +0 -9
- data/vendor/rails/actionview/test/fixtures/projects.yml +0 -7
- data/vendor/rails/actionview/test/fixtures/projects/_project.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/public/elsewhere/cools.js +0 -1
- data/vendor/rails/actionview/test/fixtures/public/elsewhere/file.css +0 -1
- data/vendor/rails/actionview/test/fixtures/public/foo/baz.css +0 -3
- data/vendor/rails/actionview/test/fixtures/public/javascripts/application.js +0 -1
- data/vendor/rails/actionview/test/fixtures/public/javascripts/bank.js +0 -1
- data/vendor/rails/actionview/test/fixtures/public/javascripts/common.javascript +0 -1
- data/vendor/rails/actionview/test/fixtures/public/javascripts/controls.js +0 -1
- data/vendor/rails/actionview/test/fixtures/public/javascripts/dragdrop.js +0 -1
- data/vendor/rails/actionview/test/fixtures/public/javascripts/effects.js +0 -1
- data/vendor/rails/actionview/test/fixtures/public/javascripts/prototype.js +0 -1
- data/vendor/rails/actionview/test/fixtures/public/javascripts/robber.js +0 -1
- data/vendor/rails/actionview/test/fixtures/public/javascripts/subdir/subdir.js +0 -1
- data/vendor/rails/actionview/test/fixtures/public/javascripts/version.1.0.js +0 -1
- data/vendor/rails/actionview/test/fixtures/public/stylesheets/bank.css +0 -1
- data/vendor/rails/actionview/test/fixtures/public/stylesheets/random.styles +0 -1
- data/vendor/rails/actionview/test/fixtures/public/stylesheets/robber.css +0 -1
- data/vendor/rails/actionview/test/fixtures/public/stylesheets/subdir/subdir.css +0 -1
- data/vendor/rails/actionview/test/fixtures/public/stylesheets/version.1.0.css +0 -1
- data/vendor/rails/actionview/test/fixtures/replies.yml +0 -15
- data/vendor/rails/actionview/test/fixtures/replies/_reply.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/reply.rb +0 -9
- data/vendor/rails/actionview/test/fixtures/respond_to/using_defaults_with_all.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/ruby_template.ruby +0 -2
- data/vendor/rails/actionview/test/fixtures/shared.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_200.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_FooBar.html.erb +0 -1
- 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 +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_b_layout_for_partial_with_object.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_builder_tag_nested_in_content_tag.erb +0 -3
- data/vendor/rails/actionview/test/fixtures/test/_cached_customer.erb +0 -3
- data/vendor/rails/actionview/test/fixtures/test/_cached_customer_as.erb +0 -3
- data/vendor/rails/actionview/test/fixtures/test/_cached_nested_cached_customer.erb +0 -3
- data/vendor/rails/actionview/test/fixtures/test/_changing_priority.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_changing_priority.json.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_content_tag_nested_in_content_tag.erb +0 -3
- data/vendor/rails/actionview/test/fixtures/test/_counter.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_customer.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_customer.mobile.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_customer_greeting.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_customer_with_var.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_directory/_partial_with_locales.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_first_json_partial.json.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_from_helper.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_json_change_priority.json.erb +0 -0
- data/vendor/rails/actionview/test/fixtures/test/_klass.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_label_with_block.erb +0 -4
- data/vendor/rails/actionview/test/fixtures/test/_layout_for_block_with_args.html.erb +0 -3
- data/vendor/rails/actionview/test/fixtures/test/_layout_for_partial.html.erb +0 -3
- data/vendor/rails/actionview/test/fixtures/test/_layout_with_partial_and_yield.html.erb +0 -4
- data/vendor/rails/actionview/test/fixtures/test/_local_inspector.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_nested_cached_customer.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_object_inspector.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_one.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_partial.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_partial.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_partial.js.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_partial_for_use_in_layout.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_partial_iteration_1.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_partial_iteration_2.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_partial_name_in_local_assigns.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_partial_name_local_variable.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_partial_only.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_partial_shortcut_with_block_content.html.erb +0 -3
- data/vendor/rails/actionview/test/fixtures/test/_partial_with_layout.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/test/_partial_with_layout_block_content.erb +0 -4
- data/vendor/rails/actionview/test/fixtures/test/_partial_with_layout_block_partial.erb +0 -4
- data/vendor/rails/actionview/test/fixtures/test/_partial_with_only_html_version.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_partial_with_partial.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/test/_partial_with_variants.html+grid.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_partialhtml.html +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_raise.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_raise_indentation.html.erb +0 -13
- data/vendor/rails/actionview/test/fixtures/test/_second_json_partial.json.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_two.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_utf8_partial.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/_utf8_partial_magic.html.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/test/_/360/237/215/243.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/basic.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/calling_partial_with_layout.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/change_priority.html.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/test/dont_pick_me +0 -1
- data/vendor/rails/actionview/test/fixtures/test/dot.directory/render_file_with_ivar.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/greeting.xml.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/hello.builder +0 -4
- data/vendor/rails/actionview/test/fixtures/test/hello/hello.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/hello_world.da.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/hello_world.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/hello_world.erb~ +0 -1
- data/vendor/rails/actionview/test/fixtures/test/hello_world.html+phone.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/hello_world.pt-BR.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/hello_world.text+phone.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/hello_world_with_partial.html.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/test/html_template.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/layout_render_file.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/test/layout_render_object.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/list.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/malformed/malformed.en.html.erb~ +0 -1
- data/vendor/rails/actionview/test/fixtures/test/malformed/malformed.erb~ +0 -1
- data/vendor/rails/actionview/test/fixtures/test/malformed/malformed.html.erb~ +0 -1
- data/vendor/rails/actionview/test/fixtures/test/malformed/malformed~ +0 -1
- data/vendor/rails/actionview/test/fixtures/test/nested_layout.erb +0 -3
- data/vendor/rails/actionview/test/fixtures/test/nested_streaming.erb +0 -3
- data/vendor/rails/actionview/test/fixtures/test/nil_return.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/one.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/render_file_inspect_local_assigns.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/render_file_instance_variable.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/render_file_unicode_local.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/render_file_with_ivar.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/render_file_with_locals.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/render_file_with_locals_and_default.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/render_file_with_ruby_keyword_locals.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/render_partial_inside_directory.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/render_two_partials.html.erb +0 -2
- data/vendor/rails/actionview/test/fixtures/test/streaming.erb +0 -3
- data/vendor/rails/actionview/test/fixtures/test/streaming_buster.erb +0 -3
- data/vendor/rails/actionview/test/fixtures/test/streaming_with_locale.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/sub_template_raise.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/template.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/test_template_with_delegation_reserved_keywords.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/test/update_element_with_capture.erb +0 -9
- data/vendor/rails/actionview/test/fixtures/test/utf8.html.erb +0 -4
- data/vendor/rails/actionview/test/fixtures/test/utf8_magic.html.erb +0 -5
- data/vendor/rails/actionview/test/fixtures/test/utf8_magic_with_bare_partial.html.erb +0 -5
- data/vendor/rails/actionview/test/fixtures/topic.rb +0 -5
- data/vendor/rails/actionview/test/fixtures/topics.yml +0 -22
- data/vendor/rails/actionview/test/fixtures/topics/_topic.html.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/translations/templates/array.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/translations/templates/default.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/translations/templates/found.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/translations/templates/missing.erb +0 -1
- data/vendor/rails/actionview/test/fixtures/with_format.json.erb +0 -1
- data/vendor/rails/actionview/test/lib/controller/fake_models.rb +0 -204
- data/vendor/rails/actionview/test/template/active_model_helper_test.rb +0 -172
- data/vendor/rails/actionview/test/template/asset_tag_helper_test.rb +0 -913
- data/vendor/rails/actionview/test/template/atom_feed_helper_test.rb +0 -375
- data/vendor/rails/actionview/test/template/capture_helper_test.rb +0 -228
- data/vendor/rails/actionview/test/template/compiled_templates_test.rb +0 -94
- data/vendor/rails/actionview/test/template/controller_helper_test.rb +0 -34
- data/vendor/rails/actionview/test/template/date_helper_i18n_test.rb +0 -166
- data/vendor/rails/actionview/test/template/date_helper_test.rb +0 -3642
- data/vendor/rails/actionview/test/template/dependency_tracker_test.rb +0 -195
- data/vendor/rails/actionview/test/template/digestor_test.rb +0 -389
- data/vendor/rails/actionview/test/template/erb/form_for_test.rb +0 -13
- data/vendor/rails/actionview/test/template/erb/helper.rb +0 -26
- data/vendor/rails/actionview/test/template/erb/tag_helper_test.rb +0 -32
- data/vendor/rails/actionview/test/template/erb_util_test.rb +0 -114
- data/vendor/rails/actionview/test/template/form_collections_helper_test.rb +0 -527
- data/vendor/rails/actionview/test/template/form_helper/form_with_test.rb +0 -2293
- data/vendor/rails/actionview/test/template/form_helper_test.rb +0 -3554
- data/vendor/rails/actionview/test/template/form_options_helper_i18n_test.rb +0 -30
- data/vendor/rails/actionview/test/template/form_options_helper_test.rb +0 -1452
- data/vendor/rails/actionview/test/template/form_tag_helper_test.rb +0 -785
- data/vendor/rails/actionview/test/template/html_test.rb +0 -19
- data/vendor/rails/actionview/test/template/javascript_helper_test.rb +0 -68
- data/vendor/rails/actionview/test/template/log_subscriber_test.rb +0 -224
- data/vendor/rails/actionview/test/template/lookup_context_test.rb +0 -289
- data/vendor/rails/actionview/test/template/number_helper_test.rb +0 -204
- data/vendor/rails/actionview/test/template/output_safety_helper_test.rb +0 -119
- data/vendor/rails/actionview/test/template/partial_iteration_test.rb +0 -35
- data/vendor/rails/actionview/test/template/record_identifier_test.rb +0 -93
- data/vendor/rails/actionview/test/template/record_tag_helper_test.rb +0 -33
- data/vendor/rails/actionview/test/template/render_test.rb +0 -725
- data/vendor/rails/actionview/test/template/resolver_cache_test.rb +0 -9
- data/vendor/rails/actionview/test/template/resolver_patterns_test.rb +0 -44
- data/vendor/rails/actionview/test/template/sanitize_helper_test.rb +0 -43
- data/vendor/rails/actionview/test/template/streaming_render_test.rb +0 -132
- data/vendor/rails/actionview/test/template/tag_helper_test.rb +0 -357
- data/vendor/rails/actionview/test/template/template_error_test.rb +0 -37
- data/vendor/rails/actionview/test/template/template_test.rb +0 -207
- data/vendor/rails/actionview/test/template/test_case_test.rb +0 -335
- data/vendor/rails/actionview/test/template/test_test.rb +0 -94
- data/vendor/rails/actionview/test/template/testing/fixture_resolver_test.rb +0 -20
- data/vendor/rails/actionview/test/template/testing/null_resolver_test.rb +0 -14
- data/vendor/rails/actionview/test/template/text_helper_test.rb +0 -535
- data/vendor/rails/actionview/test/template/text_test.rb +0 -25
- data/vendor/rails/actionview/test/template/translation_helper_test.rb +0 -238
- data/vendor/rails/actionview/test/template/url_helper_test.rb +0 -976
- data/vendor/rails/actionview/test/ujs/config.ru +0 -6
- data/vendor/rails/actionview/test/ujs/public/test/call-ajax.js +0 -26
- data/vendor/rails/actionview/test/ujs/public/test/call-remote-callbacks.js +0 -239
- data/vendor/rails/actionview/test/ujs/public/test/call-remote.js +0 -275
- data/vendor/rails/actionview/test/ujs/public/test/csrf-refresh.js +0 -24
- data/vendor/rails/actionview/test/ujs/public/test/csrf-token.js +0 -27
- data/vendor/rails/actionview/test/ujs/public/test/data-confirm.js +0 -316
- data/vendor/rails/actionview/test/ujs/public/test/data-disable-with.js +0 -394
- data/vendor/rails/actionview/test/ujs/public/test/data-disable.js +0 -322
- data/vendor/rails/actionview/test/ujs/public/test/data-method.js +0 -85
- data/vendor/rails/actionview/test/ujs/public/test/data-remote.js +0 -441
- data/vendor/rails/actionview/test/ujs/public/test/override.js +0 -56
- data/vendor/rails/actionview/test/ujs/public/test/settings.js +0 -118
- data/vendor/rails/actionview/test/ujs/public/vendor/jquery-2.2.0.js +0 -9831
- data/vendor/rails/actionview/test/ujs/public/vendor/jquery.metadata.js +0 -122
- data/vendor/rails/actionview/test/ujs/public/vendor/qunit.css +0 -237
- data/vendor/rails/actionview/test/ujs/public/vendor/qunit.js +0 -2288
- data/vendor/rails/actionview/test/ujs/server.rb +0 -86
- data/vendor/rails/actionview/test/ujs/views/layouts/application.html.erb +0 -26
- data/vendor/rails/actionview/test/ujs/views/tests/index.html.erb +0 -11
- data/vendor/rails/ci/qunit-selenium-runner.rb +0 -16
- data/vendor/rails/ci/travis.rb +0 -187
- data/vendor/rails/rails.gemspec +0 -36
- data/vendor/rails/version.rb +0 -17
@@ -1,2293 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "abstract_unit"
|
4
|
-
require "controller/fake_models"
|
5
|
-
|
6
|
-
class FormWithTest < ActionView::TestCase
|
7
|
-
include RenderERBUtils
|
8
|
-
|
9
|
-
setup do
|
10
|
-
@old_value = ActionView::Helpers::FormHelper.form_with_generates_ids
|
11
|
-
ActionView::Helpers::FormHelper.form_with_generates_ids = true
|
12
|
-
end
|
13
|
-
|
14
|
-
teardown do
|
15
|
-
ActionView::Helpers::FormHelper.form_with_generates_ids = @old_value
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
class FormWithActsLikeFormTagTest < FormWithTest
|
20
|
-
tests ActionView::Helpers::FormTagHelper
|
21
|
-
|
22
|
-
setup do
|
23
|
-
@controller = BasicController.new
|
24
|
-
end
|
25
|
-
|
26
|
-
def hidden_fields(options = {})
|
27
|
-
method = options[:method]
|
28
|
-
skip_enforcing_utf8 = options.fetch(:skip_enforcing_utf8, false)
|
29
|
-
|
30
|
-
"".dup.tap do |txt|
|
31
|
-
unless skip_enforcing_utf8
|
32
|
-
txt << %{<input name="utf8" type="hidden" value="✓" />}
|
33
|
-
end
|
34
|
-
|
35
|
-
if method && !%w(get post).include?(method.to_s)
|
36
|
-
txt << %{<input name="_method" type="hidden" value="#{method}" />}
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def form_text(action = "http://www.example.com", local: false, **options)
|
42
|
-
enctype, html_class, id, method = options.values_at(:enctype, :html_class, :id, :method)
|
43
|
-
|
44
|
-
method = method.to_s == "get" ? "get" : "post"
|
45
|
-
|
46
|
-
txt = %{<form accept-charset="UTF-8" action="#{action}"}.dup
|
47
|
-
txt << %{ enctype="multipart/form-data"} if enctype
|
48
|
-
txt << %{ data-remote="true"} unless local
|
49
|
-
txt << %{ class="#{html_class}"} if html_class
|
50
|
-
txt << %{ id="#{id}"} if id
|
51
|
-
txt << %{ method="#{method}">}
|
52
|
-
end
|
53
|
-
|
54
|
-
def whole_form(action = "http://www.example.com", options = {})
|
55
|
-
out = form_text(action, options) + hidden_fields(options)
|
56
|
-
|
57
|
-
if block_given?
|
58
|
-
out << yield << "</form>"
|
59
|
-
end
|
60
|
-
|
61
|
-
out
|
62
|
-
end
|
63
|
-
|
64
|
-
def url_for(options)
|
65
|
-
if options.is_a?(Hash)
|
66
|
-
"http://www.example.com"
|
67
|
-
else
|
68
|
-
super
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
def test_form_with_multipart
|
73
|
-
actual = form_with(multipart: true)
|
74
|
-
|
75
|
-
expected = whole_form("http://www.example.com", enctype: true)
|
76
|
-
assert_dom_equal expected, actual
|
77
|
-
end
|
78
|
-
|
79
|
-
def test_form_with_with_method_patch
|
80
|
-
actual = form_with(method: :patch)
|
81
|
-
|
82
|
-
expected = whole_form("http://www.example.com", method: :patch)
|
83
|
-
assert_dom_equal expected, actual
|
84
|
-
end
|
85
|
-
|
86
|
-
def test_form_with_with_method_put
|
87
|
-
actual = form_with(method: :put)
|
88
|
-
|
89
|
-
expected = whole_form("http://www.example.com", method: :put)
|
90
|
-
assert_dom_equal expected, actual
|
91
|
-
end
|
92
|
-
|
93
|
-
def test_form_with_with_method_delete
|
94
|
-
actual = form_with(method: :delete)
|
95
|
-
|
96
|
-
expected = whole_form("http://www.example.com", method: :delete)
|
97
|
-
assert_dom_equal expected, actual
|
98
|
-
end
|
99
|
-
|
100
|
-
def test_form_with_with_local_true
|
101
|
-
actual = form_with(local: true)
|
102
|
-
|
103
|
-
expected = whole_form("http://www.example.com", local: true)
|
104
|
-
assert_dom_equal expected, actual
|
105
|
-
end
|
106
|
-
|
107
|
-
def test_form_with_skip_enforcing_utf8_true
|
108
|
-
actual = form_with(skip_enforcing_utf8: true)
|
109
|
-
expected = whole_form("http://www.example.com", skip_enforcing_utf8: true)
|
110
|
-
assert_dom_equal expected, actual
|
111
|
-
assert_predicate actual, :html_safe?
|
112
|
-
end
|
113
|
-
|
114
|
-
def test_form_with_with_block_in_erb
|
115
|
-
output_buffer = render_erb("<%= form_with(url: 'http://www.example.com') do %>Hello world!<% end %>")
|
116
|
-
|
117
|
-
expected = whole_form { "Hello world!" }
|
118
|
-
assert_dom_equal expected, output_buffer
|
119
|
-
end
|
120
|
-
|
121
|
-
def test_form_with_with_block_and_method_in_erb
|
122
|
-
output_buffer = render_erb("<%= form_with(url: 'http://www.example.com', method: :put) do %>Hello world!<% end %>")
|
123
|
-
|
124
|
-
expected = whole_form("http://www.example.com", method: "put") do
|
125
|
-
"Hello world!"
|
126
|
-
end
|
127
|
-
|
128
|
-
assert_dom_equal expected, output_buffer
|
129
|
-
end
|
130
|
-
|
131
|
-
def test_form_with_with_block_in_erb_and_local_true
|
132
|
-
output_buffer = render_erb("<%= form_with(url: 'http://www.example.com', local: true) do %>Hello world!<% end %>")
|
133
|
-
|
134
|
-
expected = whole_form("http://www.example.com", local: true) do
|
135
|
-
"Hello world!"
|
136
|
-
end
|
137
|
-
|
138
|
-
assert_dom_equal expected, output_buffer
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
class FormWithActsLikeFormForTest < FormWithTest
|
143
|
-
def form_with(*)
|
144
|
-
@output_buffer = super
|
145
|
-
end
|
146
|
-
|
147
|
-
teardown do
|
148
|
-
I18n.backend.reload!
|
149
|
-
end
|
150
|
-
|
151
|
-
setup do
|
152
|
-
# Create "label" locale for testing I18n label helpers
|
153
|
-
I18n.backend.store_translations "label",
|
154
|
-
activemodel: {
|
155
|
-
attributes: {
|
156
|
-
post: {
|
157
|
-
cost: "Total cost"
|
158
|
-
},
|
159
|
-
"post/language": {
|
160
|
-
spanish: "Espanol"
|
161
|
-
}
|
162
|
-
}
|
163
|
-
},
|
164
|
-
helpers: {
|
165
|
-
label: {
|
166
|
-
post: {
|
167
|
-
body: "Write entire text here",
|
168
|
-
color: {
|
169
|
-
red: "Rojo"
|
170
|
-
},
|
171
|
-
comments: {
|
172
|
-
body: "Write body here"
|
173
|
-
}
|
174
|
-
},
|
175
|
-
tag: {
|
176
|
-
value: "Tag"
|
177
|
-
},
|
178
|
-
post_delegate: {
|
179
|
-
title: "Delegate model_name title"
|
180
|
-
}
|
181
|
-
}
|
182
|
-
}
|
183
|
-
|
184
|
-
# Create "submit" locale for testing I18n submit helpers
|
185
|
-
I18n.backend.store_translations "submit",
|
186
|
-
helpers: {
|
187
|
-
submit: {
|
188
|
-
create: "Create %{model}",
|
189
|
-
update: "Confirm %{model} changes",
|
190
|
-
submit: "Save changes",
|
191
|
-
another_post: {
|
192
|
-
update: "Update your %{model}"
|
193
|
-
}
|
194
|
-
}
|
195
|
-
}
|
196
|
-
|
197
|
-
I18n.backend.store_translations "placeholder",
|
198
|
-
activemodel: {
|
199
|
-
attributes: {
|
200
|
-
post: {
|
201
|
-
cost: "Total cost"
|
202
|
-
},
|
203
|
-
"post/cost": {
|
204
|
-
uk: "Pounds"
|
205
|
-
}
|
206
|
-
}
|
207
|
-
},
|
208
|
-
helpers: {
|
209
|
-
placeholder: {
|
210
|
-
post: {
|
211
|
-
title: "What is this about?",
|
212
|
-
written_on: {
|
213
|
-
spanish: "Escrito en"
|
214
|
-
},
|
215
|
-
comments: {
|
216
|
-
body: "Write body here"
|
217
|
-
}
|
218
|
-
},
|
219
|
-
post_delegate: {
|
220
|
-
title: "Delegate model_name title"
|
221
|
-
},
|
222
|
-
tag: {
|
223
|
-
value: "Tag"
|
224
|
-
}
|
225
|
-
}
|
226
|
-
}
|
227
|
-
|
228
|
-
@post = Post.new
|
229
|
-
@comment = Comment.new
|
230
|
-
def @post.errors
|
231
|
-
Class.new {
|
232
|
-
def [](field); field == "author_name" ? ["can't be empty"] : [] end
|
233
|
-
def empty?() false end
|
234
|
-
def count() 1 end
|
235
|
-
def full_messages() ["Author name can't be empty"] end
|
236
|
-
}.new
|
237
|
-
end
|
238
|
-
def @post.to_key; [123]; end
|
239
|
-
def @post.id; 0; end
|
240
|
-
def @post.id_before_type_cast; "omg"; end
|
241
|
-
def @post.id_came_from_user?; true; end
|
242
|
-
def @post.to_param; "123"; end
|
243
|
-
|
244
|
-
@post.persisted = true
|
245
|
-
@post.title = "Hello World"
|
246
|
-
@post.author_name = ""
|
247
|
-
@post.body = "Back to the hill and over it again!"
|
248
|
-
@post.secret = 1
|
249
|
-
@post.written_on = Date.new(2004, 6, 15)
|
250
|
-
|
251
|
-
@post.comments = []
|
252
|
-
@post.comments << @comment
|
253
|
-
|
254
|
-
@post.tags = []
|
255
|
-
@post.tags << Tag.new
|
256
|
-
|
257
|
-
@post_delegator = PostDelegator.new
|
258
|
-
|
259
|
-
@post_delegator.title = "Hello World"
|
260
|
-
|
261
|
-
@car = Car.new("#000FFF")
|
262
|
-
end
|
263
|
-
|
264
|
-
Routes = ActionDispatch::Routing::RouteSet.new
|
265
|
-
Routes.draw do
|
266
|
-
resources :posts do
|
267
|
-
resources :comments
|
268
|
-
end
|
269
|
-
|
270
|
-
namespace :admin do
|
271
|
-
resources :posts do
|
272
|
-
resources :comments
|
273
|
-
end
|
274
|
-
end
|
275
|
-
|
276
|
-
get "/foo", to: "controller#action"
|
277
|
-
root to: "main#index"
|
278
|
-
end
|
279
|
-
|
280
|
-
def _routes
|
281
|
-
Routes
|
282
|
-
end
|
283
|
-
|
284
|
-
include Routes.url_helpers
|
285
|
-
|
286
|
-
def url_for(object)
|
287
|
-
@url_for_options = object
|
288
|
-
|
289
|
-
if object.is_a?(Hash) && object[:use_route].blank? && object[:controller].blank?
|
290
|
-
object.merge!(controller: "main", action: "index")
|
291
|
-
end
|
292
|
-
|
293
|
-
super
|
294
|
-
end
|
295
|
-
|
296
|
-
def test_form_with_requires_arguments
|
297
|
-
error = assert_raises(ArgumentError) do
|
298
|
-
form_for(nil, html: { id: "create-post" }) do
|
299
|
-
end
|
300
|
-
end
|
301
|
-
assert_equal "First argument in form cannot contain nil or be empty", error.message
|
302
|
-
|
303
|
-
error = assert_raises(ArgumentError) do
|
304
|
-
form_for([nil, nil], html: { id: "create-post" }) do
|
305
|
-
end
|
306
|
-
end
|
307
|
-
assert_equal "First argument in form cannot contain nil or be empty", error.message
|
308
|
-
end
|
309
|
-
|
310
|
-
def test_form_with
|
311
|
-
form_with(model: @post, id: "create-post") do |f|
|
312
|
-
concat f.label(:title) { "The Title" }
|
313
|
-
concat f.text_field(:title)
|
314
|
-
concat f.text_area(:body)
|
315
|
-
concat f.check_box(:secret)
|
316
|
-
concat f.select(:category, %w( animal economy sports ))
|
317
|
-
concat f.submit("Create post")
|
318
|
-
concat f.button("Create post")
|
319
|
-
concat f.button {
|
320
|
-
concat content_tag(:span, "Create post")
|
321
|
-
}
|
322
|
-
end
|
323
|
-
|
324
|
-
expected = whole_form("/posts/123", "create-post", method: "patch") do
|
325
|
-
"<label for='post_title'>The Title</label>" \
|
326
|
-
"<input name='post[title]' type='text' value='Hello World' id='post_title' />" \
|
327
|
-
"<textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea>" \
|
328
|
-
"<input name='post[secret]' type='hidden' value='0' />" \
|
329
|
-
"<input name='post[secret]' checked='checked' type='checkbox' value='1' id='post_secret' />" \
|
330
|
-
"<select name='post[category]' id='post_category'><option value='animal'>animal</option>\n<option value='economy'>economy</option>\n<option value='sports'>sports</option></select>" \
|
331
|
-
"<input name='commit' data-disable-with='Create post' type='submit' value='Create post' />" \
|
332
|
-
"<button name='button' type='submit'>Create post</button>" \
|
333
|
-
"<button name='button' type='submit'><span>Create post</span></button>"
|
334
|
-
end
|
335
|
-
|
336
|
-
assert_dom_equal expected, output_buffer
|
337
|
-
end
|
338
|
-
|
339
|
-
def test_form_with_not_outputting_ids
|
340
|
-
old_value = ActionView::Helpers::FormHelper.form_with_generates_ids
|
341
|
-
ActionView::Helpers::FormHelper.form_with_generates_ids = false
|
342
|
-
|
343
|
-
form_with(model: @post, id: "create-post") do |f|
|
344
|
-
concat f.label(:title) { "The Title" }
|
345
|
-
concat f.text_field(:title)
|
346
|
-
concat f.text_area(:body)
|
347
|
-
concat f.check_box(:secret)
|
348
|
-
concat f.select(:category, %w( animal economy sports ))
|
349
|
-
concat f.submit("Create post")
|
350
|
-
end
|
351
|
-
|
352
|
-
expected = whole_form("/posts/123", "create-post", method: "patch") do
|
353
|
-
"<label>The Title</label>" \
|
354
|
-
"<input name='post[title]' type='text' value='Hello World' />" \
|
355
|
-
"<textarea name='post[body]'>\nBack to the hill and over it again!</textarea>" \
|
356
|
-
"<input name='post[secret]' type='hidden' value='0' />" \
|
357
|
-
"<input name='post[secret]' checked='checked' type='checkbox' value='1' />" \
|
358
|
-
"<select name='post[category]'><option value='animal'>animal</option>\n<option value='economy'>economy</option>\n<option value='sports'>sports</option></select>" \
|
359
|
-
"<input name='commit' data-disable-with='Create post' type='submit' value='Create post' />"
|
360
|
-
end
|
361
|
-
|
362
|
-
assert_dom_equal expected, output_buffer
|
363
|
-
ensure
|
364
|
-
ActionView::Helpers::FormHelper.form_with_generates_ids = old_value
|
365
|
-
end
|
366
|
-
|
367
|
-
def test_form_with_only_url_on_create
|
368
|
-
form_with(url: "/posts") do |f|
|
369
|
-
concat f.label :title, "Label me"
|
370
|
-
concat f.text_field :title
|
371
|
-
end
|
372
|
-
|
373
|
-
expected = whole_form("/posts") do
|
374
|
-
'<label for="title">Label me</label>' \
|
375
|
-
'<input type="text" name="title" id="title">'
|
376
|
-
end
|
377
|
-
|
378
|
-
assert_dom_equal expected, output_buffer
|
379
|
-
end
|
380
|
-
|
381
|
-
def test_form_with_only_url_on_update
|
382
|
-
form_with(url: "/posts/123") do |f|
|
383
|
-
concat f.label :title, "Label me"
|
384
|
-
concat f.text_field :title
|
385
|
-
end
|
386
|
-
|
387
|
-
expected = whole_form("/posts/123") do
|
388
|
-
'<label for="title">Label me</label>' \
|
389
|
-
'<input type="text" name="title" id="title">'
|
390
|
-
end
|
391
|
-
|
392
|
-
assert_dom_equal expected, output_buffer
|
393
|
-
end
|
394
|
-
|
395
|
-
def test_form_with_general_attributes
|
396
|
-
form_with(url: "/posts/123") do |f|
|
397
|
-
concat f.text_field :no_model_to_back_this_badboy
|
398
|
-
end
|
399
|
-
|
400
|
-
expected = whole_form("/posts/123") do
|
401
|
-
'<input type="text" name="no_model_to_back_this_badboy" id="no_model_to_back_this_badboy" >'
|
402
|
-
end
|
403
|
-
|
404
|
-
assert_dom_equal expected, output_buffer
|
405
|
-
end
|
406
|
-
|
407
|
-
def test_form_with_attribute_not_on_model
|
408
|
-
form_with(model: @post) do |f|
|
409
|
-
concat f.text_field :this_dont_exist_on_post
|
410
|
-
end
|
411
|
-
|
412
|
-
expected = whole_form("/posts/123", method: :patch) do
|
413
|
-
'<input type="text" name="post[this_dont_exist_on_post]" id="post_this_dont_exist_on_post" >'
|
414
|
-
end
|
415
|
-
|
416
|
-
assert_dom_equal expected, output_buffer
|
417
|
-
end
|
418
|
-
|
419
|
-
def test_form_with_doesnt_call_private_or_protected_properties_on_form_object_skipping_value
|
420
|
-
obj = Class.new do
|
421
|
-
private def private_property
|
422
|
-
"That would be great."
|
423
|
-
end
|
424
|
-
|
425
|
-
protected def protected_property
|
426
|
-
"I believe you have my stapler."
|
427
|
-
end
|
428
|
-
end.new
|
429
|
-
|
430
|
-
form_with(model: obj, scope: "other_name", url: "/", id: "edit-other-name") do |f|
|
431
|
-
assert_dom_equal '<input type="hidden" name="other_name[private_property]" id="other_name_private_property">', f.hidden_field(:private_property)
|
432
|
-
assert_dom_equal '<input type="hidden" name="other_name[protected_property]" id="other_name_protected_property">', f.hidden_field(:protected_property)
|
433
|
-
end
|
434
|
-
end
|
435
|
-
|
436
|
-
def test_form_with_with_collection_select
|
437
|
-
post = Post.new
|
438
|
-
def post.active; false; end
|
439
|
-
form_with(model: post) do |f|
|
440
|
-
concat f.collection_select(:active, [true, false], :to_s, :to_s)
|
441
|
-
end
|
442
|
-
|
443
|
-
expected = whole_form("/posts") do
|
444
|
-
"<select name='post[active]' id='post_active'>" \
|
445
|
-
"<option value='true'>true</option>\n" \
|
446
|
-
"<option selected='selected' value='false'>false</option>" \
|
447
|
-
"</select>"
|
448
|
-
end
|
449
|
-
|
450
|
-
assert_dom_equal expected, output_buffer
|
451
|
-
end
|
452
|
-
|
453
|
-
def test_form_with_with_collection_radio_buttons
|
454
|
-
post = Post.new
|
455
|
-
def post.active; false; end
|
456
|
-
form_with(model: post) do |f|
|
457
|
-
concat f.collection_radio_buttons(:active, [true, false], :to_s, :to_s)
|
458
|
-
end
|
459
|
-
|
460
|
-
expected = whole_form("/posts") do
|
461
|
-
"<input type='hidden' name='post[active]' value='' />" \
|
462
|
-
"<input name='post[active]' type='radio' value='true' id='post_active_true' />" \
|
463
|
-
"<label for='post_active_true'>true</label>" \
|
464
|
-
"<input checked='checked' name='post[active]' type='radio' value='false' id='post_active_false' />" \
|
465
|
-
"<label for='post_active_false'>false</label>"
|
466
|
-
end
|
467
|
-
|
468
|
-
assert_dom_equal expected, output_buffer
|
469
|
-
end
|
470
|
-
|
471
|
-
def test_form_with_with_collection_radio_buttons_with_custom_builder_block
|
472
|
-
post = Post.new
|
473
|
-
def post.active; false; end
|
474
|
-
|
475
|
-
form_with(model: post) do |f|
|
476
|
-
rendered_radio_buttons = f.collection_radio_buttons(:active, [true, false], :to_s, :to_s) do |b|
|
477
|
-
b.label { b.radio_button + b.text }
|
478
|
-
end
|
479
|
-
concat rendered_radio_buttons
|
480
|
-
end
|
481
|
-
|
482
|
-
expected = whole_form("/posts") do
|
483
|
-
"<input type='hidden' name='post[active]' value='' />" \
|
484
|
-
"<label for='post_active_true'>" \
|
485
|
-
"<input name='post[active]' type='radio' value='true' id='post_active_true' />" \
|
486
|
-
"true</label>" \
|
487
|
-
"<label for='post_active_false'>" \
|
488
|
-
"<input checked='checked' name='post[active]' type='radio' value='false' id='post_active_false' />" \
|
489
|
-
"false</label>"
|
490
|
-
end
|
491
|
-
|
492
|
-
assert_dom_equal expected, output_buffer
|
493
|
-
end
|
494
|
-
|
495
|
-
def test_form_with_with_collection_radio_buttons_with_custom_builder_block_does_not_leak_the_template
|
496
|
-
post = Post.new
|
497
|
-
def post.active; false; end
|
498
|
-
def post.id; 1; end
|
499
|
-
|
500
|
-
form_with(model: post) do |f|
|
501
|
-
rendered_radio_buttons = f.collection_radio_buttons(:active, [true, false], :to_s, :to_s) do |b|
|
502
|
-
b.label { b.radio_button + b.text }
|
503
|
-
end
|
504
|
-
concat rendered_radio_buttons
|
505
|
-
concat f.hidden_field :id
|
506
|
-
end
|
507
|
-
|
508
|
-
expected = whole_form("/posts") do
|
509
|
-
"<input type='hidden' name='post[active]' value='' />" \
|
510
|
-
"<label for='post_active_true'>" \
|
511
|
-
"<input name='post[active]' type='radio' value='true' id='post_active_true' />" \
|
512
|
-
"true</label>" \
|
513
|
-
"<label for='post_active_false'>" \
|
514
|
-
"<input checked='checked' name='post[active]' type='radio' value='false' id='post_active_false' />" \
|
515
|
-
"false</label>" \
|
516
|
-
"<input name='post[id]' type='hidden' value='1' id='post_id' />"
|
517
|
-
end
|
518
|
-
|
519
|
-
assert_dom_equal expected, output_buffer
|
520
|
-
end
|
521
|
-
|
522
|
-
def test_form_with_with_index_and_with_collection_radio_buttons
|
523
|
-
post = Post.new
|
524
|
-
def post.active; false; end
|
525
|
-
|
526
|
-
form_with(model: post, index: "1") do |f|
|
527
|
-
concat f.collection_radio_buttons(:active, [true, false], :to_s, :to_s)
|
528
|
-
end
|
529
|
-
|
530
|
-
expected = whole_form("/posts") do
|
531
|
-
"<input type='hidden' name='post[1][active]' value='' />" \
|
532
|
-
"<input name='post[1][active]' type='radio' value='true' id='post_1_active_true' />" \
|
533
|
-
"<label for='post_1_active_true'>true</label>" \
|
534
|
-
"<input checked='checked' name='post[1][active]' type='radio' value='false' id='post_1_active_false' />" \
|
535
|
-
"<label for='post_1_active_false'>false</label>"
|
536
|
-
end
|
537
|
-
|
538
|
-
assert_dom_equal expected, output_buffer
|
539
|
-
end
|
540
|
-
|
541
|
-
def test_form_with_with_collection_check_boxes
|
542
|
-
post = Post.new
|
543
|
-
def post.tag_ids; [1, 3]; end
|
544
|
-
collection = (1..3).map { |i| [i, "Tag #{i}"] }
|
545
|
-
form_with(model: post) do |f|
|
546
|
-
concat f.collection_check_boxes(:tag_ids, collection, :first, :last)
|
547
|
-
end
|
548
|
-
|
549
|
-
expected = whole_form("/posts") do
|
550
|
-
"<input name='post[tag_ids][]' type='hidden' value='' />" \
|
551
|
-
"<input checked='checked' name='post[tag_ids][]' type='checkbox' value='1' id='post_tag_ids_1' />" \
|
552
|
-
"<label for='post_tag_ids_1'>Tag 1</label>" \
|
553
|
-
"<input name='post[tag_ids][]' type='checkbox' value='2' id='post_tag_ids_2' />" \
|
554
|
-
"<label for='post_tag_ids_2'>Tag 2</label>" \
|
555
|
-
"<input checked='checked' name='post[tag_ids][]' type='checkbox' value='3' id='post_tag_ids_3' />" \
|
556
|
-
"<label for='post_tag_ids_3'>Tag 3</label>"
|
557
|
-
end
|
558
|
-
|
559
|
-
assert_dom_equal expected, output_buffer
|
560
|
-
end
|
561
|
-
|
562
|
-
def test_form_with_with_collection_check_boxes_with_custom_builder_block
|
563
|
-
post = Post.new
|
564
|
-
def post.tag_ids; [1, 3]; end
|
565
|
-
collection = (1..3).map { |i| [i, "Tag #{i}"] }
|
566
|
-
form_with(model: post) do |f|
|
567
|
-
rendered_check_boxes = f.collection_check_boxes(:tag_ids, collection, :first, :last) do |b|
|
568
|
-
b.label { b.check_box + b.text }
|
569
|
-
end
|
570
|
-
concat rendered_check_boxes
|
571
|
-
end
|
572
|
-
|
573
|
-
expected = whole_form("/posts") do
|
574
|
-
"<input name='post[tag_ids][]' type='hidden' value='' />" \
|
575
|
-
"<label for='post_tag_ids_1'>" \
|
576
|
-
"<input checked='checked' name='post[tag_ids][]' type='checkbox' value='1' id='post_tag_ids_1' />" \
|
577
|
-
"Tag 1</label>" \
|
578
|
-
"<label for='post_tag_ids_2'>" \
|
579
|
-
"<input name='post[tag_ids][]' type='checkbox' value='2' id='post_tag_ids_2' />" \
|
580
|
-
"Tag 2</label>" \
|
581
|
-
"<label for='post_tag_ids_3'>" \
|
582
|
-
"<input checked='checked' name='post[tag_ids][]' type='checkbox' value='3' id='post_tag_ids_3' />" \
|
583
|
-
"Tag 3</label>"
|
584
|
-
end
|
585
|
-
|
586
|
-
assert_dom_equal expected, output_buffer
|
587
|
-
end
|
588
|
-
|
589
|
-
def test_form_with_with_collection_check_boxes_with_custom_builder_block_does_not_leak_the_template
|
590
|
-
post = Post.new
|
591
|
-
def post.tag_ids; [1, 3]; end
|
592
|
-
def post.id; 1; end
|
593
|
-
collection = (1..3).map { |i| [i, "Tag #{i}"] }
|
594
|
-
|
595
|
-
form_with(model: post) do |f|
|
596
|
-
rendered_check_boxes = f.collection_check_boxes(:tag_ids, collection, :first, :last) do |b|
|
597
|
-
b.label { b.check_box + b.text }
|
598
|
-
end
|
599
|
-
concat rendered_check_boxes
|
600
|
-
concat f.hidden_field :id
|
601
|
-
end
|
602
|
-
|
603
|
-
expected = whole_form("/posts") do
|
604
|
-
"<input name='post[tag_ids][]' type='hidden' value='' />" \
|
605
|
-
"<label for='post_tag_ids_1'>" \
|
606
|
-
"<input checked='checked' name='post[tag_ids][]' type='checkbox' value='1' id='post_tag_ids_1' />" \
|
607
|
-
"Tag 1</label>" \
|
608
|
-
"<label for='post_tag_ids_2'>" \
|
609
|
-
"<input name='post[tag_ids][]' type='checkbox' value='2' id='post_tag_ids_2' />" \
|
610
|
-
"Tag 2</label>" \
|
611
|
-
"<label for='post_tag_ids_3'>" \
|
612
|
-
"<input checked='checked' name='post[tag_ids][]' type='checkbox' value='3' id='post_tag_ids_3' />" \
|
613
|
-
"Tag 3</label>" \
|
614
|
-
"<input name='post[id]' type='hidden' value='1' id='post_id' />"
|
615
|
-
end
|
616
|
-
|
617
|
-
assert_dom_equal expected, output_buffer
|
618
|
-
end
|
619
|
-
|
620
|
-
def test_form_with_index_and_with_collection_check_boxes
|
621
|
-
post = Post.new
|
622
|
-
def post.tag_ids; [1]; end
|
623
|
-
collection = [[1, "Tag 1"]]
|
624
|
-
|
625
|
-
form_with(model: post, index: "1") do |f|
|
626
|
-
concat f.collection_check_boxes(:tag_ids, collection, :first, :last)
|
627
|
-
end
|
628
|
-
|
629
|
-
expected = whole_form("/posts") do
|
630
|
-
"<input name='post[1][tag_ids][]' type='hidden' value='' />" \
|
631
|
-
"<input checked='checked' name='post[1][tag_ids][]' type='checkbox' value='1' id='post_1_tag_ids_1' />" \
|
632
|
-
"<label for='post_1_tag_ids_1'>Tag 1</label>"
|
633
|
-
end
|
634
|
-
|
635
|
-
assert_dom_equal expected, output_buffer
|
636
|
-
end
|
637
|
-
|
638
|
-
def test_form_with_with_file_field_generate_multipart
|
639
|
-
form_with(model: @post, id: "create-post") do |f|
|
640
|
-
concat f.file_field(:file)
|
641
|
-
end
|
642
|
-
|
643
|
-
expected = whole_form("/posts/123", "create-post", method: "patch", multipart: true) do
|
644
|
-
"<input name='post[file]' type='file' id='post_file' />"
|
645
|
-
end
|
646
|
-
|
647
|
-
assert_dom_equal expected, output_buffer
|
648
|
-
end
|
649
|
-
|
650
|
-
def test_fields_with_file_field_generate_multipart
|
651
|
-
form_with(model: @post) do |f|
|
652
|
-
concat f.fields(:comment, model: @post) { |c|
|
653
|
-
concat c.file_field(:file)
|
654
|
-
}
|
655
|
-
end
|
656
|
-
|
657
|
-
expected = whole_form("/posts/123", method: "patch", multipart: true) do
|
658
|
-
"<input name='post[comment][file]' type='file' id='post_comment_file'/>"
|
659
|
-
end
|
660
|
-
|
661
|
-
assert_dom_equal expected, output_buffer
|
662
|
-
end
|
663
|
-
|
664
|
-
def test_form_with_with_format
|
665
|
-
form_with(model: @post, format: :json, id: "edit_post_123", class: "edit_post") do |f|
|
666
|
-
concat f.label(:title)
|
667
|
-
end
|
668
|
-
|
669
|
-
expected = whole_form("/posts/123.json", "edit_post_123", "edit_post", method: "patch") do
|
670
|
-
"<label for='post_title'>Title</label>"
|
671
|
-
end
|
672
|
-
|
673
|
-
assert_dom_equal expected, output_buffer
|
674
|
-
end
|
675
|
-
|
676
|
-
def test_form_with_with_format_and_url
|
677
|
-
form_with(model: @post, format: :json, url: "/") do |f|
|
678
|
-
concat f.label(:title)
|
679
|
-
end
|
680
|
-
|
681
|
-
expected = whole_form("/", method: "patch") do
|
682
|
-
"<label for='post_title'>Title</label>"
|
683
|
-
end
|
684
|
-
|
685
|
-
assert_dom_equal expected, output_buffer
|
686
|
-
end
|
687
|
-
|
688
|
-
def test_form_with_with_model_using_relative_model_naming
|
689
|
-
blog_post = Blog::Post.new("And his name will be forty and four.", 44)
|
690
|
-
|
691
|
-
form_with(model: blog_post) do |f|
|
692
|
-
concat f.text_field :title
|
693
|
-
concat f.submit("Edit post")
|
694
|
-
end
|
695
|
-
|
696
|
-
expected = whole_form("/posts/44", method: "patch") do
|
697
|
-
"<input name='post[title]' type='text' value='And his name will be forty and four.' id='post_title' />" \
|
698
|
-
"<input name='commit' data-disable-with='Edit post' type='submit' value='Edit post' />"
|
699
|
-
end
|
700
|
-
|
701
|
-
assert_dom_equal expected, output_buffer
|
702
|
-
end
|
703
|
-
|
704
|
-
def test_form_with_with_symbol_scope
|
705
|
-
form_with(model: @post, scope: "other_name", id: "create-post") do |f|
|
706
|
-
concat f.label(:title, class: "post_title")
|
707
|
-
concat f.text_field(:title)
|
708
|
-
concat f.text_area(:body)
|
709
|
-
concat f.check_box(:secret)
|
710
|
-
concat f.submit("Create post")
|
711
|
-
end
|
712
|
-
|
713
|
-
expected = whole_form("/posts/123", "create-post", method: "patch") do
|
714
|
-
"<label for='other_name_title' class='post_title'>Title</label>" \
|
715
|
-
"<input name='other_name[title]' value='Hello World' type='text' id='other_name_title' />" \
|
716
|
-
"<textarea name='other_name[body]' id='other_name_body'>\nBack to the hill and over it again!</textarea>" \
|
717
|
-
"<input name='other_name[secret]' value='0' type='hidden' />" \
|
718
|
-
"<input name='other_name[secret]' checked='checked' value='1' type='checkbox' id='other_name_secret' />" \
|
719
|
-
"<input name='commit' value='Create post' data-disable-with='Create post' type='submit' />"
|
720
|
-
end
|
721
|
-
|
722
|
-
assert_dom_equal expected, output_buffer
|
723
|
-
end
|
724
|
-
|
725
|
-
def test_form_with_with_method_as_part_of_html_options
|
726
|
-
form_with(model: @post, url: "/", id: "create-post", html: { method: :delete }) do |f|
|
727
|
-
concat f.text_field(:title)
|
728
|
-
concat f.text_area(:body)
|
729
|
-
concat f.check_box(:secret)
|
730
|
-
end
|
731
|
-
|
732
|
-
expected = whole_form("/", "create-post", method: "delete") do
|
733
|
-
"<input name='post[title]' type='text' value='Hello World' id='post_title' />" \
|
734
|
-
"<textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea>" \
|
735
|
-
"<input name='post[secret]' type='hidden' value='0' />" \
|
736
|
-
"<input name='post[secret]' checked='checked' type='checkbox' value='1' id='post_secret'/>"
|
737
|
-
end
|
738
|
-
|
739
|
-
assert_dom_equal expected, output_buffer
|
740
|
-
end
|
741
|
-
|
742
|
-
def test_form_with_with_method
|
743
|
-
form_with(model: @post, url: "/", method: :delete, id: "create-post") do |f|
|
744
|
-
concat f.text_field(:title)
|
745
|
-
concat f.text_area(:body)
|
746
|
-
concat f.check_box(:secret)
|
747
|
-
end
|
748
|
-
|
749
|
-
expected = whole_form("/", "create-post", method: "delete") do
|
750
|
-
"<input name='post[title]' type='text' value='Hello World' id='post_title' />" \
|
751
|
-
"<textarea name='post[body]' id='post_body' >\nBack to the hill and over it again!</textarea>" \
|
752
|
-
"<input name='post[secret]' type='hidden' value='0' />" \
|
753
|
-
"<input name='post[secret]' checked='checked' type='checkbox' value='1' id='post_secret' />"
|
754
|
-
end
|
755
|
-
|
756
|
-
assert_dom_equal expected, output_buffer
|
757
|
-
end
|
758
|
-
|
759
|
-
def test_form_with_with_search_field
|
760
|
-
# Test case for bug which would emit an "object" attribute
|
761
|
-
# when used with form_for using a search_field form helper
|
762
|
-
form_with(model: Post.new, url: "/search", id: "search-post", method: :get) do |f|
|
763
|
-
concat f.search_field(:title)
|
764
|
-
end
|
765
|
-
|
766
|
-
expected = whole_form("/search", "search-post", method: "get") do
|
767
|
-
"<input name='post[title]' type='search' id='post_title' />"
|
768
|
-
end
|
769
|
-
|
770
|
-
assert_dom_equal expected, output_buffer
|
771
|
-
end
|
772
|
-
|
773
|
-
def test_form_with_enables_remote_by_default
|
774
|
-
form_with(model: @post, url: "/", id: "create-post", method: :patch) do |f|
|
775
|
-
concat f.text_field(:title)
|
776
|
-
concat f.text_area(:body)
|
777
|
-
concat f.check_box(:secret)
|
778
|
-
end
|
779
|
-
|
780
|
-
expected = whole_form("/", "create-post", method: "patch") do
|
781
|
-
"<input name='post[title]' type='text' value='Hello World' id='post_title' />" \
|
782
|
-
"<textarea name='post[body]' id='post_body' >\nBack to the hill and over it again!</textarea>" \
|
783
|
-
"<input name='post[secret]' type='hidden' value='0' />" \
|
784
|
-
"<input name='post[secret]' checked='checked' type='checkbox' value='1' id='post_secret' />"
|
785
|
-
end
|
786
|
-
|
787
|
-
assert_dom_equal expected, output_buffer
|
788
|
-
end
|
789
|
-
|
790
|
-
def test_form_is_not_remote_by_default_if_form_with_generates_remote_forms_is_false
|
791
|
-
old_value = ActionView::Helpers::FormHelper.form_with_generates_remote_forms
|
792
|
-
ActionView::Helpers::FormHelper.form_with_generates_remote_forms = false
|
793
|
-
|
794
|
-
form_with(model: @post, url: "/", id: "create-post", method: :patch) do |f|
|
795
|
-
concat f.text_field(:title)
|
796
|
-
concat f.text_area(:body)
|
797
|
-
concat f.check_box(:secret)
|
798
|
-
end
|
799
|
-
|
800
|
-
expected = whole_form("/", "create-post", method: "patch", local: true) do
|
801
|
-
"<input name='post[title]' type='text' value='Hello World' id='post_title' />" \
|
802
|
-
"<textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea>" \
|
803
|
-
"<input name='post[secret]' type='hidden' value='0' />" \
|
804
|
-
"<input name='post[secret]' checked='checked' type='checkbox' value='1' id='post_secret' />"
|
805
|
-
end
|
806
|
-
|
807
|
-
assert_dom_equal expected, output_buffer
|
808
|
-
ensure
|
809
|
-
ActionView::Helpers::FormHelper.form_with_generates_remote_forms = old_value
|
810
|
-
end
|
811
|
-
|
812
|
-
def test_form_with_skip_enforcing_utf8_true
|
813
|
-
form_with(scope: :post, skip_enforcing_utf8: true) do |f|
|
814
|
-
concat f.text_field(:title)
|
815
|
-
end
|
816
|
-
|
817
|
-
expected = whole_form("/", skip_enforcing_utf8: true) do
|
818
|
-
"<input name='post[title]' type='text' value='Hello World' id='post_title' />"
|
819
|
-
end
|
820
|
-
|
821
|
-
assert_dom_equal expected, output_buffer
|
822
|
-
end
|
823
|
-
|
824
|
-
def test_form_with_skip_enforcing_utf8_false
|
825
|
-
form_with(scope: :post, skip_enforcing_utf8: false) do |f|
|
826
|
-
concat f.text_field(:title)
|
827
|
-
end
|
828
|
-
|
829
|
-
expected = whole_form("/", skip_enforcing_utf8: false) do
|
830
|
-
"<input name='post[title]' type='text' value='Hello World' id='post_title' />"
|
831
|
-
end
|
832
|
-
|
833
|
-
assert_dom_equal expected, output_buffer
|
834
|
-
end
|
835
|
-
|
836
|
-
def test_form_with_without_object
|
837
|
-
form_with(scope: :post, id: "create-post") do |f|
|
838
|
-
concat f.text_field(:title)
|
839
|
-
concat f.text_area(:body)
|
840
|
-
concat f.check_box(:secret)
|
841
|
-
end
|
842
|
-
|
843
|
-
expected = whole_form("/", "create-post") do
|
844
|
-
"<input name='post[title]' type='text' value='Hello World' id='post_title' />" \
|
845
|
-
"<textarea name='post[body]' id='post_body' >\nBack to the hill and over it again!</textarea>" \
|
846
|
-
"<input name='post[secret]' type='hidden' value='0' />" \
|
847
|
-
"<input name='post[secret]' checked='checked' type='checkbox' value='1' id='post_secret' />"
|
848
|
-
end
|
849
|
-
|
850
|
-
assert_dom_equal expected, output_buffer
|
851
|
-
end
|
852
|
-
|
853
|
-
def test_form_with_with_index
|
854
|
-
form_with(model: @post, scope: "post[]") do |f|
|
855
|
-
concat f.label(:title)
|
856
|
-
concat f.text_field(:title)
|
857
|
-
concat f.text_area(:body)
|
858
|
-
concat f.check_box(:secret)
|
859
|
-
end
|
860
|
-
|
861
|
-
expected = whole_form("/posts/123", method: "patch") do
|
862
|
-
"<label for='post_123_title'>Title</label>" \
|
863
|
-
"<input name='post[123][title]' type='text' value='Hello World' id='post_123_title' />" \
|
864
|
-
"<textarea name='post[123][body]' id='post_123_body'>\nBack to the hill and over it again!</textarea>" \
|
865
|
-
"<input name='post[123][secret]' type='hidden' value='0' />" \
|
866
|
-
"<input name='post[123][secret]' checked='checked' type='checkbox' value='1' id='post_123_secret' />"
|
867
|
-
end
|
868
|
-
|
869
|
-
assert_dom_equal expected, output_buffer
|
870
|
-
end
|
871
|
-
|
872
|
-
def test_form_with_with_nil_index_option_override
|
873
|
-
form_with(model: @post, scope: "post[]", index: nil) do |f|
|
874
|
-
concat f.text_field(:title)
|
875
|
-
concat f.text_area(:body)
|
876
|
-
concat f.check_box(:secret)
|
877
|
-
end
|
878
|
-
|
879
|
-
expected = whole_form("/posts/123", method: "patch") do
|
880
|
-
"<input name='post[][title]' type='text' value='Hello World' id='post__title' />" \
|
881
|
-
"<textarea name='post[][body]' id='post__body' >\nBack to the hill and over it again!</textarea>" \
|
882
|
-
"<input name='post[][secret]' type='hidden' value='0' />" \
|
883
|
-
"<input name='post[][secret]' checked='checked' type='checkbox' value='1' id='post__secret' />"
|
884
|
-
end
|
885
|
-
|
886
|
-
assert_dom_equal expected, output_buffer
|
887
|
-
end
|
888
|
-
|
889
|
-
def test_form_with_label_error_wrapping
|
890
|
-
form_with(model: @post) do |f|
|
891
|
-
concat f.label(:author_name, class: "label")
|
892
|
-
concat f.text_field(:author_name)
|
893
|
-
concat f.submit("Create post")
|
894
|
-
end
|
895
|
-
|
896
|
-
expected = whole_form("/posts/123", method: "patch") do
|
897
|
-
"<div class='field_with_errors'><label for='post_author_name' class='label'>Author name</label></div>" \
|
898
|
-
"<div class='field_with_errors'><input name='post[author_name]' type='text' value='' id='post_author_name' /></div>" \
|
899
|
-
"<input name='commit' data-disable-with='Create post' type='submit' value='Create post' />"
|
900
|
-
end
|
901
|
-
|
902
|
-
assert_dom_equal expected, output_buffer
|
903
|
-
end
|
904
|
-
|
905
|
-
def test_form_with_label_error_wrapping_without_conventional_instance_variable
|
906
|
-
post = remove_instance_variable :@post
|
907
|
-
|
908
|
-
form_with(model: post) do |f|
|
909
|
-
concat f.label(:author_name, class: "label")
|
910
|
-
concat f.text_field(:author_name)
|
911
|
-
concat f.submit("Create post")
|
912
|
-
end
|
913
|
-
|
914
|
-
expected = whole_form("/posts/123", method: "patch") do
|
915
|
-
"<div class='field_with_errors'><label for='post_author_name' class='label'>Author name</label></div>" \
|
916
|
-
"<div class='field_with_errors'><input name='post[author_name]' type='text' value='' id='post_author_name' /></div>" \
|
917
|
-
"<input name='commit' data-disable-with='Create post' type='submit' value='Create post' />"
|
918
|
-
end
|
919
|
-
|
920
|
-
assert_dom_equal expected, output_buffer
|
921
|
-
end
|
922
|
-
|
923
|
-
def test_form_with_label_error_wrapping_block_and_non_block_versions
|
924
|
-
form_with(model: @post) do |f|
|
925
|
-
concat f.label(:author_name, "Name", class: "label")
|
926
|
-
concat f.label(:author_name, class: "label") { "Name" }
|
927
|
-
end
|
928
|
-
|
929
|
-
expected = whole_form("/posts/123", method: "patch") do
|
930
|
-
"<div class='field_with_errors'><label for='post_author_name' class='label'>Name</label></div>" \
|
931
|
-
"<div class='field_with_errors'><label for='post_author_name' class='label'>Name</label></div>"
|
932
|
-
end
|
933
|
-
|
934
|
-
assert_dom_equal expected, output_buffer
|
935
|
-
end
|
936
|
-
|
937
|
-
def test_submit_with_object_as_new_record_and_locale_strings
|
938
|
-
with_locale :submit do
|
939
|
-
@post.persisted = false
|
940
|
-
@post.stub(:to_key, nil) do
|
941
|
-
form_with(model: @post) do |f|
|
942
|
-
concat f.submit
|
943
|
-
end
|
944
|
-
|
945
|
-
expected = whole_form("/posts") do
|
946
|
-
"<input name='commit' data-disable-with='Create Post' type='submit' value='Create Post' />"
|
947
|
-
end
|
948
|
-
|
949
|
-
assert_dom_equal expected, output_buffer
|
950
|
-
end
|
951
|
-
end
|
952
|
-
end
|
953
|
-
|
954
|
-
def test_submit_with_object_as_existing_record_and_locale_strings
|
955
|
-
with_locale :submit do
|
956
|
-
form_with(model: @post) do |f|
|
957
|
-
concat f.submit
|
958
|
-
end
|
959
|
-
|
960
|
-
expected = whole_form("/posts/123", method: "patch") do
|
961
|
-
"<input name='commit' data-disable-with='Confirm Post changes' type='submit' value='Confirm Post changes' />"
|
962
|
-
end
|
963
|
-
|
964
|
-
assert_dom_equal expected, output_buffer
|
965
|
-
end
|
966
|
-
end
|
967
|
-
|
968
|
-
def test_submit_without_object_and_locale_strings
|
969
|
-
with_locale :submit do
|
970
|
-
form_with(scope: :post) do |f|
|
971
|
-
concat f.submit class: "extra"
|
972
|
-
end
|
973
|
-
|
974
|
-
expected = whole_form do
|
975
|
-
"<input name='commit' class='extra' data-disable-with='Save changes' type='submit' value='Save changes' />"
|
976
|
-
end
|
977
|
-
|
978
|
-
assert_dom_equal expected, output_buffer
|
979
|
-
end
|
980
|
-
end
|
981
|
-
|
982
|
-
def test_submit_with_object_and_nested_lookup
|
983
|
-
with_locale :submit do
|
984
|
-
form_with(model: @post, scope: :another_post) do |f|
|
985
|
-
concat f.submit
|
986
|
-
end
|
987
|
-
|
988
|
-
expected = whole_form("/posts/123", method: "patch") do
|
989
|
-
"<input name='commit' data-disable-with='Update your Post' type='submit' value='Update your Post' />"
|
990
|
-
end
|
991
|
-
|
992
|
-
assert_dom_equal expected, output_buffer
|
993
|
-
end
|
994
|
-
end
|
995
|
-
|
996
|
-
def test_fields_with_attributes_not_on_model
|
997
|
-
form_with(model: @post) do |f|
|
998
|
-
concat f.fields(:comment) { |c|
|
999
|
-
concat c.text_field :dont_exist_on_model
|
1000
|
-
}
|
1001
|
-
end
|
1002
|
-
|
1003
|
-
expected = whole_form("/posts/123", method: :patch) do
|
1004
|
-
'<input type="text" name="post[comment][dont_exist_on_model]" id="post_comment_dont_exist_on_model" >'
|
1005
|
-
end
|
1006
|
-
|
1007
|
-
assert_dom_equal expected, output_buffer
|
1008
|
-
end
|
1009
|
-
|
1010
|
-
def test_fields_with_attributes_not_on_model_deep_nested
|
1011
|
-
@comment.save
|
1012
|
-
form_with(scope: :posts) do |f|
|
1013
|
-
f.fields("post[]", model: @post) do |f2|
|
1014
|
-
f2.text_field(:id)
|
1015
|
-
@post.comments.each do |comment|
|
1016
|
-
concat f2.fields("comment[]", model: comment) { |c|
|
1017
|
-
concat c.text_field(:dont_exist_on_model)
|
1018
|
-
}
|
1019
|
-
end
|
1020
|
-
end
|
1021
|
-
end
|
1022
|
-
|
1023
|
-
expected = whole_form do
|
1024
|
-
'<input name="posts[post][0][comment][1][dont_exist_on_model]" type="text" id="posts_post_0_comment_1_dont_exist_on_model" >'
|
1025
|
-
end
|
1026
|
-
|
1027
|
-
assert_dom_equal expected, output_buffer
|
1028
|
-
end
|
1029
|
-
|
1030
|
-
def test_nested_fields
|
1031
|
-
@comment.body = "Hello World"
|
1032
|
-
form_with(model: @post) do |f|
|
1033
|
-
concat f.fields(model: @comment) { |c|
|
1034
|
-
concat c.text_field(:body)
|
1035
|
-
}
|
1036
|
-
end
|
1037
|
-
|
1038
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1039
|
-
"<input name='post[comment][body]' type='text' value='Hello World' id='post_comment_body' />"
|
1040
|
-
end
|
1041
|
-
|
1042
|
-
assert_dom_equal expected, output_buffer
|
1043
|
-
end
|
1044
|
-
|
1045
|
-
def test_deep_nested_fields
|
1046
|
-
@comment.save
|
1047
|
-
form_with(scope: :posts) do |f|
|
1048
|
-
f.fields("post[]", model: @post) do |f2|
|
1049
|
-
f2.text_field(:id)
|
1050
|
-
@post.comments.each do |comment|
|
1051
|
-
concat f2.fields("comment[]", model: comment) { |c|
|
1052
|
-
concat c.text_field(:name)
|
1053
|
-
}
|
1054
|
-
end
|
1055
|
-
end
|
1056
|
-
end
|
1057
|
-
|
1058
|
-
expected = whole_form do
|
1059
|
-
"<input name='posts[post][0][comment][1][name]' type='text' value='comment #1' id='posts_post_0_comment_1_name' />"
|
1060
|
-
end
|
1061
|
-
|
1062
|
-
assert_dom_equal expected, output_buffer
|
1063
|
-
end
|
1064
|
-
|
1065
|
-
def test_nested_fields_with_nested_collections
|
1066
|
-
form_with(model: @post, scope: "post[]") do |f|
|
1067
|
-
concat f.text_field(:title)
|
1068
|
-
concat f.fields("comment[]", model: @comment) { |c|
|
1069
|
-
concat c.text_field(:name)
|
1070
|
-
}
|
1071
|
-
end
|
1072
|
-
|
1073
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1074
|
-
"<input name='post[123][title]' type='text' value='Hello World' id='post_123_title' />" \
|
1075
|
-
"<input name='post[123][comment][][name]' type='text' value='new comment' id='post_123_comment__name' />"
|
1076
|
-
end
|
1077
|
-
|
1078
|
-
assert_dom_equal expected, output_buffer
|
1079
|
-
end
|
1080
|
-
|
1081
|
-
def test_nested_fields_with_index_and_parent_fields
|
1082
|
-
form_with(model: @post, index: 1) do |c|
|
1083
|
-
concat c.text_field(:title)
|
1084
|
-
concat c.fields("comment", model: @comment, index: 1) { |r|
|
1085
|
-
concat r.text_field(:name)
|
1086
|
-
}
|
1087
|
-
end
|
1088
|
-
|
1089
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1090
|
-
"<input name='post[1][title]' type='text' value='Hello World' id='post_1_title' />" \
|
1091
|
-
"<input name='post[1][comment][1][name]' type='text' value='new comment' id='post_1_comment_1_name' />"
|
1092
|
-
end
|
1093
|
-
|
1094
|
-
assert_dom_equal expected, output_buffer
|
1095
|
-
end
|
1096
|
-
|
1097
|
-
def test_form_with_with_index_and_nested_fields
|
1098
|
-
output_buffer = form_with(model: @post, index: 1) do |f|
|
1099
|
-
concat f.fields(:comment, model: @post) { |c|
|
1100
|
-
concat c.text_field(:title)
|
1101
|
-
}
|
1102
|
-
end
|
1103
|
-
|
1104
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1105
|
-
"<input name='post[1][comment][title]' type='text' value='Hello World' id='post_1_comment_title' />"
|
1106
|
-
end
|
1107
|
-
|
1108
|
-
assert_dom_equal expected, output_buffer
|
1109
|
-
end
|
1110
|
-
|
1111
|
-
def test_nested_fields_with_index_on_both
|
1112
|
-
form_with(model: @post, index: 1) do |f|
|
1113
|
-
concat f.fields(:comment, model: @post, index: 5) { |c|
|
1114
|
-
concat c.text_field(:title)
|
1115
|
-
}
|
1116
|
-
end
|
1117
|
-
|
1118
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1119
|
-
"<input name='post[1][comment][5][title]' type='text' value='Hello World' id='post_1_comment_5_title' />"
|
1120
|
-
end
|
1121
|
-
|
1122
|
-
assert_dom_equal expected, output_buffer
|
1123
|
-
end
|
1124
|
-
|
1125
|
-
def test_nested_fields_with_auto_index
|
1126
|
-
form_with(model: @post, scope: "post[]") do |f|
|
1127
|
-
concat f.fields(:comment, model: @post) { |c|
|
1128
|
-
concat c.text_field(:title)
|
1129
|
-
}
|
1130
|
-
end
|
1131
|
-
|
1132
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1133
|
-
"<input name='post[123][comment][title]' type='text' value='Hello World' id='post_123_comment_title' />"
|
1134
|
-
end
|
1135
|
-
|
1136
|
-
assert_dom_equal expected, output_buffer
|
1137
|
-
end
|
1138
|
-
|
1139
|
-
def test_nested_fields_with_index_radio_button
|
1140
|
-
form_with(model: @post) do |f|
|
1141
|
-
concat f.fields(:comment, model: @post, index: 5) { |c|
|
1142
|
-
concat c.radio_button(:title, "hello")
|
1143
|
-
}
|
1144
|
-
end
|
1145
|
-
|
1146
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1147
|
-
"<input name='post[comment][5][title]' type='radio' value='hello' id='post_comment_5_title_hello' />"
|
1148
|
-
end
|
1149
|
-
|
1150
|
-
assert_dom_equal expected, output_buffer
|
1151
|
-
end
|
1152
|
-
|
1153
|
-
def test_nested_fields_with_auto_index_on_both
|
1154
|
-
form_with(model: @post, scope: "post[]") do |f|
|
1155
|
-
concat f.fields("comment[]", model: @post) { |c|
|
1156
|
-
concat c.text_field(:title)
|
1157
|
-
}
|
1158
|
-
end
|
1159
|
-
|
1160
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1161
|
-
"<input name='post[123][comment][123][title]' type='text' value='Hello World' id='post_123_comment_123_title' />"
|
1162
|
-
end
|
1163
|
-
|
1164
|
-
assert_dom_equal expected, output_buffer
|
1165
|
-
end
|
1166
|
-
|
1167
|
-
def test_nested_fields_with_index_and_auto_index
|
1168
|
-
output_buffer = form_with(model: @post, scope: "post[]") do |f|
|
1169
|
-
concat f.fields(:comment, model: @post, index: 5) { |c|
|
1170
|
-
concat c.text_field(:title)
|
1171
|
-
}
|
1172
|
-
end
|
1173
|
-
|
1174
|
-
output_buffer << form_with(model: @post, index: 1) do |f|
|
1175
|
-
concat f.fields("comment[]", model: @post) { |c|
|
1176
|
-
concat c.text_field(:title)
|
1177
|
-
}
|
1178
|
-
end
|
1179
|
-
|
1180
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1181
|
-
"<input name='post[123][comment][5][title]' type='text' value='Hello World' id='post_123_comment_5_title' />"
|
1182
|
-
end + whole_form("/posts/123", method: "patch") do
|
1183
|
-
"<input name='post[1][comment][123][title]' type='text' value='Hello World' id='post_1_comment_123_title' />"
|
1184
|
-
end
|
1185
|
-
|
1186
|
-
assert_dom_equal expected, output_buffer
|
1187
|
-
end
|
1188
|
-
|
1189
|
-
def test_nested_fields_with_a_new_record_on_a_nested_attributes_one_to_one_association
|
1190
|
-
@post.author = Author.new
|
1191
|
-
|
1192
|
-
form_with(model: @post) do |f|
|
1193
|
-
concat f.text_field(:title)
|
1194
|
-
concat f.fields(:author) { |af|
|
1195
|
-
concat af.text_field(:name)
|
1196
|
-
}
|
1197
|
-
end
|
1198
|
-
|
1199
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1200
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1201
|
-
'<input name="post[author_attributes][name]" type="text" value="new author" id="post_author_attributes_name" />'
|
1202
|
-
end
|
1203
|
-
|
1204
|
-
assert_dom_equal expected, output_buffer
|
1205
|
-
end
|
1206
|
-
|
1207
|
-
def test_nested_fields_with_explicitly_passed_object_on_a_nested_attributes_one_to_one_association
|
1208
|
-
form_with(model: @post) do |f|
|
1209
|
-
f.fields(:author, model: Author.new(123)) do |af|
|
1210
|
-
assert_not_nil af.object
|
1211
|
-
assert_equal 123, af.object.id
|
1212
|
-
end
|
1213
|
-
end
|
1214
|
-
end
|
1215
|
-
|
1216
|
-
def test_nested_fields_with_an_existing_record_on_a_nested_attributes_one_to_one_association
|
1217
|
-
@post.author = Author.new(321)
|
1218
|
-
|
1219
|
-
form_with(model: @post) do |f|
|
1220
|
-
concat f.text_field(:title)
|
1221
|
-
concat f.fields(:author) { |af|
|
1222
|
-
concat af.text_field(:name)
|
1223
|
-
}
|
1224
|
-
end
|
1225
|
-
|
1226
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1227
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1228
|
-
'<input name="post[author_attributes][name]" type="text" value="author #321" id="post_author_attributes_name" />' \
|
1229
|
-
'<input name="post[author_attributes][id]" type="hidden" value="321" id="post_author_attributes_id" />'
|
1230
|
-
end
|
1231
|
-
|
1232
|
-
assert_dom_equal expected, output_buffer
|
1233
|
-
end
|
1234
|
-
|
1235
|
-
def test_nested_fields_with_an_existing_record_on_a_nested_attributes_one_to_one_association_using_erb_and_inline_block
|
1236
|
-
@post.author = Author.new(321)
|
1237
|
-
|
1238
|
-
form_with(model: @post) do |f|
|
1239
|
-
concat f.text_field(:title)
|
1240
|
-
concat f.fields(:author) { |af|
|
1241
|
-
af.text_field(:name)
|
1242
|
-
}
|
1243
|
-
end
|
1244
|
-
|
1245
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1246
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1247
|
-
'<input name="post[author_attributes][name]" type="text" value="author #321" id="post_author_attributes_name" />' \
|
1248
|
-
'<input name="post[author_attributes][id]" type="hidden" value="321" id="post_author_attributes_id" />'
|
1249
|
-
end
|
1250
|
-
|
1251
|
-
assert_dom_equal expected, output_buffer
|
1252
|
-
end
|
1253
|
-
|
1254
|
-
def test_nested_fields_with_an_existing_record_on_a_nested_attributes_one_to_one_association_with_disabled_hidden_id
|
1255
|
-
@post.author = Author.new(321)
|
1256
|
-
|
1257
|
-
form_with(model: @post) do |f|
|
1258
|
-
concat f.text_field(:title)
|
1259
|
-
concat f.fields(:author, skip_id: true) { |af|
|
1260
|
-
af.text_field(:name)
|
1261
|
-
}
|
1262
|
-
end
|
1263
|
-
|
1264
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1265
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1266
|
-
'<input name="post[author_attributes][name]" type="text" value="author #321" id="post_author_attributes_name" />'
|
1267
|
-
end
|
1268
|
-
|
1269
|
-
assert_dom_equal expected, output_buffer
|
1270
|
-
end
|
1271
|
-
|
1272
|
-
def test_nested_fields_with_an_existing_record_on_a_nested_attributes_one_to_one_association_with_disabled_hidden_id_inherited
|
1273
|
-
@post.author = Author.new(321)
|
1274
|
-
|
1275
|
-
form_with(model: @post, skip_id: true) do |f|
|
1276
|
-
concat f.text_field(:title)
|
1277
|
-
concat f.fields(:author) { |af|
|
1278
|
-
af.text_field(:name)
|
1279
|
-
}
|
1280
|
-
end
|
1281
|
-
|
1282
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1283
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1284
|
-
'<input name="post[author_attributes][name]" type="text" value="author #321" id="post_author_attributes_name" />'
|
1285
|
-
end
|
1286
|
-
|
1287
|
-
assert_dom_equal expected, output_buffer
|
1288
|
-
end
|
1289
|
-
|
1290
|
-
def test_nested_fields_with_an_existing_record_on_a_nested_attributes_one_to_one_association_with_disabled_hidden_id_override
|
1291
|
-
@post.author = Author.new(321)
|
1292
|
-
|
1293
|
-
form_with(model: @post, skip_id: true) do |f|
|
1294
|
-
concat f.text_field(:title)
|
1295
|
-
concat f.fields(:author, skip_id: false) { |af|
|
1296
|
-
af.text_field(:name)
|
1297
|
-
}
|
1298
|
-
end
|
1299
|
-
|
1300
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1301
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1302
|
-
'<input name="post[author_attributes][name]" type="text" value="author #321" id="post_author_attributes_name" />' \
|
1303
|
-
'<input name="post[author_attributes][id]" type="hidden" value="321" id="post_author_attributes_id" />'
|
1304
|
-
end
|
1305
|
-
|
1306
|
-
assert_dom_equal expected, output_buffer
|
1307
|
-
end
|
1308
|
-
|
1309
|
-
def test_nested_fields_with_existing_records_on_a_nested_attributes_one_to_one_association_with_explicit_hidden_field_placement
|
1310
|
-
@post.author = Author.new(321)
|
1311
|
-
|
1312
|
-
form_with(model: @post) do |f|
|
1313
|
-
concat f.text_field(:title)
|
1314
|
-
concat f.fields(:author) { |af|
|
1315
|
-
concat af.hidden_field(:id)
|
1316
|
-
concat af.text_field(:name)
|
1317
|
-
}
|
1318
|
-
end
|
1319
|
-
|
1320
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1321
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1322
|
-
'<input name="post[author_attributes][id]" type="hidden" value="321" id="post_author_attributes_id" />' \
|
1323
|
-
'<input name="post[author_attributes][name]" type="text" value="author #321" id="post_author_attributes_name" />'
|
1324
|
-
end
|
1325
|
-
|
1326
|
-
assert_dom_equal expected, output_buffer
|
1327
|
-
end
|
1328
|
-
|
1329
|
-
def test_nested_fields_with_existing_records_on_a_nested_attributes_collection_association
|
1330
|
-
@post.comments = Array.new(2) { |id| Comment.new(id + 1) }
|
1331
|
-
|
1332
|
-
form_with(model: @post) do |f|
|
1333
|
-
concat f.text_field(:title)
|
1334
|
-
@post.comments.each do |comment|
|
1335
|
-
concat f.fields(:comments, model: comment) { |cf|
|
1336
|
-
concat cf.text_field(:name)
|
1337
|
-
}
|
1338
|
-
end
|
1339
|
-
end
|
1340
|
-
|
1341
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1342
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1343
|
-
'<input name="post[comments_attributes][0][name]" type="text" value="comment #1" id="post_comments_attributes_0_name" />' \
|
1344
|
-
'<input name="post[comments_attributes][0][id]" type="hidden" value="1" id="post_comments_attributes_0_id" />' \
|
1345
|
-
'<input name="post[comments_attributes][1][name]" type="text" value="comment #2" id="post_comments_attributes_1_name" />' \
|
1346
|
-
'<input name="post[comments_attributes][1][id]" type="hidden" value="2" id="post_comments_attributes_1_id" />'
|
1347
|
-
end
|
1348
|
-
|
1349
|
-
assert_dom_equal expected, output_buffer
|
1350
|
-
end
|
1351
|
-
|
1352
|
-
def test_nested_fields_with_existing_records_on_a_nested_attributes_collection_association_with_disabled_hidden_id
|
1353
|
-
@post.comments = Array.new(2) { |id| Comment.new(id + 1) }
|
1354
|
-
@post.author = Author.new(321)
|
1355
|
-
|
1356
|
-
form_with(model: @post) do |f|
|
1357
|
-
concat f.text_field(:title)
|
1358
|
-
concat f.fields(:author) { |af|
|
1359
|
-
concat af.text_field(:name)
|
1360
|
-
}
|
1361
|
-
@post.comments.each do |comment|
|
1362
|
-
concat f.fields(:comments, model: comment, skip_id: true) { |cf|
|
1363
|
-
concat cf.text_field(:name)
|
1364
|
-
}
|
1365
|
-
end
|
1366
|
-
end
|
1367
|
-
|
1368
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1369
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1370
|
-
'<input name="post[author_attributes][name]" type="text" value="author #321" id="post_author_attributes_name" />' \
|
1371
|
-
'<input name="post[author_attributes][id]" type="hidden" value="321" id="post_author_attributes_id" />' \
|
1372
|
-
'<input name="post[comments_attributes][0][name]" type="text" value="comment #1" id="post_comments_attributes_0_name" />' \
|
1373
|
-
'<input name="post[comments_attributes][1][name]" type="text" value="comment #2" id="post_comments_attributes_1_name" />'
|
1374
|
-
end
|
1375
|
-
|
1376
|
-
assert_dom_equal expected, output_buffer
|
1377
|
-
end
|
1378
|
-
|
1379
|
-
def test_nested_fields_with_existing_records_on_a_nested_attributes_collection_association_with_disabled_hidden_id_inherited
|
1380
|
-
@post.comments = Array.new(2) { |id| Comment.new(id + 1) }
|
1381
|
-
@post.author = Author.new(321)
|
1382
|
-
|
1383
|
-
form_with(model: @post, skip_id: true) do |f|
|
1384
|
-
concat f.text_field(:title)
|
1385
|
-
concat f.fields(:author) { |af|
|
1386
|
-
concat af.text_field(:name)
|
1387
|
-
}
|
1388
|
-
@post.comments.each do |comment|
|
1389
|
-
concat f.fields(:comments, model: comment) { |cf|
|
1390
|
-
concat cf.text_field(:name)
|
1391
|
-
}
|
1392
|
-
end
|
1393
|
-
end
|
1394
|
-
|
1395
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1396
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1397
|
-
'<input name="post[author_attributes][name]" type="text" value="author #321" id="post_author_attributes_name" />' \
|
1398
|
-
'<input name="post[comments_attributes][0][name]" type="text" value="comment #1" id="post_comments_attributes_0_name" />' \
|
1399
|
-
'<input name="post[comments_attributes][1][name]" type="text" value="comment #2" id="post_comments_attributes_1_name" />'
|
1400
|
-
end
|
1401
|
-
|
1402
|
-
assert_dom_equal expected, output_buffer
|
1403
|
-
end
|
1404
|
-
|
1405
|
-
def test_nested_fields_with_existing_records_on_a_nested_attributes_collection_association_with_disabled_hidden_id_override
|
1406
|
-
@post.comments = Array.new(2) { |id| Comment.new(id + 1) }
|
1407
|
-
@post.author = Author.new(321)
|
1408
|
-
|
1409
|
-
form_with(model: @post, skip_id: true) do |f|
|
1410
|
-
concat f.text_field(:title)
|
1411
|
-
concat f.fields(:author, skip_id: false) { |af|
|
1412
|
-
concat af.text_field(:name)
|
1413
|
-
}
|
1414
|
-
@post.comments.each do |comment|
|
1415
|
-
concat f.fields(:comments, model: comment) { |cf|
|
1416
|
-
concat cf.text_field(:name)
|
1417
|
-
}
|
1418
|
-
end
|
1419
|
-
end
|
1420
|
-
|
1421
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1422
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1423
|
-
'<input name="post[author_attributes][name]" type="text" value="author #321" id="post_author_attributes_name" />' \
|
1424
|
-
'<input name="post[author_attributes][id]" type="hidden" value="321" id="post_author_attributes_id" />' \
|
1425
|
-
'<input name="post[comments_attributes][0][name]" type="text" value="comment #1" id="post_comments_attributes_0_name" />' \
|
1426
|
-
'<input name="post[comments_attributes][1][name]" type="text" value="comment #2" id="post_comments_attributes_1_name" />'
|
1427
|
-
end
|
1428
|
-
|
1429
|
-
assert_dom_equal expected, output_buffer
|
1430
|
-
end
|
1431
|
-
|
1432
|
-
def test_nested_fields_with_existing_records_on_a_nested_attributes_collection_association_using_erb_and_inline_block
|
1433
|
-
@post.comments = Array.new(2) { |id| Comment.new(id + 1) }
|
1434
|
-
|
1435
|
-
form_with(model: @post) do |f|
|
1436
|
-
concat f.text_field(:title)
|
1437
|
-
@post.comments.each do |comment|
|
1438
|
-
concat f.fields(:comments, model: comment) { |cf|
|
1439
|
-
cf.text_field(:name)
|
1440
|
-
}
|
1441
|
-
end
|
1442
|
-
end
|
1443
|
-
|
1444
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1445
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1446
|
-
'<input name="post[comments_attributes][0][name]" type="text" value="comment #1" id="post_comments_attributes_0_name" />' \
|
1447
|
-
'<input name="post[comments_attributes][0][id]" type="hidden" value="1" id="post_comments_attributes_0_id" />' \
|
1448
|
-
'<input name="post[comments_attributes][1][name]" type="text" value="comment #2" id="post_comments_attributes_1_name" />' \
|
1449
|
-
'<input name="post[comments_attributes][1][id]" type="hidden" value="2" id="post_comments_attributes_1_id" />'
|
1450
|
-
end
|
1451
|
-
|
1452
|
-
assert_dom_equal expected, output_buffer
|
1453
|
-
end
|
1454
|
-
|
1455
|
-
def test_nested_fields_with_existing_records_on_a_nested_attributes_collection_association_with_explicit_hidden_field_placement
|
1456
|
-
@post.comments = Array.new(2) { |id| Comment.new(id + 1) }
|
1457
|
-
|
1458
|
-
form_with(model: @post) do |f|
|
1459
|
-
concat f.text_field(:title)
|
1460
|
-
@post.comments.each do |comment|
|
1461
|
-
concat f.fields(:comments, model: comment) { |cf|
|
1462
|
-
concat cf.hidden_field(:id)
|
1463
|
-
concat cf.text_field(:name)
|
1464
|
-
}
|
1465
|
-
end
|
1466
|
-
end
|
1467
|
-
|
1468
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1469
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1470
|
-
'<input name="post[comments_attributes][0][id]" type="hidden" value="1" id="post_comments_attributes_0_id" />' \
|
1471
|
-
'<input name="post[comments_attributes][0][name]" type="text" value="comment #1" id="post_comments_attributes_0_name" />' \
|
1472
|
-
'<input name="post[comments_attributes][1][id]" type="hidden" value="2" id="post_comments_attributes_1_id" />' \
|
1473
|
-
'<input name="post[comments_attributes][1][name]" type="text" value="comment #2" id="post_comments_attributes_1_name" />'
|
1474
|
-
end
|
1475
|
-
|
1476
|
-
assert_dom_equal expected, output_buffer
|
1477
|
-
end
|
1478
|
-
|
1479
|
-
def test_nested_fields_with_new_records_on_a_nested_attributes_collection_association
|
1480
|
-
@post.comments = [Comment.new, Comment.new]
|
1481
|
-
|
1482
|
-
form_with(model: @post) do |f|
|
1483
|
-
concat f.text_field(:title)
|
1484
|
-
@post.comments.each do |comment|
|
1485
|
-
concat f.fields(:comments, model: comment) { |cf|
|
1486
|
-
concat cf.text_field(:name)
|
1487
|
-
}
|
1488
|
-
end
|
1489
|
-
end
|
1490
|
-
|
1491
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1492
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1493
|
-
'<input name="post[comments_attributes][0][name]" type="text" value="new comment" id="post_comments_attributes_0_name" />' \
|
1494
|
-
'<input name="post[comments_attributes][1][name]" type="text" value="new comment" id="post_comments_attributes_1_name" />'
|
1495
|
-
end
|
1496
|
-
|
1497
|
-
assert_dom_equal expected, output_buffer
|
1498
|
-
end
|
1499
|
-
|
1500
|
-
def test_nested_fields_with_existing_and_new_records_on_a_nested_attributes_collection_association
|
1501
|
-
@post.comments = [Comment.new(321), Comment.new]
|
1502
|
-
|
1503
|
-
form_with(model: @post) do |f|
|
1504
|
-
concat f.text_field(:title)
|
1505
|
-
@post.comments.each do |comment|
|
1506
|
-
concat f.fields(:comments, model: comment) { |cf|
|
1507
|
-
concat cf.text_field(:name)
|
1508
|
-
}
|
1509
|
-
end
|
1510
|
-
end
|
1511
|
-
|
1512
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1513
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1514
|
-
'<input name="post[comments_attributes][0][name]" type="text" value="comment #321" id="post_comments_attributes_0_name" />' \
|
1515
|
-
'<input name="post[comments_attributes][0][id]" type="hidden" value="321" id="post_comments_attributes_0_id"/>' \
|
1516
|
-
'<input name="post[comments_attributes][1][name]" type="text" value="new comment" id="post_comments_attributes_1_name" />'
|
1517
|
-
end
|
1518
|
-
|
1519
|
-
assert_dom_equal expected, output_buffer
|
1520
|
-
end
|
1521
|
-
|
1522
|
-
def test_nested_fields_with_an_empty_supplied_attributes_collection
|
1523
|
-
form_with(model: @post) do |f|
|
1524
|
-
concat f.text_field(:title)
|
1525
|
-
f.fields(:comments, model: []) do |cf|
|
1526
|
-
concat cf.text_field(:name)
|
1527
|
-
end
|
1528
|
-
end
|
1529
|
-
|
1530
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1531
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />'
|
1532
|
-
end
|
1533
|
-
|
1534
|
-
assert_dom_equal expected, output_buffer
|
1535
|
-
end
|
1536
|
-
|
1537
|
-
def test_nested_fields_with_existing_records_on_a_supplied_nested_attributes_collection
|
1538
|
-
@post.comments = Array.new(2) { |id| Comment.new(id + 1) }
|
1539
|
-
|
1540
|
-
form_with(model: @post) do |f|
|
1541
|
-
concat f.text_field(:title)
|
1542
|
-
concat f.fields(:comments, model: @post.comments) { |cf|
|
1543
|
-
concat cf.text_field(:name)
|
1544
|
-
}
|
1545
|
-
end
|
1546
|
-
|
1547
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1548
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1549
|
-
'<input name="post[comments_attributes][0][name]" type="text" value="comment #1" id="post_comments_attributes_0_name" />' \
|
1550
|
-
'<input name="post[comments_attributes][0][id]" type="hidden" value="1" id="post_comments_attributes_0_id" />' \
|
1551
|
-
'<input name="post[comments_attributes][1][name]" type="text" value="comment #2" id="post_comments_attributes_1_name" />' \
|
1552
|
-
'<input name="post[comments_attributes][1][id]" type="hidden" value="2" id="post_comments_attributes_1_id" />'
|
1553
|
-
end
|
1554
|
-
|
1555
|
-
assert_dom_equal expected, output_buffer
|
1556
|
-
end
|
1557
|
-
|
1558
|
-
def test_nested_fields_arel_like
|
1559
|
-
@post.comments = ArelLike.new
|
1560
|
-
|
1561
|
-
form_with(model: @post) do |f|
|
1562
|
-
concat f.text_field(:title)
|
1563
|
-
concat f.fields(:comments, model: @post.comments) { |cf|
|
1564
|
-
concat cf.text_field(:name)
|
1565
|
-
}
|
1566
|
-
end
|
1567
|
-
|
1568
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1569
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1570
|
-
'<input name="post[comments_attributes][0][name]" type="text" value="comment #1" id="post_comments_attributes_0_name" />' \
|
1571
|
-
'<input name="post[comments_attributes][0][id]" type="hidden" value="1" id="post_comments_attributes_0_id" />' \
|
1572
|
-
'<input name="post[comments_attributes][1][name]" type="text" value="comment #2" id="post_comments_attributes_1_name" />' \
|
1573
|
-
'<input name="post[comments_attributes][1][id]" type="hidden" value="2" id="post_comments_attributes_1_id" />'
|
1574
|
-
end
|
1575
|
-
|
1576
|
-
assert_dom_equal expected, output_buffer
|
1577
|
-
end
|
1578
|
-
|
1579
|
-
def test_nested_fields_label_translation_with_more_than_10_records
|
1580
|
-
@post.comments = Array.new(11) { |id| Comment.new(id + 1) }
|
1581
|
-
|
1582
|
-
params = 11.times.map { ["post.comments.body", default: [:"comment.body", ""], scope: "helpers.label"] }
|
1583
|
-
assert_called_with(I18n, :t, params, returns: "Write body here") do
|
1584
|
-
form_with(model: @post) do |f|
|
1585
|
-
f.fields(:comments) do |cf|
|
1586
|
-
concat cf.label(:body)
|
1587
|
-
end
|
1588
|
-
end
|
1589
|
-
end
|
1590
|
-
end
|
1591
|
-
|
1592
|
-
def test_nested_fields_with_existing_records_on_a_supplied_nested_attributes_collection_different_from_record_one
|
1593
|
-
comments = Array.new(2) { |id| Comment.new(id + 1) }
|
1594
|
-
@post.comments = []
|
1595
|
-
|
1596
|
-
form_with(model: @post) do |f|
|
1597
|
-
concat f.text_field(:title)
|
1598
|
-
concat f.fields(:comments, model: comments) { |cf|
|
1599
|
-
concat cf.text_field(:name)
|
1600
|
-
}
|
1601
|
-
end
|
1602
|
-
|
1603
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1604
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1605
|
-
'<input name="post[comments_attributes][0][name]" type="text" value="comment #1" id="post_comments_attributes_0_name" />' \
|
1606
|
-
'<input name="post[comments_attributes][0][id]" type="hidden" value="1" id="post_comments_attributes_0_id" />' \
|
1607
|
-
'<input name="post[comments_attributes][1][name]" type="text" value="comment #2" id="post_comments_attributes_1_name" />' \
|
1608
|
-
'<input name="post[comments_attributes][1][id]" type="hidden" value="2" id="post_comments_attributes_1_id" />'
|
1609
|
-
end
|
1610
|
-
|
1611
|
-
assert_dom_equal expected, output_buffer
|
1612
|
-
end
|
1613
|
-
|
1614
|
-
def test_nested_fields_on_a_nested_attributes_collection_association_yields_only_builder
|
1615
|
-
@post.comments = [Comment.new(321), Comment.new]
|
1616
|
-
yielded_comments = []
|
1617
|
-
|
1618
|
-
form_with(model: @post) do |f|
|
1619
|
-
concat f.text_field(:title)
|
1620
|
-
concat f.fields(:comments) { |cf|
|
1621
|
-
concat cf.text_field(:name)
|
1622
|
-
yielded_comments << cf.object
|
1623
|
-
}
|
1624
|
-
end
|
1625
|
-
|
1626
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1627
|
-
'<input name="post[title]" type="text" value="Hello World" id="post_title" />' \
|
1628
|
-
'<input name="post[comments_attributes][0][name]" type="text" value="comment #321" id="post_comments_attributes_0_name" />' \
|
1629
|
-
'<input name="post[comments_attributes][0][id]" type="hidden" value="321" id="post_comments_attributes_0_id" />' \
|
1630
|
-
'<input name="post[comments_attributes][1][name]" type="text" value="new comment" id="post_comments_attributes_1_name" />'
|
1631
|
-
end
|
1632
|
-
|
1633
|
-
assert_dom_equal expected, output_buffer
|
1634
|
-
assert_equal yielded_comments, @post.comments
|
1635
|
-
end
|
1636
|
-
|
1637
|
-
def test_nested_fields_with_child_index_option_override_on_a_nested_attributes_collection_association
|
1638
|
-
@post.comments = []
|
1639
|
-
|
1640
|
-
form_with(model: @post) do |f|
|
1641
|
-
concat f.fields(:comments, model: Comment.new(321), child_index: "abc") { |cf|
|
1642
|
-
concat cf.text_field(:name)
|
1643
|
-
}
|
1644
|
-
end
|
1645
|
-
|
1646
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1647
|
-
'<input name="post[comments_attributes][abc][name]" type="text" value="comment #321" id="post_comments_attributes_abc_name" />' \
|
1648
|
-
'<input name="post[comments_attributes][abc][id]" type="hidden" value="321" id="post_comments_attributes_abc_id" />'
|
1649
|
-
end
|
1650
|
-
|
1651
|
-
assert_dom_equal expected, output_buffer
|
1652
|
-
end
|
1653
|
-
|
1654
|
-
def test_nested_fields_with_child_index_as_lambda_option_override_on_a_nested_attributes_collection_association
|
1655
|
-
@post.comments = []
|
1656
|
-
|
1657
|
-
form_with(model: @post) do |f|
|
1658
|
-
concat f.fields(:comments, model: Comment.new(321), child_index: -> { "abc" }) { |cf|
|
1659
|
-
concat cf.text_field(:name)
|
1660
|
-
}
|
1661
|
-
end
|
1662
|
-
|
1663
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1664
|
-
'<input name="post[comments_attributes][abc][name]" type="text" value="comment #321" id="post_comments_attributes_abc_name" />' \
|
1665
|
-
'<input name="post[comments_attributes][abc][id]" type="hidden" value="321" id="post_comments_attributes_abc_id" />'
|
1666
|
-
end
|
1667
|
-
|
1668
|
-
assert_dom_equal expected, output_buffer
|
1669
|
-
end
|
1670
|
-
|
1671
|
-
class FakeAssociationProxy
|
1672
|
-
def to_ary
|
1673
|
-
[1, 2, 3]
|
1674
|
-
end
|
1675
|
-
end
|
1676
|
-
|
1677
|
-
def test_nested_fields_with_child_index_option_override_on_a_nested_attributes_collection_association_with_proxy
|
1678
|
-
@post.comments = FakeAssociationProxy.new
|
1679
|
-
|
1680
|
-
form_with(model: @post) do |f|
|
1681
|
-
concat f.fields(:comments, model: Comment.new(321), child_index: "abc") { |cf|
|
1682
|
-
concat cf.text_field(:name)
|
1683
|
-
}
|
1684
|
-
end
|
1685
|
-
|
1686
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1687
|
-
'<input name="post[comments_attributes][abc][name]" type="text" value="comment #321" id="post_comments_attributes_abc_name" />' \
|
1688
|
-
'<input name="post[comments_attributes][abc][id]" type="hidden" value="321" id="post_comments_attributes_abc_id" />'
|
1689
|
-
end
|
1690
|
-
|
1691
|
-
assert_dom_equal expected, output_buffer
|
1692
|
-
end
|
1693
|
-
|
1694
|
-
def test_nested_fields_index_method_with_existing_records_on_a_nested_attributes_collection_association
|
1695
|
-
@post.comments = Array.new(2) { |id| Comment.new(id + 1) }
|
1696
|
-
|
1697
|
-
form_with(model: @post) do |f|
|
1698
|
-
expected = 0
|
1699
|
-
@post.comments.each do |comment|
|
1700
|
-
f.fields(:comments, model: comment) { |cf|
|
1701
|
-
assert_equal expected, cf.index
|
1702
|
-
expected += 1
|
1703
|
-
}
|
1704
|
-
end
|
1705
|
-
end
|
1706
|
-
end
|
1707
|
-
|
1708
|
-
def test_nested_fields_index_method_with_existing_and_new_records_on_a_nested_attributes_collection_association
|
1709
|
-
@post.comments = [Comment.new(321), Comment.new]
|
1710
|
-
|
1711
|
-
form_with(model: @post) do |f|
|
1712
|
-
expected = 0
|
1713
|
-
@post.comments.each do |comment|
|
1714
|
-
f.fields(:comments, model: comment) { |cf|
|
1715
|
-
assert_equal expected, cf.index
|
1716
|
-
expected += 1
|
1717
|
-
}
|
1718
|
-
end
|
1719
|
-
end
|
1720
|
-
end
|
1721
|
-
|
1722
|
-
def test_nested_fields_index_method_with_existing_records_on_a_supplied_nested_attributes_collection
|
1723
|
-
@post.comments = Array.new(2) { |id| Comment.new(id + 1) }
|
1724
|
-
|
1725
|
-
form_with(model: @post) do |f|
|
1726
|
-
expected = 0
|
1727
|
-
f.fields(:comments, model: @post.comments) { |cf|
|
1728
|
-
assert_equal expected, cf.index
|
1729
|
-
expected += 1
|
1730
|
-
}
|
1731
|
-
end
|
1732
|
-
end
|
1733
|
-
|
1734
|
-
def test_nested_fields_index_method_with_child_index_option_override_on_a_nested_attributes_collection_association
|
1735
|
-
@post.comments = []
|
1736
|
-
|
1737
|
-
form_with(model: @post) do |f|
|
1738
|
-
f.fields(:comments, model: Comment.new(321), child_index: "abc") { |cf|
|
1739
|
-
assert_equal "abc", cf.index
|
1740
|
-
}
|
1741
|
-
end
|
1742
|
-
end
|
1743
|
-
|
1744
|
-
def test_nested_fields_uses_unique_indices_for_different_collection_associations
|
1745
|
-
@post.comments = [Comment.new(321)]
|
1746
|
-
@post.tags = [Tag.new(123), Tag.new(456)]
|
1747
|
-
@post.comments[0].relevances = []
|
1748
|
-
@post.tags[0].relevances = []
|
1749
|
-
@post.tags[1].relevances = []
|
1750
|
-
|
1751
|
-
form_with(model: @post) do |f|
|
1752
|
-
concat f.fields(:comments, model: @post.comments[0]) { |cf|
|
1753
|
-
concat cf.text_field(:name)
|
1754
|
-
concat cf.fields(:relevances, model: CommentRelevance.new(314)) { |crf|
|
1755
|
-
concat crf.text_field(:value)
|
1756
|
-
}
|
1757
|
-
}
|
1758
|
-
concat f.fields(:tags, model: @post.tags[0]) { |tf|
|
1759
|
-
concat tf.text_field(:value)
|
1760
|
-
concat tf.fields(:relevances, model: TagRelevance.new(3141)) { |trf|
|
1761
|
-
concat trf.text_field(:value)
|
1762
|
-
}
|
1763
|
-
}
|
1764
|
-
concat f.fields("tags", model: @post.tags[1]) { |tf|
|
1765
|
-
concat tf.text_field(:value)
|
1766
|
-
concat tf.fields(:relevances, model: TagRelevance.new(31415)) { |trf|
|
1767
|
-
concat trf.text_field(:value)
|
1768
|
-
}
|
1769
|
-
}
|
1770
|
-
end
|
1771
|
-
|
1772
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1773
|
-
'<input name="post[comments_attributes][0][name]" type="text" value="comment #321" id="post_comments_attributes_0_name" />' \
|
1774
|
-
'<input name="post[comments_attributes][0][relevances_attributes][0][value]" type="text" value="commentrelevance #314" id="post_comments_attributes_0_relevances_attributes_0_value" />' \
|
1775
|
-
'<input name="post[comments_attributes][0][relevances_attributes][0][id]" type="hidden" value="314" id="post_comments_attributes_0_relevances_attributes_0_id"/>' \
|
1776
|
-
'<input name="post[comments_attributes][0][id]" type="hidden" value="321" id="post_comments_attributes_0_id"/>' \
|
1777
|
-
'<input name="post[tags_attributes][0][value]" type="text" value="tag #123" id="post_tags_attributes_0_value"/>' \
|
1778
|
-
'<input name="post[tags_attributes][0][relevances_attributes][0][value]" type="text" value="tagrelevance #3141" id="post_tags_attributes_0_relevances_attributes_0_value"/>' \
|
1779
|
-
'<input name="post[tags_attributes][0][relevances_attributes][0][id]" type="hidden" value="3141" id="post_tags_attributes_0_relevances_attributes_0_id"/>' \
|
1780
|
-
'<input name="post[tags_attributes][0][id]" type="hidden" value="123" id="post_tags_attributes_0_id"/>' \
|
1781
|
-
'<input name="post[tags_attributes][1][value]" type="text" value="tag #456" id="post_tags_attributes_1_value"/>' \
|
1782
|
-
'<input name="post[tags_attributes][1][relevances_attributes][0][value]" type="text" value="tagrelevance #31415" id="post_tags_attributes_1_relevances_attributes_0_value"/>' \
|
1783
|
-
'<input name="post[tags_attributes][1][relevances_attributes][0][id]" type="hidden" value="31415" id="post_tags_attributes_1_relevances_attributes_0_id"/>' \
|
1784
|
-
'<input name="post[tags_attributes][1][id]" type="hidden" value="456" id="post_tags_attributes_1_id"/>'
|
1785
|
-
end
|
1786
|
-
|
1787
|
-
assert_dom_equal expected, output_buffer
|
1788
|
-
end
|
1789
|
-
|
1790
|
-
def test_nested_fields_with_hash_like_model
|
1791
|
-
@author = HashBackedAuthor.new
|
1792
|
-
|
1793
|
-
form_with(model: @post) do |f|
|
1794
|
-
concat f.fields(:author, model: @author) { |af|
|
1795
|
-
concat af.text_field(:name)
|
1796
|
-
}
|
1797
|
-
end
|
1798
|
-
|
1799
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1800
|
-
'<input name="post[author_attributes][name]" type="text" value="hash backed author" id="post_author_attributes_name" />'
|
1801
|
-
end
|
1802
|
-
|
1803
|
-
assert_dom_equal expected, output_buffer
|
1804
|
-
end
|
1805
|
-
|
1806
|
-
def test_fields
|
1807
|
-
output_buffer = fields(:post, model: @post) do |f|
|
1808
|
-
concat f.text_field(:title)
|
1809
|
-
concat f.text_area(:body)
|
1810
|
-
concat f.check_box(:secret)
|
1811
|
-
end
|
1812
|
-
|
1813
|
-
expected =
|
1814
|
-
"<input name='post[title]' type='text' value='Hello World' id='post_title' />" \
|
1815
|
-
"<textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea>" \
|
1816
|
-
"<input name='post[secret]' type='hidden' value='0' />" \
|
1817
|
-
"<input name='post[secret]' checked='checked' type='checkbox' value='1' id='post_secret' />"
|
1818
|
-
|
1819
|
-
assert_dom_equal expected, output_buffer
|
1820
|
-
end
|
1821
|
-
|
1822
|
-
def test_fields_with_index
|
1823
|
-
output_buffer = fields("post[]", model: @post) do |f|
|
1824
|
-
concat f.text_field(:title)
|
1825
|
-
concat f.text_area(:body)
|
1826
|
-
concat f.check_box(:secret)
|
1827
|
-
end
|
1828
|
-
|
1829
|
-
expected =
|
1830
|
-
"<input name='post[123][title]' type='text' value='Hello World' id='post_123_title' />" \
|
1831
|
-
"<textarea name='post[123][body]' id='post_123_body'>\nBack to the hill and over it again!</textarea>" \
|
1832
|
-
"<input name='post[123][secret]' type='hidden' value='0' />" \
|
1833
|
-
"<input name='post[123][secret]' checked='checked' type='checkbox' value='1' id='post_123_secret' />"
|
1834
|
-
|
1835
|
-
assert_dom_equal expected, output_buffer
|
1836
|
-
end
|
1837
|
-
|
1838
|
-
def test_fields_with_nil_index_option_override
|
1839
|
-
output_buffer = fields("post[]", model: @post, index: nil) do |f|
|
1840
|
-
concat f.text_field(:title)
|
1841
|
-
concat f.text_area(:body)
|
1842
|
-
concat f.check_box(:secret)
|
1843
|
-
end
|
1844
|
-
|
1845
|
-
expected =
|
1846
|
-
"<input name='post[][title]' type='text' value='Hello World' id='post__title' />" \
|
1847
|
-
"<textarea name='post[][body]' id='post__body'>\nBack to the hill and over it again!</textarea>" \
|
1848
|
-
"<input name='post[][secret]' type='hidden' value='0' />" \
|
1849
|
-
"<input name='post[][secret]' checked='checked' type='checkbox' value='1' id='post__secret' />"
|
1850
|
-
|
1851
|
-
assert_dom_equal expected, output_buffer
|
1852
|
-
end
|
1853
|
-
|
1854
|
-
def test_fields_with_index_option_override
|
1855
|
-
output_buffer = fields("post[]", model: @post, index: "abc") do |f|
|
1856
|
-
concat f.text_field(:title)
|
1857
|
-
concat f.text_area(:body)
|
1858
|
-
concat f.check_box(:secret)
|
1859
|
-
end
|
1860
|
-
|
1861
|
-
expected =
|
1862
|
-
"<input name='post[abc][title]' type='text' value='Hello World' id='post_abc_title' />" \
|
1863
|
-
"<textarea name='post[abc][body]' id='post_abc_body'>\nBack to the hill and over it again!</textarea>" \
|
1864
|
-
"<input name='post[abc][secret]' type='hidden' value='0' />" \
|
1865
|
-
"<input name='post[abc][secret]' checked='checked' type='checkbox' value='1' id='post_abc_secret' />"
|
1866
|
-
|
1867
|
-
assert_dom_equal expected, output_buffer
|
1868
|
-
end
|
1869
|
-
|
1870
|
-
def test_fields_without_object
|
1871
|
-
output_buffer = fields(:post) do |f|
|
1872
|
-
concat f.text_field(:title)
|
1873
|
-
concat f.text_area(:body)
|
1874
|
-
concat f.check_box(:secret)
|
1875
|
-
end
|
1876
|
-
|
1877
|
-
expected =
|
1878
|
-
"<input name='post[title]' type='text' value='Hello World' id='post_title' />" \
|
1879
|
-
"<textarea name='post[body]' id='post_body' >\nBack to the hill and over it again!</textarea>" \
|
1880
|
-
"<input name='post[secret]' type='hidden' value='0' />" \
|
1881
|
-
"<input name='post[secret]' checked='checked' type='checkbox' value='1' id='post_secret' />"
|
1882
|
-
|
1883
|
-
assert_dom_equal expected, output_buffer
|
1884
|
-
end
|
1885
|
-
|
1886
|
-
def test_fields_with_only_object
|
1887
|
-
output_buffer = fields(model: @post) do |f|
|
1888
|
-
concat f.text_field(:title)
|
1889
|
-
concat f.text_area(:body)
|
1890
|
-
concat f.check_box(:secret)
|
1891
|
-
end
|
1892
|
-
|
1893
|
-
expected =
|
1894
|
-
"<input name='post[title]' type='text' value='Hello World' id='post_title' />" \
|
1895
|
-
"<textarea name='post[body]' id='post_body' >\nBack to the hill and over it again!</textarea>" \
|
1896
|
-
"<input name='post[secret]' type='hidden' value='0' />" \
|
1897
|
-
"<input name='post[secret]' checked='checked' type='checkbox' value='1' id='post_secret' />"
|
1898
|
-
|
1899
|
-
assert_dom_equal expected, output_buffer
|
1900
|
-
end
|
1901
|
-
|
1902
|
-
def test_fields_object_with_bracketed_name
|
1903
|
-
output_buffer = fields("author[post]", model: @post) do |f|
|
1904
|
-
concat f.label(:title)
|
1905
|
-
concat f.text_field(:title)
|
1906
|
-
end
|
1907
|
-
|
1908
|
-
assert_dom_equal "<label for=\"author_post_title\">Title</label>" \
|
1909
|
-
"<input name='author[post][title]' type='text' value='Hello World' id='author_post_title' id='author_post_1_title' />",
|
1910
|
-
output_buffer
|
1911
|
-
end
|
1912
|
-
|
1913
|
-
def test_fields_object_with_bracketed_name_and_index
|
1914
|
-
output_buffer = fields("author[post]", model: @post, index: 1) do |f|
|
1915
|
-
concat f.label(:title)
|
1916
|
-
concat f.text_field(:title)
|
1917
|
-
end
|
1918
|
-
|
1919
|
-
assert_dom_equal "<label for=\"author_post_1_title\">Title</label>" \
|
1920
|
-
"<input name='author[post][1][title]' type='text' value='Hello World' id='author_post_1_title' />",
|
1921
|
-
output_buffer
|
1922
|
-
end
|
1923
|
-
|
1924
|
-
def test_form_builder_does_not_have_form_with_method
|
1925
|
-
assert_not_includes ActionView::Helpers::FormBuilder.instance_methods, :form_with
|
1926
|
-
end
|
1927
|
-
|
1928
|
-
def test_form_with_and_fields
|
1929
|
-
form_with(model: @post, scope: :post, id: "create-post") do |post_form|
|
1930
|
-
concat post_form.text_field(:title)
|
1931
|
-
concat post_form.text_area(:body)
|
1932
|
-
|
1933
|
-
concat fields(:parent_post, model: @post) { |parent_fields|
|
1934
|
-
concat parent_fields.check_box(:secret)
|
1935
|
-
}
|
1936
|
-
end
|
1937
|
-
|
1938
|
-
expected = whole_form("/posts/123", "create-post", method: "patch") do
|
1939
|
-
"<input name='post[title]' type='text' value='Hello World' id='post_title' />" \
|
1940
|
-
"<textarea name='post[body]' id='post_body' >\nBack to the hill and over it again!</textarea>" \
|
1941
|
-
"<input name='parent_post[secret]' type='hidden' value='0' />" \
|
1942
|
-
"<input name='parent_post[secret]' checked='checked' type='checkbox' value='1' id='parent_post_secret' />"
|
1943
|
-
end
|
1944
|
-
|
1945
|
-
assert_dom_equal expected, output_buffer
|
1946
|
-
end
|
1947
|
-
|
1948
|
-
def test_form_with_and_fields_with_object
|
1949
|
-
form_with(model: @post, scope: :post, id: "create-post") do |post_form|
|
1950
|
-
concat post_form.text_field(:title)
|
1951
|
-
concat post_form.text_area(:body)
|
1952
|
-
|
1953
|
-
concat post_form.fields(model: @comment) { |comment_fields|
|
1954
|
-
concat comment_fields.text_field(:name)
|
1955
|
-
}
|
1956
|
-
end
|
1957
|
-
|
1958
|
-
expected = whole_form("/posts/123", "create-post", method: "patch") do
|
1959
|
-
"<input name='post[title]' type='text' value='Hello World' id='post_title' />" \
|
1960
|
-
"<textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea>" \
|
1961
|
-
"<input name='post[comment][name]' type='text' value='new comment' id='post_comment_name' />"
|
1962
|
-
end
|
1963
|
-
|
1964
|
-
assert_dom_equal expected, output_buffer
|
1965
|
-
end
|
1966
|
-
|
1967
|
-
def test_form_with_and_fields_with_non_nested_association_and_without_object
|
1968
|
-
form_with(model: @post) do |f|
|
1969
|
-
concat f.fields(:category) { |c|
|
1970
|
-
concat c.text_field(:name)
|
1971
|
-
}
|
1972
|
-
end
|
1973
|
-
|
1974
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1975
|
-
"<input name='post[category][name]' type='text' id='post_category_name' />"
|
1976
|
-
end
|
1977
|
-
|
1978
|
-
assert_dom_equal expected, output_buffer
|
1979
|
-
end
|
1980
|
-
|
1981
|
-
class LabelledFormBuilder < ActionView::Helpers::FormBuilder
|
1982
|
-
(field_helpers - %w(hidden_field)).each do |selector|
|
1983
|
-
class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
|
1984
|
-
def #{selector}(field, *args, &proc)
|
1985
|
-
("<label for='\#{field}'>\#{field.to_s.humanize}:</label> " + super + "<br/>").html_safe
|
1986
|
-
end
|
1987
|
-
RUBY_EVAL
|
1988
|
-
end
|
1989
|
-
end
|
1990
|
-
|
1991
|
-
def test_form_with_with_labelled_builder
|
1992
|
-
form_with(model: @post, builder: LabelledFormBuilder) do |f|
|
1993
|
-
concat f.text_field(:title)
|
1994
|
-
concat f.text_area(:body)
|
1995
|
-
concat f.check_box(:secret)
|
1996
|
-
end
|
1997
|
-
|
1998
|
-
expected = whole_form("/posts/123", method: "patch") do
|
1999
|
-
"<label for='title'>Title:</label> <input name='post[title]' type='text' value='Hello World' id='post_title'/><br/>" \
|
2000
|
-
"<label for='body'>Body:</label> <textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea><br/>" \
|
2001
|
-
"<label for='secret'>Secret:</label> <input name='post[secret]' type='hidden' value='0' /><input name='post[secret]' checked='checked' type='checkbox' value='1' id='post_secret' /><br/>"
|
2002
|
-
end
|
2003
|
-
|
2004
|
-
assert_dom_equal expected, output_buffer
|
2005
|
-
end
|
2006
|
-
|
2007
|
-
def test_default_form_builder
|
2008
|
-
old_default_form_builder, ActionView::Base.default_form_builder =
|
2009
|
-
ActionView::Base.default_form_builder, LabelledFormBuilder
|
2010
|
-
|
2011
|
-
form_with(model: @post) do |f|
|
2012
|
-
concat f.text_field(:title)
|
2013
|
-
concat f.text_area(:body)
|
2014
|
-
concat f.check_box(:secret)
|
2015
|
-
end
|
2016
|
-
|
2017
|
-
expected = whole_form("/posts/123", method: "patch") do
|
2018
|
-
"<label for='title'>Title:</label> <input name='post[title]' type='text' value='Hello World' id='post_title' /><br/>" \
|
2019
|
-
"<label for='body'>Body:</label> <textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea><br/>" \
|
2020
|
-
"<label for='secret'>Secret:</label> <input name='post[secret]' type='hidden' value='0' /><input name='post[secret]' checked='checked' type='checkbox' value='1' id='post_secret' /><br/>"
|
2021
|
-
end
|
2022
|
-
|
2023
|
-
assert_dom_equal expected, output_buffer
|
2024
|
-
ensure
|
2025
|
-
ActionView::Base.default_form_builder = old_default_form_builder
|
2026
|
-
end
|
2027
|
-
|
2028
|
-
def test_lazy_loading_default_form_builder
|
2029
|
-
old_default_form_builder, ActionView::Base.default_form_builder =
|
2030
|
-
ActionView::Base.default_form_builder, "FormWithActsLikeFormForTest::LabelledFormBuilder"
|
2031
|
-
|
2032
|
-
form_with(model: @post) do |f|
|
2033
|
-
concat f.text_field(:title)
|
2034
|
-
end
|
2035
|
-
|
2036
|
-
expected = whole_form("/posts/123", method: "patch") do
|
2037
|
-
"<label for='title'>Title:</label> <input name='post[title]' type='text' value='Hello World' id='post_title' /><br/>"
|
2038
|
-
end
|
2039
|
-
|
2040
|
-
assert_dom_equal expected, output_buffer
|
2041
|
-
ensure
|
2042
|
-
ActionView::Base.default_form_builder = old_default_form_builder
|
2043
|
-
end
|
2044
|
-
|
2045
|
-
def test_form_builder_override
|
2046
|
-
self.default_form_builder = LabelledFormBuilder
|
2047
|
-
|
2048
|
-
output_buffer = fields(:post, model: @post) do |f|
|
2049
|
-
concat f.text_field(:title)
|
2050
|
-
end
|
2051
|
-
|
2052
|
-
expected = "<label for='title'>Title:</label> <input name='post[title]' type='text' value='Hello World' id='post_title' /><br/>"
|
2053
|
-
|
2054
|
-
assert_dom_equal expected, output_buffer
|
2055
|
-
end
|
2056
|
-
|
2057
|
-
def test_lazy_loading_form_builder_override
|
2058
|
-
self.default_form_builder = "FormWithActsLikeFormForTest::LabelledFormBuilder"
|
2059
|
-
|
2060
|
-
output_buffer = fields(:post, model: @post) do |f|
|
2061
|
-
concat f.text_field(:title)
|
2062
|
-
end
|
2063
|
-
|
2064
|
-
expected = "<label for='title'>Title:</label> <input name='post[title]' type='text' value='Hello World' id='post_title' /><br/>"
|
2065
|
-
|
2066
|
-
assert_dom_equal expected, output_buffer
|
2067
|
-
end
|
2068
|
-
|
2069
|
-
def test_fields_with_labelled_builder
|
2070
|
-
output_buffer = fields(:post, model: @post, builder: LabelledFormBuilder) do |f|
|
2071
|
-
concat f.text_field(:title)
|
2072
|
-
concat f.text_area(:body)
|
2073
|
-
concat f.check_box(:secret)
|
2074
|
-
end
|
2075
|
-
|
2076
|
-
expected =
|
2077
|
-
"<label for='title'>Title:</label> <input name='post[title]' type='text' value='Hello World' id='post_title'/><br/>" \
|
2078
|
-
"<label for='body'>Body:</label> <textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea><br/>" \
|
2079
|
-
"<label for='secret'>Secret:</label> <input name='post[secret]' type='hidden' value='0' /><input name='post[secret]' checked='checked' type='checkbox' value='1' id='post_secret' /><br/>"
|
2080
|
-
|
2081
|
-
assert_dom_equal expected, output_buffer
|
2082
|
-
end
|
2083
|
-
|
2084
|
-
def test_form_with_with_labelled_builder_with_nested_fields_without_options_hash
|
2085
|
-
klass = nil
|
2086
|
-
|
2087
|
-
form_with(model: @post, builder: LabelledFormBuilder) do |f|
|
2088
|
-
f.fields(:comments, model: Comment.new) do |nested_fields|
|
2089
|
-
klass = nested_fields.class
|
2090
|
-
""
|
2091
|
-
end
|
2092
|
-
end
|
2093
|
-
|
2094
|
-
assert_equal LabelledFormBuilder, klass
|
2095
|
-
end
|
2096
|
-
|
2097
|
-
def test_form_with_with_labelled_builder_with_nested_fields_with_options_hash
|
2098
|
-
klass = nil
|
2099
|
-
|
2100
|
-
form_with(model: @post, builder: LabelledFormBuilder) do |f|
|
2101
|
-
f.fields(:comments, model: Comment.new, index: "foo") do |nested_fields|
|
2102
|
-
klass = nested_fields.class
|
2103
|
-
""
|
2104
|
-
end
|
2105
|
-
end
|
2106
|
-
|
2107
|
-
assert_equal LabelledFormBuilder, klass
|
2108
|
-
end
|
2109
|
-
|
2110
|
-
def test_form_with_with_labelled_builder_path
|
2111
|
-
path = nil
|
2112
|
-
|
2113
|
-
form_with(model: @post, builder: LabelledFormBuilder) do |f|
|
2114
|
-
path = f.to_partial_path
|
2115
|
-
""
|
2116
|
-
end
|
2117
|
-
|
2118
|
-
assert_equal "labelled_form", path
|
2119
|
-
end
|
2120
|
-
|
2121
|
-
class LabelledFormBuilderSubclass < LabelledFormBuilder; end
|
2122
|
-
|
2123
|
-
def test_form_with_with_labelled_builder_with_nested_fields_with_custom_builder
|
2124
|
-
klass = nil
|
2125
|
-
|
2126
|
-
form_with(model: @post, builder: LabelledFormBuilder) do |f|
|
2127
|
-
f.fields(:comments, model: Comment.new, builder: LabelledFormBuilderSubclass) do |nested_fields|
|
2128
|
-
klass = nested_fields.class
|
2129
|
-
""
|
2130
|
-
end
|
2131
|
-
end
|
2132
|
-
|
2133
|
-
assert_equal LabelledFormBuilderSubclass, klass
|
2134
|
-
end
|
2135
|
-
|
2136
|
-
def test_form_with_with_html_options_adds_options_to_form_tag
|
2137
|
-
form_with(model: @post, html: { id: "some_form", class: "some_class", multipart: true }) do |f| end
|
2138
|
-
expected = whole_form("/posts/123", "some_form", "some_class", method: "patch", multipart: "multipart/form-data")
|
2139
|
-
|
2140
|
-
assert_dom_equal expected, output_buffer
|
2141
|
-
end
|
2142
|
-
|
2143
|
-
def test_form_with_with_string_url_option
|
2144
|
-
form_with(model: @post, url: "http://www.otherdomain.com") do |f| end
|
2145
|
-
|
2146
|
-
assert_dom_equal whole_form("http://www.otherdomain.com", method: "patch"), output_buffer
|
2147
|
-
end
|
2148
|
-
|
2149
|
-
def test_form_with_with_hash_url_option
|
2150
|
-
form_with(model: @post, url: { controller: "controller", action: "action" }) do |f| end
|
2151
|
-
|
2152
|
-
assert_equal "controller", @url_for_options[:controller]
|
2153
|
-
assert_equal "action", @url_for_options[:action]
|
2154
|
-
end
|
2155
|
-
|
2156
|
-
def test_form_with_with_record_url_option
|
2157
|
-
form_with(model: @post, url: @post) do |f| end
|
2158
|
-
|
2159
|
-
expected = whole_form("/posts/123", method: "patch")
|
2160
|
-
assert_dom_equal expected, output_buffer
|
2161
|
-
end
|
2162
|
-
|
2163
|
-
def test_form_with_with_existing_object
|
2164
|
-
form_with(model: @post) do |f| end
|
2165
|
-
|
2166
|
-
expected = whole_form("/posts/123", method: "patch")
|
2167
|
-
assert_dom_equal expected, output_buffer
|
2168
|
-
end
|
2169
|
-
|
2170
|
-
def test_form_with_with_new_object
|
2171
|
-
post = Post.new
|
2172
|
-
post.persisted = false
|
2173
|
-
def post.to_key; nil; end
|
2174
|
-
|
2175
|
-
form_with(model: post) {}
|
2176
|
-
|
2177
|
-
expected = whole_form("/posts")
|
2178
|
-
assert_dom_equal expected, output_buffer
|
2179
|
-
end
|
2180
|
-
|
2181
|
-
def test_form_with_with_existing_object_in_list
|
2182
|
-
@comment.save
|
2183
|
-
form_with(model: [@post, @comment]) {}
|
2184
|
-
|
2185
|
-
expected = whole_form(post_comment_path(@post, @comment), method: "patch")
|
2186
|
-
assert_dom_equal expected, output_buffer
|
2187
|
-
end
|
2188
|
-
|
2189
|
-
def test_form_with_with_new_object_in_list
|
2190
|
-
form_with(model: [@post, @comment]) {}
|
2191
|
-
|
2192
|
-
expected = whole_form(post_comments_path(@post))
|
2193
|
-
assert_dom_equal expected, output_buffer
|
2194
|
-
end
|
2195
|
-
|
2196
|
-
def test_form_with_with_existing_object_and_namespace_in_list
|
2197
|
-
@comment.save
|
2198
|
-
form_with(model: [:admin, @post, @comment]) {}
|
2199
|
-
|
2200
|
-
expected = whole_form(admin_post_comment_path(@post, @comment), method: "patch")
|
2201
|
-
assert_dom_equal expected, output_buffer
|
2202
|
-
end
|
2203
|
-
|
2204
|
-
def test_form_with_with_new_object_and_namespace_in_list
|
2205
|
-
form_with(model: [:admin, @post, @comment]) {}
|
2206
|
-
|
2207
|
-
expected = whole_form(admin_post_comments_path(@post))
|
2208
|
-
assert_dom_equal expected, output_buffer
|
2209
|
-
end
|
2210
|
-
|
2211
|
-
def test_form_with_with_existing_object_and_custom_url
|
2212
|
-
form_with(model: @post, url: "/super_posts") do |f| end
|
2213
|
-
|
2214
|
-
expected = whole_form("/super_posts", method: "patch")
|
2215
|
-
assert_dom_equal expected, output_buffer
|
2216
|
-
end
|
2217
|
-
|
2218
|
-
def test_form_with_with_default_method_as_patch
|
2219
|
-
form_with(model: @post) {}
|
2220
|
-
expected = whole_form("/posts/123", method: "patch")
|
2221
|
-
assert_dom_equal expected, output_buffer
|
2222
|
-
end
|
2223
|
-
|
2224
|
-
def test_form_with_with_data_attributes
|
2225
|
-
form_with(model: @post, data: { behavior: "stuff" }) {}
|
2226
|
-
assert_match %r|data-behavior="stuff"|, output_buffer
|
2227
|
-
assert_match %r|data-remote="true"|, output_buffer
|
2228
|
-
end
|
2229
|
-
|
2230
|
-
def test_fields_returns_block_result
|
2231
|
-
output = fields(model: Post.new) { |f| "fields" }
|
2232
|
-
assert_equal "fields", output
|
2233
|
-
end
|
2234
|
-
|
2235
|
-
def test_form_with_only_instantiates_builder_once
|
2236
|
-
initialization_count = 0
|
2237
|
-
builder_class = Class.new(ActionView::Helpers::FormBuilder) do
|
2238
|
-
define_method :initialize do |*args|
|
2239
|
-
super(*args)
|
2240
|
-
initialization_count += 1
|
2241
|
-
end
|
2242
|
-
end
|
2243
|
-
|
2244
|
-
form_with(model: @post, builder: builder_class) {}
|
2245
|
-
assert_equal 1, initialization_count, "form builder instantiated more than once"
|
2246
|
-
end
|
2247
|
-
|
2248
|
-
private
|
2249
|
-
def hidden_fields(options = {})
|
2250
|
-
method = options[:method]
|
2251
|
-
|
2252
|
-
if options.fetch(:skip_enforcing_utf8, false)
|
2253
|
-
txt = "".dup
|
2254
|
-
else
|
2255
|
-
txt = %{<input name="utf8" type="hidden" value="✓" />}.dup
|
2256
|
-
end
|
2257
|
-
|
2258
|
-
if method && !%w(get post).include?(method.to_s)
|
2259
|
-
txt << %{<input name="_method" type="hidden" value="#{method}" />}
|
2260
|
-
end
|
2261
|
-
|
2262
|
-
txt
|
2263
|
-
end
|
2264
|
-
|
2265
|
-
def form_text(action = "/", id = nil, html_class = nil, local = nil, multipart = nil, method = nil)
|
2266
|
-
txt = %{<form accept-charset="UTF-8" action="#{action}"}.dup
|
2267
|
-
txt << %{ enctype="multipart/form-data"} if multipart
|
2268
|
-
txt << %{ data-remote="true"} unless local
|
2269
|
-
txt << %{ class="#{html_class}"} if html_class
|
2270
|
-
txt << %{ id="#{id}"} if id
|
2271
|
-
method = method.to_s == "get" ? "get" : "post"
|
2272
|
-
txt << %{ method="#{method}">}
|
2273
|
-
end
|
2274
|
-
|
2275
|
-
def whole_form(action = "/", id = nil, html_class = nil, local: false, **options)
|
2276
|
-
contents = block_given? ? yield : ""
|
2277
|
-
|
2278
|
-
method, multipart = options.values_at(:method, :multipart)
|
2279
|
-
|
2280
|
-
form_text(action, id, html_class, local, multipart, method) + hidden_fields(options.slice :method, :skip_enforcing_utf8) + contents + "</form>"
|
2281
|
-
end
|
2282
|
-
|
2283
|
-
def protect_against_forgery?
|
2284
|
-
false
|
2285
|
-
end
|
2286
|
-
|
2287
|
-
def with_locale(testing_locale = :label)
|
2288
|
-
old_locale, I18n.locale = I18n.locale, testing_locale
|
2289
|
-
yield
|
2290
|
-
ensure
|
2291
|
-
I18n.locale = old_locale
|
2292
|
-
end
|
2293
|
-
end
|