activejob-lock 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/Gemfile +21 -0
- data/LICENSE.txt +22 -0
- data/README.md +48 -0
- data/Rakefile +77 -0
- data/activejob-lock.gemspec +30 -0
- data/lib/activejob/lock/queue_adapters/resque_adapter.rb +44 -0
- data/lib/activejob/lock/queue_adapters.rb +1 -0
- data/lib/activejob/lock/version.rb +5 -0
- data/lib/activejob/lock.rb +38 -0
- data/rails/.gitignore +21 -0
- data/rails/.travis.yml +62 -0
- data/rails/.yardopts +4 -0
- data/rails/CONTRIBUTING.md +17 -0
- data/rails/Gemfile +126 -0
- data/rails/Gemfile.lock +273 -0
- data/rails/RAILS_VERSION +1 -0
- data/rails/README.md +85 -0
- data/rails/RELEASING_RAILS.rdoc +217 -0
- data/rails/Rakefile +67 -0
- data/rails/actionmailer/CHANGELOG.md +63 -0
- data/rails/actionmailer/MIT-LICENSE +21 -0
- data/rails/actionmailer/README.rdoc +176 -0
- data/rails/actionmailer/Rakefile +35 -0
- data/rails/actionmailer/actionmailer.gemspec +28 -0
- data/rails/actionmailer/lib/action_mailer/base.rb +947 -0
- data/rails/actionmailer/lib/action_mailer/collector.rb +30 -0
- data/rails/actionmailer/lib/action_mailer/delivery_job.rb +13 -0
- data/rails/actionmailer/lib/action_mailer/delivery_methods.rb +84 -0
- data/rails/actionmailer/lib/action_mailer/gem_version.rb +15 -0
- data/rails/actionmailer/lib/action_mailer/log_subscriber.rb +39 -0
- data/rails/actionmailer/lib/action_mailer/mail_helper.rb +58 -0
- data/rails/actionmailer/lib/action_mailer/message_delivery.rb +115 -0
- data/rails/actionmailer/lib/action_mailer/preview.rb +118 -0
- data/rails/actionmailer/lib/action_mailer/railtie.rb +64 -0
- data/rails/actionmailer/lib/action_mailer/test_case.rb +104 -0
- data/rails/actionmailer/lib/action_mailer/test_helper.rb +62 -0
- data/rails/actionmailer/lib/action_mailer/version.rb +9 -0
- data/rails/actionmailer/lib/action_mailer.rb +50 -0
- data/rails/actionmailer/lib/rails/generators/mailer/USAGE +17 -0
- data/rails/actionmailer/lib/rails/generators/mailer/mailer_generator.rb +19 -0
- data/rails/actionmailer/lib/rails/generators/mailer/templates/application_mailer.rb +4 -0
- data/rails/actionmailer/lib/rails/generators/mailer/templates/mailer.rb +17 -0
- data/rails/actionmailer/test/abstract_unit.rb +49 -0
- data/rails/actionmailer/test/assert_select_email_test.rb +47 -0
- data/rails/actionmailer/test/asset_host_test.rb +37 -0
- data/rails/actionmailer/test/base_test.rb +885 -0
- data/rails/actionmailer/test/delivery_methods_test.rb +237 -0
- data/rails/actionmailer/test/fixtures/anonymous/welcome.erb +1 -0
- data/rails/actionmailer/test/fixtures/another.path/base_mailer/welcome.erb +1 -0
- data/rails/actionmailer/test/fixtures/asset_host_mailer/email_with_asset.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/asset_mailer/welcome.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/async_mailer/welcome.erb +1 -0
- data/rails/actionmailer/test/fixtures/attachments/foo.jpg +0 -0
- data/rails/actionmailer/test/fixtures/attachments/test.jpg +0 -0
- data/rails/actionmailer/test/fixtures/auto_layout_mailer/hello.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/auto_layout_mailer/multipart.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/auto_layout_mailer/multipart.text.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/attachment_with_content.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/attachment_with_hash.html.erb +0 -0
- data/rails/actionmailer/test/fixtures/base_mailer/attachment_with_hash_default_encoding.html.erb +0 -0
- data/rails/actionmailer/test/fixtures/base_mailer/different_layout.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/different_layout.text.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/email_custom_layout.text.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/email_with_translations.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/explicit_multipart_templates.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/explicit_multipart_templates.text.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/explicit_multipart_with_one_template.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/html_only.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/implicit_multipart.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/implicit_multipart.text.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/implicit_with_locale.en.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/implicit_with_locale.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/implicit_with_locale.pl.text.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/implicit_with_locale.text.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/inline_attachment.html.erb +5 -0
- data/rails/actionmailer/test/fixtures/base_mailer/inline_attachment.text.erb +4 -0
- data/rails/actionmailer/test/fixtures/base_mailer/plain_text_only.text.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/welcome.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_mailer/welcome_with_headers.html.erb +0 -0
- data/rails/actionmailer/test/fixtures/base_mailer/without_mail_call.erb +1 -0
- data/rails/actionmailer/test/fixtures/base_test/after_action_mailer/welcome.html.erb +0 -0
- data/rails/actionmailer/test/fixtures/base_test/before_action_mailer/welcome.html.erb +0 -0
- data/rails/actionmailer/test/fixtures/base_test/default_inline_attachment_mailer/welcome.html.erb +0 -0
- data/rails/actionmailer/test/fixtures/base_test/late_inline_attachment_mailer/on_render.erb +7 -0
- data/rails/actionmailer/test/fixtures/explicit_layout_mailer/logout.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/explicit_layout_mailer/signup.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/first_mailer/share.erb +1 -0
- data/rails/actionmailer/test/fixtures/i18n_test_mailer/mail_with_i18n_subject.erb +4 -0
- data/rails/actionmailer/test/fixtures/layouts/auto_layout_mailer.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/layouts/auto_layout_mailer.text.erb +1 -0
- data/rails/actionmailer/test/fixtures/layouts/different_layout.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/layouts/different_layout.text.erb +1 -0
- data/rails/actionmailer/test/fixtures/layouts/spam.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/mail_delivery_test/delivery_mailer/welcome.html.erb +0 -0
- data/rails/actionmailer/test/fixtures/nested_layout_mailer/signup.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb +1 -0
- data/rails/actionmailer/test/fixtures/proc_mailer/welcome.html.erb +0 -0
- data/rails/actionmailer/test/fixtures/raw_email +14 -0
- data/rails/actionmailer/test/fixtures/second_mailer/share.erb +1 -0
- data/rails/actionmailer/test/fixtures/templates/signed_up.erb +3 -0
- data/rails/actionmailer/test/fixtures/test_helper_mailer/welcome +1 -0
- data/rails/actionmailer/test/fixtures/test_mailer/_subtemplate.text.erb +1 -0
- data/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.html.haml +6 -0
- data/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.haml +6 -0
- data/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.html.erb +10 -0
- data/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.html.erb~ +10 -0
- data/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb +1 -0
- data/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.rhtml.bak +1 -0
- data/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.erb +2 -0
- data/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.yaml.erb +1 -0
- data/rails/actionmailer/test/fixtures/test_mailer/included_subtemplate.text.erb +1 -0
- data/rails/actionmailer/test/fixtures/test_mailer/multipart_alternative.html.erb +1 -0
- data/rails/actionmailer/test/fixtures/test_mailer/multipart_alternative.plain.erb +1 -0
- data/rails/actionmailer/test/fixtures/test_mailer/rxml_template.rxml +2 -0
- data/rails/actionmailer/test/fixtures/test_mailer/signed_up.html.erb +3 -0
- data/rails/actionmailer/test/fixtures/url_test_mailer/exercise_url_for.erb +1 -0
- data/rails/actionmailer/test/fixtures/url_test_mailer/signed_up_with_url.erb +5 -0
- data/rails/actionmailer/test/i18n_with_controller_test.rb +70 -0
- data/rails/actionmailer/test/log_subscriber_test.rb +47 -0
- data/rails/actionmailer/test/mail_helper_test.rb +111 -0
- data/rails/actionmailer/test/mail_layout_test.rb +95 -0
- data/rails/actionmailer/test/mailers/asset_mailer.rb +7 -0
- data/rails/actionmailer/test/mailers/base_mailer.rb +130 -0
- data/rails/actionmailer/test/mailers/delayed_mailer.rb +6 -0
- data/rails/actionmailer/test/mailers/proc_mailer.rb +17 -0
- data/rails/actionmailer/test/message_delivery_test.rb +104 -0
- data/rails/actionmailer/test/test_case_test.rb +28 -0
- data/rails/actionmailer/test/test_helper_test.rb +135 -0
- data/rails/actionmailer/test/url_test.rb +138 -0
- data/rails/actionpack/CHANGELOG.md +501 -0
- data/rails/actionpack/MIT-LICENSE +21 -0
- data/rails/actionpack/README.rdoc +58 -0
- data/rails/actionpack/Rakefile +53 -0
- data/rails/actionpack/actionpack.gemspec +31 -0
- data/rails/actionpack/lib/abstract_controller/asset_paths.rb +10 -0
- data/rails/actionpack/lib/abstract_controller/base.rb +269 -0
- data/rails/actionpack/lib/abstract_controller/callbacks.rb +196 -0
- data/rails/actionpack/lib/abstract_controller/collector.rb +46 -0
- data/rails/actionpack/lib/abstract_controller/helpers.rb +194 -0
- data/rails/actionpack/lib/abstract_controller/logger.rb +12 -0
- data/rails/actionpack/lib/abstract_controller/railties/routes_helpers.rb +18 -0
- data/rails/actionpack/lib/abstract_controller/rendering.rb +120 -0
- data/rails/actionpack/lib/abstract_controller/translation.rb +28 -0
- data/rails/actionpack/lib/abstract_controller/url_for.rb +33 -0
- data/rails/actionpack/lib/abstract_controller.rb +20 -0
- data/rails/actionpack/lib/action_controller/base.rb +268 -0
- data/rails/actionpack/lib/action_controller/caching/fragments.rb +103 -0
- data/rails/actionpack/lib/action_controller/caching.rb +89 -0
- data/rails/actionpack/lib/action_controller/log_subscriber.rb +83 -0
- data/rails/actionpack/lib/action_controller/metal/conditional_get.rb +200 -0
- data/rails/actionpack/lib/action_controller/metal/cookies.rb +16 -0
- data/rails/actionpack/lib/action_controller/metal/data_streaming.rb +171 -0
- data/rails/actionpack/lib/action_controller/metal/etag_with_template_digest.rb +50 -0
- data/rails/actionpack/lib/action_controller/metal/exceptions.rb +59 -0
- data/rails/actionpack/lib/action_controller/metal/flash.rb +60 -0
- data/rails/actionpack/lib/action_controller/metal/force_ssl.rb +97 -0
- data/rails/actionpack/lib/action_controller/metal/head.rb +56 -0
- data/rails/actionpack/lib/action_controller/metal/helpers.rb +113 -0
- data/rails/actionpack/lib/action_controller/metal/hide_actions.rb +40 -0
- data/rails/actionpack/lib/action_controller/metal/http_authentication.rb +507 -0
- data/rails/actionpack/lib/action_controller/metal/implicit_render.rb +19 -0
- data/rails/actionpack/lib/action_controller/metal/instrumentation.rb +109 -0
- data/rails/actionpack/lib/action_controller/metal/live.rb +328 -0
- data/rails/actionpack/lib/action_controller/metal/mime_responds.rb +324 -0
- data/rails/actionpack/lib/action_controller/metal/params_wrapper.rb +285 -0
- data/rails/actionpack/lib/action_controller/metal/rack_delegation.rb +32 -0
- data/rails/actionpack/lib/action_controller/metal/redirecting.rb +112 -0
- data/rails/actionpack/lib/action_controller/metal/renderers.rb +140 -0
- data/rails/actionpack/lib/action_controller/metal/rendering.rb +100 -0
- data/rails/actionpack/lib/action_controller/metal/request_forgery_protection.rb +334 -0
- data/rails/actionpack/lib/action_controller/metal/rescue.rb +35 -0
- data/rails/actionpack/lib/action_controller/metal/streaming.rb +221 -0
- data/rails/actionpack/lib/action_controller/metal/strong_parameters.rb +667 -0
- data/rails/actionpack/lib/action_controller/metal/testing.rb +31 -0
- data/rails/actionpack/lib/action_controller/metal/url_for.rb +49 -0
- data/rails/actionpack/lib/action_controller/metal.rb +241 -0
- data/rails/actionpack/lib/action_controller/middleware.rb +39 -0
- data/rails/actionpack/lib/action_controller/model_naming.rb +12 -0
- data/rails/actionpack/lib/action_controller/railtie.rb +71 -0
- data/rails/actionpack/lib/action_controller/railties/helpers.rb +22 -0
- data/rails/actionpack/lib/action_controller/test_case.rb +754 -0
- data/rails/actionpack/lib/action_controller.rb +58 -0
- data/rails/actionpack/lib/action_dispatch/http/cache.rb +176 -0
- data/rails/actionpack/lib/action_dispatch/http/filter_parameters.rb +78 -0
- data/rails/actionpack/lib/action_dispatch/http/filter_redirect.rb +38 -0
- data/rails/actionpack/lib/action_dispatch/http/headers.rb +99 -0
- data/rails/actionpack/lib/action_dispatch/http/mime_negotiation.rb +156 -0
- data/rails/actionpack/lib/action_dispatch/http/mime_type.rb +315 -0
- data/rails/actionpack/lib/action_dispatch/http/mime_types.rb +36 -0
- data/rails/actionpack/lib/action_dispatch/http/parameter_filter.rb +72 -0
- data/rails/actionpack/lib/action_dispatch/http/parameters.rb +67 -0
- data/rails/actionpack/lib/action_dispatch/http/rack_cache.rb +61 -0
- data/rails/actionpack/lib/action_dispatch/http/request.rb +348 -0
- data/rails/actionpack/lib/action_dispatch/http/response.rb +406 -0
- data/rails/actionpack/lib/action_dispatch/http/upload.rb +72 -0
- data/rails/actionpack/lib/action_dispatch/http/url.rb +268 -0
- data/rails/actionpack/lib/action_dispatch/journey/backwards.rb +5 -0
- data/rails/actionpack/lib/action_dispatch/journey/formatter.rb +166 -0
- data/rails/actionpack/lib/action_dispatch/journey/gtg/builder.rb +162 -0
- data/rails/actionpack/lib/action_dispatch/journey/gtg/simulator.rb +47 -0
- data/rails/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb +157 -0
- data/rails/actionpack/lib/action_dispatch/journey/nfa/builder.rb +76 -0
- data/rails/actionpack/lib/action_dispatch/journey/nfa/dot.rb +36 -0
- data/rails/actionpack/lib/action_dispatch/journey/nfa/simulator.rb +47 -0
- data/rails/actionpack/lib/action_dispatch/journey/nfa/transition_table.rb +163 -0
- data/rails/actionpack/lib/action_dispatch/journey/nodes/node.rb +128 -0
- data/rails/actionpack/lib/action_dispatch/journey/parser.rb +198 -0
- data/rails/actionpack/lib/action_dispatch/journey/parser.y +49 -0
- data/rails/actionpack/lib/action_dispatch/journey/parser_extras.rb +23 -0
- data/rails/actionpack/lib/action_dispatch/journey/path/pattern.rb +193 -0
- data/rails/actionpack/lib/action_dispatch/journey/route.rb +125 -0
- data/rails/actionpack/lib/action_dispatch/journey/router/strexp.rb +27 -0
- data/rails/actionpack/lib/action_dispatch/journey/router/utils.rb +93 -0
- data/rails/actionpack/lib/action_dispatch/journey/router.rb +144 -0
- data/rails/actionpack/lib/action_dispatch/journey/routes.rb +76 -0
- data/rails/actionpack/lib/action_dispatch/journey/scanner.rb +61 -0
- data/rails/actionpack/lib/action_dispatch/journey/visitors.rb +221 -0
- data/rails/actionpack/lib/action_dispatch/journey/visualizer/fsm.css +30 -0
- data/rails/actionpack/lib/action_dispatch/journey/visualizer/fsm.js +134 -0
- data/rails/actionpack/lib/action_dispatch/journey/visualizer/index.html.erb +52 -0
- data/rails/actionpack/lib/action_dispatch/journey.rb +5 -0
- data/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb +37 -0
- data/rails/actionpack/lib/action_dispatch/middleware/cookies.rb +574 -0
- data/rails/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb +110 -0
- data/rails/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb +148 -0
- data/rails/actionpack/lib/action_dispatch/middleware/flash.rb +276 -0
- data/rails/actionpack/lib/action_dispatch/middleware/params_parser.rb +60 -0
- data/rails/actionpack/lib/action_dispatch/middleware/public_exceptions.rb +55 -0
- data/rails/actionpack/lib/action_dispatch/middleware/reloader.rb +98 -0
- data/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb +173 -0
- data/rails/actionpack/lib/action_dispatch/middleware/request_id.rb +35 -0
- data/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb +90 -0
- data/rails/actionpack/lib/action_dispatch/middleware/session/cache_store.rb +49 -0
- data/rails/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb +123 -0
- data/rails/actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb +22 -0
- data/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb +58 -0
- data/rails/actionpack/lib/action_dispatch/middleware/ssl.rb +72 -0
- data/rails/actionpack/lib/action_dispatch/middleware/stack.rb +129 -0
- data/rails/actionpack/lib/action_dispatch/middleware/static.rb +116 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +34 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb +23 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb +27 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb +52 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb +9 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +16 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb +9 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/layout.erb +160 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb +11 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.text.erb +3 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb +32 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.text.erb +11 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +20 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.text.erb +7 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.html.erb +6 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.text.erb +3 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/routes/_route.html.erb +16 -0
- data/rails/actionpack/lib/action_dispatch/middleware/templates/routes/_table.html.erb +200 -0
- data/rails/actionpack/lib/action_dispatch/railtie.rb +45 -0
- data/rails/actionpack/lib/action_dispatch/request/session.rb +193 -0
- data/rails/actionpack/lib/action_dispatch/request/utils.rb +35 -0
- data/rails/actionpack/lib/action_dispatch/routing/endpoint.rb +10 -0
- data/rails/actionpack/lib/action_dispatch/routing/inspector.rb +234 -0
- data/rails/actionpack/lib/action_dispatch/routing/mapper.rb +1979 -0
- data/rails/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +330 -0
- data/rails/actionpack/lib/action_dispatch/routing/redirection.rb +191 -0
- data/rails/actionpack/lib/action_dispatch/routing/route_set.rb +862 -0
- data/rails/actionpack/lib/action_dispatch/routing/routes_proxy.rb +41 -0
- data/rails/actionpack/lib/action_dispatch/routing/url_for.rb +195 -0
- data/rails/actionpack/lib/action_dispatch/routing.rb +261 -0
- data/rails/actionpack/lib/action_dispatch/testing/assertions/dom.rb +3 -0
- data/rails/actionpack/lib/action_dispatch/testing/assertions/response.rb +82 -0
- data/rails/actionpack/lib/action_dispatch/testing/assertions/routing.rb +212 -0
- data/rails/actionpack/lib/action_dispatch/testing/assertions/selector.rb +3 -0
- data/rails/actionpack/lib/action_dispatch/testing/assertions/tag.rb +3 -0
- data/rails/actionpack/lib/action_dispatch/testing/assertions.rb +22 -0
- data/rails/actionpack/lib/action_dispatch/testing/integration.rb +511 -0
- data/rails/actionpack/lib/action_dispatch/testing/test_process.rb +44 -0
- data/rails/actionpack/lib/action_dispatch/testing/test_request.rb +78 -0
- data/rails/actionpack/lib/action_dispatch/testing/test_response.rb +36 -0
- data/rails/actionpack/lib/action_dispatch.rb +105 -0
- data/rails/actionpack/lib/action_pack/gem_version.rb +15 -0
- data/rails/actionpack/lib/action_pack/version.rb +8 -0
- data/rails/actionpack/lib/action_pack.rb +24 -0
- data/rails/actionpack/test/abstract/callbacks_test.rb +315 -0
- data/rails/actionpack/test/abstract/collector_test.rb +63 -0
- data/rails/actionpack/test/abstract/translation_test.rb +50 -0
- data/rails/actionpack/test/abstract_unit.rb +521 -0
- data/rails/actionpack/test/assertions/response_assertions_test.rb +63 -0
- data/rails/actionpack/test/controller/action_pack_assertions_test.rb +657 -0
- data/rails/actionpack/test/controller/base_test.rb +342 -0
- data/rails/actionpack/test/controller/caching_test.rb +351 -0
- data/rails/actionpack/test/controller/content_type_test.rb +167 -0
- data/rails/actionpack/test/controller/controller_fixtures/app/controllers/admin/user_controller.rb +0 -0
- data/rails/actionpack/test/controller/controller_fixtures/app/controllers/user_controller.rb +0 -0
- data/rails/actionpack/test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb +0 -0
- data/rails/actionpack/test/controller/default_url_options_with_before_action_test.rb +29 -0
- data/rails/actionpack/test/controller/filters_test.rb +1047 -0
- data/rails/actionpack/test/controller/flash_hash_test.rb +211 -0
- data/rails/actionpack/test/controller/flash_test.rb +335 -0
- data/rails/actionpack/test/controller/force_ssl_test.rb +324 -0
- data/rails/actionpack/test/controller/helper_test.rb +297 -0
- data/rails/actionpack/test/controller/http_basic_authentication_test.rb +144 -0
- data/rails/actionpack/test/controller/http_digest_authentication_test.rb +289 -0
- data/rails/actionpack/test/controller/http_token_authentication_test.rb +200 -0
- data/rails/actionpack/test/controller/integration_test.rb +899 -0
- data/rails/actionpack/test/controller/live_stream_test.rb +454 -0
- data/rails/actionpack/test/controller/localized_templates_test.rb +46 -0
- data/rails/actionpack/test/controller/log_subscriber_test.rb +345 -0
- data/rails/actionpack/test/controller/mime/accept_format_test.rb +92 -0
- data/rails/actionpack/test/controller/mime/respond_to_test.rb +784 -0
- data/rails/actionpack/test/controller/mime/responders_test.rb +32 -0
- data/rails/actionpack/test/controller/new_base/bare_metal_test.rb +153 -0
- data/rails/actionpack/test/controller/new_base/base_test.rb +132 -0
- data/rails/actionpack/test/controller/new_base/content_negotiation_test.rb +27 -0
- data/rails/actionpack/test/controller/new_base/content_type_test.rb +112 -0
- data/rails/actionpack/test/controller/new_base/metal_test.rb +45 -0
- data/rails/actionpack/test/controller/new_base/middleware_test.rb +110 -0
- data/rails/actionpack/test/controller/new_base/render_action_test.rb +315 -0
- data/rails/actionpack/test/controller/new_base/render_body_test.rb +170 -0
- data/rails/actionpack/test/controller/new_base/render_context_test.rb +54 -0
- data/rails/actionpack/test/controller/new_base/render_file_test.rb +70 -0
- data/rails/actionpack/test/controller/new_base/render_html_test.rb +190 -0
- data/rails/actionpack/test/controller/new_base/render_implicit_action_test.rb +57 -0
- data/rails/actionpack/test/controller/new_base/render_layout_test.rb +127 -0
- data/rails/actionpack/test/controller/new_base/render_partial_test.rb +63 -0
- data/rails/actionpack/test/controller/new_base/render_plain_test.rb +168 -0
- data/rails/actionpack/test/controller/new_base/render_streaming_test.rb +114 -0
- data/rails/actionpack/test/controller/new_base/render_template_test.rb +239 -0
- data/rails/actionpack/test/controller/new_base/render_test.rb +136 -0
- data/rails/actionpack/test/controller/new_base/render_text_test.rb +158 -0
- data/rails/actionpack/test/controller/new_base/render_xml_test.rb +11 -0
- data/rails/actionpack/test/controller/output_escaping_test.rb +17 -0
- data/rails/actionpack/test/controller/parameters/accessors_test.rb +125 -0
- data/rails/actionpack/test/controller/parameters/always_permitted_parameters_test.rb +29 -0
- data/rails/actionpack/test/controller/parameters/log_on_unpermitted_params_test.rb +72 -0
- data/rails/actionpack/test/controller/parameters/multi_parameter_attributes_test.rb +38 -0
- data/rails/actionpack/test/controller/parameters/mutators_test.rb +99 -0
- data/rails/actionpack/test/controller/parameters/nested_parameters_test.rb +187 -0
- data/rails/actionpack/test/controller/parameters/parameters_permit_test.rb +289 -0
- data/rails/actionpack/test/controller/parameters/raise_on_unpermitted_params_test.rb +33 -0
- data/rails/actionpack/test/controller/params_wrapper_test.rb +362 -0
- data/rails/actionpack/test/controller/permitted_params_test.rb +25 -0
- data/rails/actionpack/test/controller/redirect_test.rb +354 -0
- data/rails/actionpack/test/controller/render_js_test.rb +34 -0
- data/rails/actionpack/test/controller/render_json_test.rb +136 -0
- data/rails/actionpack/test/controller/render_other_test.rb +24 -0
- data/rails/actionpack/test/controller/render_test.rb +579 -0
- data/rails/actionpack/test/controller/render_xml_test.rb +97 -0
- data/rails/actionpack/test/controller/request/test_request_test.rb +35 -0
- data/rails/actionpack/test/controller/request_forgery_protection_test.rb +510 -0
- data/rails/actionpack/test/controller/required_params_test.rb +51 -0
- data/rails/actionpack/test/controller/rescue_test.rb +348 -0
- data/rails/actionpack/test/controller/resources_test.rb +1334 -0
- data/rails/actionpack/test/controller/routing_test.rb +2026 -0
- data/rails/actionpack/test/controller/runner_test.rb +22 -0
- data/rails/actionpack/test/controller/send_file_test.rb +209 -0
- data/rails/actionpack/test/controller/show_exceptions_test.rb +112 -0
- data/rails/actionpack/test/controller/streaming_test.rb +26 -0
- data/rails/actionpack/test/controller/test_case_test.rb +913 -0
- data/rails/actionpack/test/controller/url_for_integration_test.rb +188 -0
- data/rails/actionpack/test/controller/url_for_test.rb +446 -0
- data/rails/actionpack/test/controller/url_rewriter_test.rb +90 -0
- data/rails/actionpack/test/controller/webservice_test.rb +114 -0
- data/rails/actionpack/test/dispatch/callbacks_test.rb +58 -0
- data/rails/actionpack/test/dispatch/cookies_test.rb +1159 -0
- data/rails/actionpack/test/dispatch/debug_exceptions_test.rb +350 -0
- data/rails/actionpack/test/dispatch/exception_wrapper_test.rb +97 -0
- data/rails/actionpack/test/dispatch/header_test.rb +139 -0
- data/rails/actionpack/test/dispatch/live_response_test.rb +94 -0
- data/rails/actionpack/test/dispatch/mapper_test.rb +112 -0
- data/rails/actionpack/test/dispatch/middleware_stack/middleware_test.rb +77 -0
- data/rails/actionpack/test/dispatch/middleware_stack_test.rb +117 -0
- data/rails/actionpack/test/dispatch/mime_type_test.rb +203 -0
- data/rails/actionpack/test/dispatch/mount_test.rb +93 -0
- data/rails/actionpack/test/dispatch/prefix_generation_test.rb +465 -0
- data/rails/actionpack/test/dispatch/rack_cache_test.rb +21 -0
- data/rails/actionpack/test/dispatch/reloader_test.rb +176 -0
- data/rails/actionpack/test/dispatch/request/json_params_parsing_test.rb +164 -0
- data/rails/actionpack/test/dispatch/request/multipart_params_parsing_test.rb +186 -0
- data/rails/actionpack/test/dispatch/request/query_string_parsing_test.rb +171 -0
- data/rails/actionpack/test/dispatch/request/session_test.rb +116 -0
- data/rails/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb +177 -0
- data/rails/actionpack/test/dispatch/request_id_test.rb +65 -0
- data/rails/actionpack/test/dispatch/request_test.rb +1159 -0
- data/rails/actionpack/test/dispatch/response_test.rb +344 -0
- data/rails/actionpack/test/dispatch/routing/concerns_test.rb +120 -0
- data/rails/actionpack/test/dispatch/routing/inspector_test.rb +326 -0
- data/rails/actionpack/test/dispatch/routing/route_set_test.rb +205 -0
- data/rails/actionpack/test/dispatch/routing_assertions_test.rb +131 -0
- data/rails/actionpack/test/dispatch/routing_test.rb +4475 -0
- data/rails/actionpack/test/dispatch/session/abstract_store_test.rb +56 -0
- data/rails/actionpack/test/dispatch/session/cache_store_test.rb +179 -0
- data/rails/actionpack/test/dispatch/session/cookie_store_test.rb +356 -0
- data/rails/actionpack/test/dispatch/session/mem_cache_store_test.rb +201 -0
- data/rails/actionpack/test/dispatch/session/test_session_test.rb +43 -0
- data/rails/actionpack/test/dispatch/show_exceptions_test.rb +115 -0
- data/rails/actionpack/test/dispatch/ssl_test.rb +219 -0
- data/rails/actionpack/test/dispatch/static_test.rb +239 -0
- data/rails/actionpack/test/dispatch/template_assertions_test.rb +110 -0
- data/rails/actionpack/test/dispatch/test_request_test.rb +99 -0
- data/rails/actionpack/test/dispatch/test_response_test.rb +21 -0
- data/rails/actionpack/test/dispatch/uploaded_file_test.rb +105 -0
- data/rails/actionpack/test/dispatch/url_generation_test.rb +134 -0
- data/rails/actionpack/test/fixtures/_top_level_partial_only.erb +1 -0
- data/rails/actionpack/test/fixtures/alternate_helpers/foo_helper.rb +3 -0
- data/rails/actionpack/test/fixtures/bad_customers/_bad_customer.html.erb +1 -0
- data/rails/actionpack/test/fixtures/company.rb +9 -0
- data/rails/actionpack/test/fixtures/filter_test/implicit_actions/edit.html.erb +1 -0
- data/rails/actionpack/test/fixtures/filter_test/implicit_actions/show.html.erb +1 -0
- data/rails/actionpack/test/fixtures/functional_caching/_partial.erb +3 -0
- data/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached.html.erb +3 -0
- data/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached.xml.builder +5 -0
- data/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached_with_variant.html+phone.erb +3 -0
- data/rails/actionpack/test/fixtures/functional_caching/fragment_cached.html.erb +3 -0
- data/rails/actionpack/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb +3 -0
- data/rails/actionpack/test/fixtures/functional_caching/html_fragment_cached_with_partial.html.erb +1 -0
- data/rails/actionpack/test/fixtures/functional_caching/inline_fragment_cached.html.erb +2 -0
- data/rails/actionpack/test/fixtures/helpers/abc_helper.rb +3 -0
- data/rails/actionpack/test/fixtures/helpers/fun/games_helper.rb +5 -0
- data/rails/actionpack/test/fixtures/helpers/fun/pdf_helper.rb +5 -0
- data/rails/actionpack/test/fixtures/helpers/just_me_helper.rb +3 -0
- data/rails/actionpack/test/fixtures/helpers/me_too_helper.rb +3 -0
- data/rails/actionpack/test/fixtures/helpers1_pack/pack1_helper.rb +5 -0
- data/rails/actionpack/test/fixtures/helpers2_pack/pack2_helper.rb +5 -0
- data/rails/actionpack/test/fixtures/helpers_typo/admin/users_helper.rb +5 -0
- data/rails/actionpack/test/fixtures/layouts/_customers.erb +1 -0
- data/rails/actionpack/test/fixtures/layouts/block_with_layout.erb +3 -0
- data/rails/actionpack/test/fixtures/layouts/builder.builder +3 -0
- data/rails/actionpack/test/fixtures/layouts/partial_with_layout.erb +3 -0
- data/rails/actionpack/test/fixtures/layouts/standard.html.erb +1 -0
- data/rails/actionpack/test/fixtures/layouts/talk_from_action.erb +2 -0
- data/rails/actionpack/test/fixtures/layouts/with_html_partial.html.erb +1 -0
- data/rails/actionpack/test/fixtures/layouts/xhr.html.erb +2 -0
- data/rails/actionpack/test/fixtures/layouts/yield.erb +2 -0
- data/rails/actionpack/test/fixtures/localized/hello_world.de.html +1 -0
- data/rails/actionpack/test/fixtures/localized/hello_world.en.html +1 -0
- data/rails/actionpack/test/fixtures/localized/hello_world.it.erb +1 -0
- data/rails/actionpack/test/fixtures/multipart/binary_file +0 -0
- data/rails/actionpack/test/fixtures/multipart/boundary_problem_file +10 -0
- data/rails/actionpack/test/fixtures/multipart/bracketed_param +5 -0
- data/rails/actionpack/test/fixtures/multipart/bracketed_utf8_param +5 -0
- data/rails/actionpack/test/fixtures/multipart/empty +10 -0
- data/rails/actionpack/test/fixtures/multipart/hello.txt +1 -0
- data/rails/actionpack/test/fixtures/multipart/large_text_file +10 -0
- data/rails/actionpack/test/fixtures/multipart/mixed_files +0 -0
- data/rails/actionpack/test/fixtures/multipart/mona_lisa.jpg +0 -0
- data/rails/actionpack/test/fixtures/multipart/none +9 -0
- data/rails/actionpack/test/fixtures/multipart/single_parameter +5 -0
- data/rails/actionpack/test/fixtures/multipart/single_utf8_param +5 -0
- data/rails/actionpack/test/fixtures/multipart/text_file +10 -0
- data/rails/actionpack/test/fixtures/old_content_type/render_default_content_types_for_respond_to.xml.erb +1 -0
- data/rails/actionpack/test/fixtures/old_content_type/render_default_for_builder.builder +1 -0
- data/rails/actionpack/test/fixtures/old_content_type/render_default_for_erb.erb +1 -0
- data/rails/actionpack/test/fixtures/post_test/layouts/post.html.erb +1 -0
- data/rails/actionpack/test/fixtures/post_test/layouts/super_post.iphone.erb +1 -0
- data/rails/actionpack/test/fixtures/post_test/post/index.html.erb +1 -0
- data/rails/actionpack/test/fixtures/post_test/post/index.iphone.erb +1 -0
- data/rails/actionpack/test/fixtures/post_test/super_post/index.html.erb +1 -0
- data/rails/actionpack/test/fixtures/post_test/super_post/index.iphone.erb +1 -0
- data/rails/actionpack/test/fixtures/public/400.html +1 -0
- data/rails/actionpack/test/fixtures/public/404.html +1 -0
- data/rails/actionpack/test/fixtures/public/500.da.html +1 -0
- data/rails/actionpack/test/fixtures/public/500.html +1 -0
- data/rails/actionpack/test/fixtures/public/bar/index.html +1 -0
- data/rails/actionpack/test/fixtures/public/bar.html +1 -0
- data/rails/actionpack/test/fixtures/public/foo/bar.html +1 -0
- data/rails/actionpack/test/fixtures/public/foo/baz.css +3 -0
- data/rails/actionpack/test/fixtures/public/foo/index.html +1 -0
- data/rails/actionpack/test/fixtures/public/foo//343/201/223/343/202/223/343/201/253/343/201/241/343/201/257.html +1 -0
- data/rails/actionpack/test/fixtures/public/gzip/application-a71b3024f80aea3181c09774ca17e712.js +4 -0
- data/rails/actionpack/test/fixtures/public/gzip/application-a71b3024f80aea3181c09774ca17e712.js.gz +0 -0
- data/rails/actionpack/test/fixtures/public/gzip/foo.zoo +4 -0
- data/rails/actionpack/test/fixtures/public/gzip/foo.zoo.gz +0 -0
- data/rails/actionpack/test/fixtures/public/index.html +1 -0
- data/rails/actionpack/test/fixtures/respond_to/all_types_with_layout.html.erb +1 -0
- data/rails/actionpack/test/fixtures/respond_to/custom_constant_handling_without_block.mobile.erb +1 -0
- data/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.html.erb +1 -0
- data/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.iphone.erb +1 -0
- data/rails/actionpack/test/fixtures/respond_to/layouts/missing.html.erb +1 -0
- data/rails/actionpack/test/fixtures/respond_to/layouts/standard.html.erb +1 -0
- data/rails/actionpack/test/fixtures/respond_to/layouts/standard.iphone.erb +1 -0
- data/rails/actionpack/test/fixtures/respond_to/using_defaults.html.erb +1 -0
- data/rails/actionpack/test/fixtures/respond_to/using_defaults.xml.builder +1 -0
- data/rails/actionpack/test/fixtures/respond_to/using_defaults_with_all.html.erb +1 -0
- data/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.html.erb +1 -0
- data/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder +1 -0
- data/rails/actionpack/test/fixtures/respond_to/variant_any_implicit_render.html+phablet.erb +1 -0
- data/rails/actionpack/test/fixtures/respond_to/variant_any_implicit_render.html+tablet.erb +1 -0
- data/rails/actionpack/test/fixtures/respond_to/variant_inline_syntax_without_block.html+phone.erb +1 -0
- data/rails/actionpack/test/fixtures/respond_to/variant_plus_none_for_format.html.erb +1 -0
- data/rails/actionpack/test/fixtures/respond_to/variant_with_implicit_rendering.html+mobile.erb +1 -0
- data/rails/actionpack/test/fixtures/ruby_template.ruby +2 -0
- data/rails/actionpack/test/fixtures/session_autoload_test/session_autoload_test/foo.rb +10 -0
- data/rails/actionpack/test/fixtures/shared.html.erb +1 -0
- data/rails/actionpack/test/fixtures/star_star_mime/index.js.erb +1 -0
- data/rails/actionpack/test/fixtures/symlink_parent/symlinked_layout.erb +5 -0
- data/rails/actionpack/test/fixtures/test/_partial.erb +1 -0
- data/rails/actionpack/test/fixtures/test/_partial.html.erb +1 -0
- data/rails/actionpack/test/fixtures/test/_partial.js.erb +1 -0
- data/rails/actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.erb +1 -0
- data/rails/actionpack/test/fixtures/test/formatted_xml_erb.builder +1 -0
- data/rails/actionpack/test/fixtures/test/formatted_xml_erb.html.erb +1 -0
- data/rails/actionpack/test/fixtures/test/formatted_xml_erb.xml.erb +1 -0
- data/rails/actionpack/test/fixtures/test/hello/hello.erb +1 -0
- data/rails/actionpack/test/fixtures/test/hello_world.erb +1 -0
- data/rails/actionpack/test/fixtures/test/hello_world_with_partial.html.erb +2 -0
- data/rails/actionpack/test/fixtures/test/hello_xml_world.builder +11 -0
- data/rails/actionpack/test/fixtures/test/implicit_content_type.atom.builder +2 -0
- data/rails/actionpack/test/fixtures/test/render_file_with_ivar.erb +1 -0
- data/rails/actionpack/test/fixtures/test/render_file_with_locals.erb +1 -0
- data/rails/actionpack/test/fixtures//345/205/254/345/205/261/bar/index.html +1 -0
- data/rails/actionpack/test/fixtures//345/205/254/345/205/261/bar.html +1 -0
- data/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/bar.html +1 -0
- data/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/baz.css +3 -0
- data/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/index.html +1 -0
- data/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo//343/201/223/343/202/223/343/201/253/343/201/241/343/201/257.html +1 -0
- data/rails/actionpack/test/fixtures//345/205/254/345/205/261/gzip/application-a71b3024f80aea3181c09774ca17e712.js +4 -0
- data/rails/actionpack/test/fixtures//345/205/254/345/205/261/gzip/application-a71b3024f80aea3181c09774ca17e712.js.gz +0 -0
- data/rails/actionpack/test/fixtures//345/205/254/345/205/261/gzip/foo.zoo +4 -0
- data/rails/actionpack/test/fixtures//345/205/254/345/205/261/gzip/foo.zoo.gz +0 -0
- data/rails/actionpack/test/fixtures//345/205/254/345/205/261/index.html +1 -0
- data/rails/actionpack/test/journey/gtg/builder_test.rb +79 -0
- data/rails/actionpack/test/journey/gtg/transition_table_test.rb +115 -0
- data/rails/actionpack/test/journey/nfa/simulator_test.rb +98 -0
- data/rails/actionpack/test/journey/nfa/transition_table_test.rb +72 -0
- data/rails/actionpack/test/journey/nodes/symbol_test.rb +17 -0
- data/rails/actionpack/test/journey/path/pattern_test.rb +284 -0
- data/rails/actionpack/test/journey/route/definition/parser_test.rb +110 -0
- data/rails/actionpack/test/journey/route/definition/scanner_test.rb +69 -0
- data/rails/actionpack/test/journey/route_test.rb +106 -0
- data/rails/actionpack/test/journey/router/utils_test.rb +38 -0
- data/rails/actionpack/test/journey/router_test.rb +622 -0
- data/rails/actionpack/test/journey/routes_test.rb +53 -0
- data/rails/actionpack/test/lib/controller/fake_controllers.rb +35 -0
- data/rails/actionpack/test/lib/controller/fake_models.rb +73 -0
- data/rails/actionpack/test/routing/helper_test.rb +45 -0
- data/rails/actionpack/test/tmp/.gitignore +0 -0
- data/rails/actionview/CHANGELOG.md +228 -0
- data/rails/actionview/MIT-LICENSE +21 -0
- data/rails/actionview/README.rdoc +39 -0
- data/rails/actionview/RUNNING_UNIT_TESTS.rdoc +27 -0
- data/rails/actionview/Rakefile +83 -0
- data/rails/actionview/actionview.gemspec +31 -0
- data/rails/actionview/lib/action_view/base.rb +205 -0
- data/rails/actionview/lib/action_view/buffers.rb +50 -0
- data/rails/actionview/lib/action_view/context.rb +36 -0
- data/rails/actionview/lib/action_view/dependency_tracker.rb +141 -0
- data/rails/actionview/lib/action_view/digestor.rb +122 -0
- data/rails/actionview/lib/action_view/flows.rb +76 -0
- data/rails/actionview/lib/action_view/gem_version.rb +15 -0
- data/rails/actionview/lib/action_view/helpers/active_model_helper.rb +49 -0
- data/rails/actionview/lib/action_view/helpers/asset_tag_helper.rb +329 -0
- data/rails/actionview/lib/action_view/helpers/asset_url_helper.rb +366 -0
- data/rails/actionview/lib/action_view/helpers/atom_feed_helper.rb +203 -0
- data/rails/actionview/lib/action_view/helpers/cache_helper.rb +200 -0
- data/rails/actionview/lib/action_view/helpers/capture_helper.rb +207 -0
- data/rails/actionview/lib/action_view/helpers/controller_helper.rb +25 -0
- data/rails/actionview/lib/action_view/helpers/csrf_helper.rb +33 -0
- data/rails/actionview/lib/action_view/helpers/date_helper.rb +1098 -0
- data/rails/actionview/lib/action_view/helpers/debug_helper.rb +35 -0
- data/rails/actionview/lib/action_view/helpers/form_helper.rb +1942 -0
- data/rails/actionview/lib/action_view/helpers/form_options_helper.rb +841 -0
- data/rails/actionview/lib/action_view/helpers/form_tag_helper.rb +877 -0
- data/rails/actionview/lib/action_view/helpers/javascript_helper.rb +81 -0
- data/rails/actionview/lib/action_view/helpers/number_helper.rb +432 -0
- data/rails/actionview/lib/action_view/helpers/output_safety_helper.rb +38 -0
- data/rails/actionview/lib/action_view/helpers/record_tag_helper.rb +108 -0
- data/rails/actionview/lib/action_view/helpers/rendering_helper.rb +98 -0
- data/rails/actionview/lib/action_view/helpers/sanitize_helper.rb +172 -0
- data/rails/actionview/lib/action_view/helpers/tag_helper.rb +188 -0
- data/rails/actionview/lib/action_view/helpers/tags/base.rb +155 -0
- data/rails/actionview/lib/action_view/helpers/tags/check_box.rb +64 -0
- data/rails/actionview/lib/action_view/helpers/tags/checkable.rb +16 -0
- data/rails/actionview/lib/action_view/helpers/tags/collection_check_boxes.rb +57 -0
- data/rails/actionview/lib/action_view/helpers/tags/collection_helpers.rb +85 -0
- data/rails/actionview/lib/action_view/helpers/tags/collection_radio_buttons.rb +36 -0
- data/rails/actionview/lib/action_view/helpers/tags/collection_select.rb +28 -0
- data/rails/actionview/lib/action_view/helpers/tags/color_field.rb +25 -0
- data/rails/actionview/lib/action_view/helpers/tags/date_field.rb +13 -0
- data/rails/actionview/lib/action_view/helpers/tags/date_select.rb +72 -0
- data/rails/actionview/lib/action_view/helpers/tags/datetime_field.rb +30 -0
- data/rails/actionview/lib/action_view/helpers/tags/datetime_local_field.rb +19 -0
- data/rails/actionview/lib/action_view/helpers/tags/datetime_select.rb +8 -0
- data/rails/actionview/lib/action_view/helpers/tags/email_field.rb +8 -0
- data/rails/actionview/lib/action_view/helpers/tags/file_field.rb +8 -0
- data/rails/actionview/lib/action_view/helpers/tags/grouped_collection_select.rb +29 -0
- data/rails/actionview/lib/action_view/helpers/tags/hidden_field.rb +8 -0
- data/rails/actionview/lib/action_view/helpers/tags/label.rb +79 -0
- data/rails/actionview/lib/action_view/helpers/tags/month_field.rb +13 -0
- data/rails/actionview/lib/action_view/helpers/tags/number_field.rb +18 -0
- data/rails/actionview/lib/action_view/helpers/tags/password_field.rb +12 -0
- data/rails/actionview/lib/action_view/helpers/tags/placeholderable.rb +22 -0
- data/rails/actionview/lib/action_view/helpers/tags/radio_button.rb +31 -0
- data/rails/actionview/lib/action_view/helpers/tags/range_field.rb +8 -0
- data/rails/actionview/lib/action_view/helpers/tags/search_field.rb +22 -0
- data/rails/actionview/lib/action_view/helpers/tags/select.rb +41 -0
- data/rails/actionview/lib/action_view/helpers/tags/tel_field.rb +8 -0
- data/rails/actionview/lib/action_view/helpers/tags/text_area.rb +22 -0
- data/rails/actionview/lib/action_view/helpers/tags/text_field.rb +33 -0
- data/rails/actionview/lib/action_view/helpers/tags/time_field.rb +13 -0
- data/rails/actionview/lib/action_view/helpers/tags/time_select.rb +8 -0
- data/rails/actionview/lib/action_view/helpers/tags/time_zone_select.rb +20 -0
- data/rails/actionview/lib/action_view/helpers/tags/translator.rb +40 -0
- data/rails/actionview/lib/action_view/helpers/tags/url_field.rb +8 -0
- data/rails/actionview/lib/action_view/helpers/tags/week_field.rb +13 -0
- data/rails/actionview/lib/action_view/helpers/tags.rb +42 -0
- data/rails/actionview/lib/action_view/helpers/text_helper.rb +467 -0
- data/rails/actionview/lib/action_view/helpers/translation_helper.rb +106 -0
- data/rails/actionview/lib/action_view/helpers/url_helper.rb +620 -0
- data/rails/actionview/lib/action_view/helpers.rb +64 -0
- data/rails/actionview/lib/action_view/layouts.rb +426 -0
- data/rails/actionview/lib/action_view/locale/en.yml +56 -0
- data/rails/actionview/lib/action_view/log_subscriber.rb +44 -0
- data/rails/actionview/lib/action_view/lookup_context.rb +255 -0
- data/rails/actionview/lib/action_view/model_naming.rb +12 -0
- data/rails/actionview/lib/action_view/path_set.rb +77 -0
- data/rails/actionview/lib/action_view/railtie.rb +49 -0
- data/rails/actionview/lib/action_view/record_identifier.rb +84 -0
- data/rails/actionview/lib/action_view/renderer/abstract_renderer.rb +49 -0
- data/rails/actionview/lib/action_view/renderer/partial_renderer.rb +548 -0
- data/rails/actionview/lib/action_view/renderer/renderer.rb +50 -0
- data/rails/actionview/lib/action_view/renderer/streaming_template_renderer.rb +103 -0
- data/rails/actionview/lib/action_view/renderer/template_renderer.rb +101 -0
- data/rails/actionview/lib/action_view/rendering.rb +146 -0
- data/rails/actionview/lib/action_view/routing_url_for.rb +134 -0
- data/rails/actionview/lib/action_view/tasks/dependencies.rake +21 -0
- data/rails/actionview/lib/action_view/template/error.rb +141 -0
- data/rails/actionview/lib/action_view/template/handlers/builder.rb +26 -0
- data/rails/actionview/lib/action_view/template/handlers/erb.rb +145 -0
- data/rails/actionview/lib/action_view/template/handlers/raw.rb +11 -0
- data/rails/actionview/lib/action_view/template/handlers.rb +62 -0
- data/rails/actionview/lib/action_view/template/html.rb +34 -0
- data/rails/actionview/lib/action_view/template/resolver.rb +349 -0
- data/rails/actionview/lib/action_view/template/text.rb +34 -0
- data/rails/actionview/lib/action_view/template/types.rb +57 -0
- data/rails/actionview/lib/action_view/template.rb +336 -0
- data/rails/actionview/lib/action_view/test_case.rb +278 -0
- data/rails/actionview/lib/action_view/testing/resolvers.rb +54 -0
- data/rails/actionview/lib/action_view/version.rb +8 -0
- data/rails/actionview/lib/action_view/view_paths.rb +111 -0
- data/rails/actionview/lib/action_view.rb +96 -0
- data/rails/actionview/test/abstract_unit.rb +345 -0
- data/rails/actionview/test/actionpack/abstract/abstract_controller_test.rb +310 -0
- data/rails/actionview/test/actionpack/abstract/helper_test.rb +127 -0
- data/rails/actionview/test/actionpack/abstract/layouts_test.rb +384 -0
- data/rails/actionview/test/actionpack/abstract/render_test.rb +103 -0
- data/rails/actionview/test/actionpack/abstract/views/abstract_controller/testing/me3/formatted.html.erb +1 -0
- data/rails/actionview/test/actionpack/abstract/views/abstract_controller/testing/me3/index.erb +1 -0
- data/rails/actionview/test/actionpack/abstract/views/abstract_controller/testing/me4/index.erb +1 -0
- data/rails/actionview/test/actionpack/abstract/views/abstract_controller/testing/me5/index.erb +1 -0
- data/rails/actionview/test/actionpack/abstract/views/action_with_ivars.erb +1 -0
- data/rails/actionview/test/actionpack/abstract/views/helper_test.erb +1 -0
- data/rails/actionview/test/actionpack/abstract/views/index.erb +1 -0
- data/rails/actionview/test/actionpack/abstract/views/layouts/abstract_controller/testing/me4.erb +1 -0
- data/rails/actionview/test/actionpack/abstract/views/layouts/application.erb +1 -0
- data/rails/actionview/test/actionpack/abstract/views/naked_render.erb +1 -0
- data/rails/actionview/test/actionpack/controller/capture_test.rb +81 -0
- data/rails/actionview/test/actionpack/controller/layout_test.rb +269 -0
- data/rails/actionview/test/actionpack/controller/render_test.rb +1344 -0
- data/rails/actionview/test/actionpack/controller/view_paths_test.rb +174 -0
- data/rails/actionview/test/active_record_unit.rb +91 -0
- data/rails/actionview/test/activerecord/controller_runtime_test.rb +93 -0
- data/rails/actionview/test/activerecord/debug_helper_test.rb +8 -0
- data/rails/actionview/test/activerecord/form_helper_activerecord_test.rb +92 -0
- data/rails/actionview/test/activerecord/polymorphic_routes_test.rb +733 -0
- data/rails/actionview/test/activerecord/render_partial_with_record_identification_test.rb +210 -0
- data/rails/actionview/test/fixtures/_top_level_partial.html.erb +1 -0
- data/rails/actionview/test/fixtures/_top_level_partial_only.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/bad_customers/_bad_customer.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/customers/_customer.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/fun/games/_form.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/fun/games/hello_world.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/good_customers/_good_customer.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/hello.html +1 -0
- data/rails/actionview/test/fixtures/actionpack/layout_tests/alt/layouts/alt.erb +0 -0
- data/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/controller_name_space/nested.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/item.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/layout_test.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/multiple_extensions.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/symlinked/symlinked_layout.erb +5 -0
- data/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/third_party_template_library.mab +1 -0
- data/rails/actionview/test/fixtures/actionpack/layout_tests/views/goodbye.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/layout_tests/views/hello.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/layouts/_column.html.erb +2 -0
- data/rails/actionview/test/fixtures/actionpack/layouts/_customers.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/layouts/_partial_and_yield.erb +2 -0
- data/rails/actionview/test/fixtures/actionpack/layouts/_yield_only.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/layouts/_yield_with_params.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/layouts/block_with_layout.erb +3 -0
- data/rails/actionview/test/fixtures/actionpack/layouts/builder.builder +3 -0
- data/rails/actionview/test/fixtures/actionpack/layouts/partial_with_layout.erb +3 -0
- data/rails/actionview/test/fixtures/actionpack/layouts/standard.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/layouts/streaming.erb +4 -0
- data/rails/actionview/test/fixtures/actionpack/layouts/talk_from_action.erb +2 -0
- data/rails/actionview/test/fixtures/actionpack/layouts/with_html_partial.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/layouts/xhr.html.erb +2 -0
- data/rails/actionview/test/fixtures/actionpack/layouts/yield.erb +2 -0
- data/rails/actionview/test/fixtures/actionpack/layouts/yield_with_render_inline_inside.erb +2 -0
- data/rails/actionview/test/fixtures/actionpack/layouts/yield_with_render_partial_inside.erb +2 -0
- data/rails/actionview/test/fixtures/actionpack/quiz/questions/_question.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/shared.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_changing_priority.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_changing_priority.json.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_counter.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_customer.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_customer_counter.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_customer_counter_with_as.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_customer_greeting.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_customer_iteration.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_customer_iteration_with_as.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_customer_with_var.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_directory/_partial_with_locales.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_first_json_partial.json.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_form.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_hash_greeting.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_hash_object.erb +2 -0
- data/rails/actionview/test/fixtures/actionpack/test/_hello.builder +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_json_change_priority.json.erb +0 -0
- data/rails/actionview/test/fixtures/actionpack/test/_labelling_form.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_layout_for_partial.html.erb +3 -0
- data/rails/actionview/test/fixtures/actionpack/test/_partial.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_partial.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_partial.js.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_partial_for_use_in_layout.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_partial_html_erb.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_partial_name_local_variable.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_partial_only.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_partial_only_html.html +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/_partial_with_partial.erb +2 -0
- data/rails/actionview/test/fixtures/actionpack/test/_person.erb +2 -0
- data/rails/actionview/test/fixtures/actionpack/test/_raise_indentation.html.erb +13 -0
- data/rails/actionview/test/fixtures/actionpack/test/_second_json_partial.json.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/action_talk_to_layout.erb +2 -0
- data/rails/actionview/test/fixtures/actionpack/test/calling_partial_with_layout.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/capturing.erb +4 -0
- data/rails/actionview/test/fixtures/actionpack/test/change_priority.html.erb +2 -0
- data/rails/actionview/test/fixtures/actionpack/test/content_for.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/content_for_concatenated.erb +3 -0
- data/rails/actionview/test/fixtures/actionpack/test/content_for_with_parameter.erb +2 -0
- data/rails/actionview/test/fixtures/actionpack/test/dot.directory/render_file_with_ivar.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/formatted_html_erb.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/formatted_xml_erb.builder +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/formatted_xml_erb.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/formatted_xml_erb.xml.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/greeting.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/greeting.xml.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/hello/hello.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/hello,world.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/hello.builder +4 -0
- data/rails/actionview/test/fixtures/actionpack/test/hello_world.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/hello_world_container.builder +3 -0
- data/rails/actionview/test/fixtures/actionpack/test/hello_world_from_rxml.builder +3 -0
- data/rails/actionview/test/fixtures/actionpack/test/hello_world_with_layout_false.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/hello_world_with_partial.html.erb +2 -0
- data/rails/actionview/test/fixtures/actionpack/test/hello_xml_world.builder +11 -0
- data/rails/actionview/test/fixtures/actionpack/test/html_template.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/hyphen-ated.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/implicit_content_type.atom.builder +2 -0
- data/rails/actionview/test/fixtures/actionpack/test/list.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/non_erb_block_content_for.builder +4 -0
- data/rails/actionview/test/fixtures/actionpack/test/potential_conflicts.erb +4 -0
- data/rails/actionview/test/fixtures/actionpack/test/proper_block_detection.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/render_file_from_template.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/render_file_with_ivar.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/render_file_with_locals.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/render_file_with_locals_and_default.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/render_implicit_html_template_from_xhr_request.da.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/render_implicit_html_template_from_xhr_request.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/render_implicit_js_template_without_layout.js.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/render_partial_inside_directory.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/render_to_string_test.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/render_two_partials.html.erb +2 -0
- data/rails/actionview/test/fixtures/actionpack/test/using_layout_around_block.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/with_html_partial.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/with_partial.html.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/with_partial.text.erb +1 -0
- data/rails/actionview/test/fixtures/actionpack/test/with_xml_template.html.erb +1 -0
- data/rails/actionview/test/fixtures/blog_public/.gitignore +1 -0
- data/rails/actionview/test/fixtures/blog_public/blog.html +1 -0
- data/rails/actionview/test/fixtures/blog_public/index.html +1 -0
- data/rails/actionview/test/fixtures/blog_public/subdir/index.html +1 -0
- data/rails/actionview/test/fixtures/comments/empty.de.html.erb +1 -0
- data/rails/actionview/test/fixtures/comments/empty.html.builder +1 -0
- data/rails/actionview/test/fixtures/comments/empty.html.erb +1 -0
- data/rails/actionview/test/fixtures/comments/empty.xml.erb +1 -0
- data/rails/actionview/test/fixtures/companies.yml +24 -0
- data/rails/actionview/test/fixtures/company.rb +9 -0
- data/rails/actionview/test/fixtures/custom_pattern/another.html.erb +1 -0
- data/rails/actionview/test/fixtures/custom_pattern/html/another.erb +1 -0
- data/rails/actionview/test/fixtures/custom_pattern/html/path.erb +1 -0
- data/rails/actionview/test/fixtures/customers/_customer.html.erb +1 -0
- data/rails/actionview/test/fixtures/customers/_customer.xml.erb +1 -0
- data/rails/actionview/test/fixtures/db_definitions/sqlite.sql +49 -0
- data/rails/actionview/test/fixtures/developer.rb +6 -0
- data/rails/actionview/test/fixtures/developers/_developer.erb +1 -0
- data/rails/actionview/test/fixtures/developers.yml +21 -0
- data/rails/actionview/test/fixtures/developers_projects.yml +13 -0
- data/rails/actionview/test/fixtures/digestor/comments/_comment.html.erb +1 -0
- data/rails/actionview/test/fixtures/digestor/comments/_comments.html.erb +1 -0
- data/rails/actionview/test/fixtures/digestor/events/_event.html.erb +0 -0
- data/rails/actionview/test/fixtures/digestor/level/_recursion.html.erb +1 -0
- data/rails/actionview/test/fixtures/digestor/level/below/_header.html.erb +0 -0
- data/rails/actionview/test/fixtures/digestor/level/below/index.html.erb +1 -0
- data/rails/actionview/test/fixtures/digestor/level/recursion.html.erb +1 -0
- data/rails/actionview/test/fixtures/digestor/messages/_form.html.erb +0 -0
- data/rails/actionview/test/fixtures/digestor/messages/_header.html.erb +0 -0
- data/rails/actionview/test/fixtures/digestor/messages/_message.html.erb +1 -0
- data/rails/actionview/test/fixtures/digestor/messages/actions/_move.html.erb +0 -0
- data/rails/actionview/test/fixtures/digestor/messages/edit.html.erb +5 -0
- data/rails/actionview/test/fixtures/digestor/messages/index.html.erb +2 -0
- data/rails/actionview/test/fixtures/digestor/messages/new.html+iphone.erb +15 -0
- data/rails/actionview/test/fixtures/digestor/messages/show.html.erb +14 -0
- data/rails/actionview/test/fixtures/fun/games/_game.erb +1 -0
- data/rails/actionview/test/fixtures/fun/games/hello_world.erb +1 -0
- data/rails/actionview/test/fixtures/fun/serious/games/_game.erb +1 -0
- data/rails/actionview/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb +3 -0
- data/rails/actionview/test/fixtures/games/_game.erb +1 -0
- data/rails/actionview/test/fixtures/good_customers/_good_customer.html.erb +1 -0
- data/rails/actionview/test/fixtures/happy_path/render_action/hello_world.erb +1 -0
- data/rails/actionview/test/fixtures/helpers/abc_helper.rb +3 -0
- data/rails/actionview/test/fixtures/helpers/helpery_test_helper.rb +5 -0
- data/rails/actionview/test/fixtures/helpers_missing/invalid_require_helper.rb +5 -0
- data/rails/actionview/test/fixtures/layout_tests/alt/hello.erb +1 -0
- data/rails/actionview/test/fixtures/layouts/_column.html.erb +2 -0
- data/rails/actionview/test/fixtures/layouts/_customers.erb +1 -0
- data/rails/actionview/test/fixtures/layouts/_partial_and_yield.erb +2 -0
- data/rails/actionview/test/fixtures/layouts/_yield_only.erb +1 -0
- data/rails/actionview/test/fixtures/layouts/_yield_with_params.erb +1 -0
- data/rails/actionview/test/fixtures/layouts/streaming.erb +4 -0
- data/rails/actionview/test/fixtures/layouts/yield.erb +2 -0
- data/rails/actionview/test/fixtures/layouts/yield_with_render_inline_inside.erb +2 -0
- data/rails/actionview/test/fixtures/layouts/yield_with_render_partial_inside.erb +2 -0
- data/rails/actionview/test/fixtures/mascot.rb +3 -0
- data/rails/actionview/test/fixtures/mascots/_mascot.html.erb +1 -0
- data/rails/actionview/test/fixtures/mascots.yml +4 -0
- data/rails/actionview/test/fixtures/multipart/bracketed_utf8_param +5 -0
- data/rails/actionview/test/fixtures/multipart/single_utf8_param +5 -0
- data/rails/actionview/test/fixtures/override/test/hello_world.erb +1 -0
- data/rails/actionview/test/fixtures/override2/layouts/test/sub.erb +1 -0
- data/rails/actionview/test/fixtures/plain_text.raw +1 -0
- data/rails/actionview/test/fixtures/plain_text_with_characters.raw +1 -0
- data/rails/actionview/test/fixtures/project.rb +3 -0
- data/rails/actionview/test/fixtures/projects/_project.erb +1 -0
- data/rails/actionview/test/fixtures/projects.yml +7 -0
- data/rails/actionview/test/fixtures/public/.gitignore +1 -0
- data/rails/actionview/test/fixtures/public/elsewhere/cools.js +1 -0
- data/rails/actionview/test/fixtures/public/elsewhere/file.css +1 -0
- data/rails/actionview/test/fixtures/public/foo/baz.css +3 -0
- data/rails/actionview/test/fixtures/public/javascripts/application.js +1 -0
- data/rails/actionview/test/fixtures/public/javascripts/bank.js +1 -0
- data/rails/actionview/test/fixtures/public/javascripts/common.javascript +1 -0
- data/rails/actionview/test/fixtures/public/javascripts/controls.js +1 -0
- data/rails/actionview/test/fixtures/public/javascripts/dragdrop.js +1 -0
- data/rails/actionview/test/fixtures/public/javascripts/effects.js +1 -0
- data/rails/actionview/test/fixtures/public/javascripts/prototype.js +1 -0
- data/rails/actionview/test/fixtures/public/javascripts/robber.js +1 -0
- data/rails/actionview/test/fixtures/public/javascripts/subdir/subdir.js +1 -0
- data/rails/actionview/test/fixtures/public/javascripts/version.1.0.js +1 -0
- data/rails/actionview/test/fixtures/public/stylesheets/bank.css +1 -0
- data/rails/actionview/test/fixtures/public/stylesheets/random.styles +1 -0
- data/rails/actionview/test/fixtures/public/stylesheets/robber.css +1 -0
- data/rails/actionview/test/fixtures/public/stylesheets/subdir/subdir.css +1 -0
- data/rails/actionview/test/fixtures/public/stylesheets/version.1.0.css +1 -0
- data/rails/actionview/test/fixtures/replies/_reply.erb +1 -0
- data/rails/actionview/test/fixtures/replies.yml +15 -0
- data/rails/actionview/test/fixtures/reply.rb +7 -0
- data/rails/actionview/test/fixtures/respond_to/using_defaults_with_all.html.erb +1 -0
- data/rails/actionview/test/fixtures/ruby_template.ruby +2 -0
- data/rails/actionview/test/fixtures/scope/test/modgreet.erb +1 -0
- data/rails/actionview/test/fixtures/shared.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/_200.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/_b_layout_for_partial.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/_b_layout_for_partial_with_object.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/_changing_priority.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/_changing_priority.json.erb +1 -0
- data/rails/actionview/test/fixtures/test/_content_tag_nested_in_content_tag.erb +3 -0
- data/rails/actionview/test/fixtures/test/_counter.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/_customer.erb +1 -0
- data/rails/actionview/test/fixtures/test/_customer_greeting.erb +1 -0
- data/rails/actionview/test/fixtures/test/_customer_with_var.erb +1 -0
- data/rails/actionview/test/fixtures/test/_directory/_partial_with_locales.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/_first_json_partial.json.erb +1 -0
- data/rails/actionview/test/fixtures/test/_from_helper.erb +1 -0
- data/rails/actionview/test/fixtures/test/_json_change_priority.json.erb +0 -0
- data/rails/actionview/test/fixtures/test/_label_with_block.erb +4 -0
- data/rails/actionview/test/fixtures/test/_layout_for_block_with_args.html.erb +3 -0
- data/rails/actionview/test/fixtures/test/_layout_for_partial.html.erb +3 -0
- data/rails/actionview/test/fixtures/test/_layout_with_partial_and_yield.html.erb +4 -0
- data/rails/actionview/test/fixtures/test/_local_inspector.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/_object_inspector.erb +1 -0
- data/rails/actionview/test/fixtures/test/_one.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/_partial.erb +1 -0
- data/rails/actionview/test/fixtures/test/_partial.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/_partial.js.erb +1 -0
- data/rails/actionview/test/fixtures/test/_partial_for_use_in_layout.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/_partial_name_local_variable.erb +1 -0
- data/rails/actionview/test/fixtures/test/_partial_only.erb +1 -0
- data/rails/actionview/test/fixtures/test/_partial_with_layout.erb +2 -0
- data/rails/actionview/test/fixtures/test/_partial_with_layout_block_content.erb +4 -0
- data/rails/actionview/test/fixtures/test/_partial_with_layout_block_partial.erb +4 -0
- data/rails/actionview/test/fixtures/test/_partial_with_only_html_version.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/_partial_with_partial.erb +2 -0
- data/rails/actionview/test/fixtures/test/_raise.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/_raise_indentation.html.erb +13 -0
- data/rails/actionview/test/fixtures/test/_second_json_partial.json.erb +1 -0
- data/rails/actionview/test/fixtures/test/_two.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/_utf8_partial.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/_utf8_partial_magic.html.erb +2 -0
- data/rails/actionview/test/fixtures/test/basic.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/calling_partial_with_layout.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/change_priority.html.erb +2 -0
- data/rails/actionview/test/fixtures/test/dont_pick_me +1 -0
- data/rails/actionview/test/fixtures/test/dot.directory/render_file_with_ivar.erb +1 -0
- data/rails/actionview/test/fixtures/test/greeting.xml.erb +1 -0
- data/rails/actionview/test/fixtures/test/hello/hello.erb +1 -0
- data/rails/actionview/test/fixtures/test/hello.builder +4 -0
- data/rails/actionview/test/fixtures/test/hello_world.da.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/hello_world.erb +1 -0
- data/rails/actionview/test/fixtures/test/hello_world.erb~ +1 -0
- data/rails/actionview/test/fixtures/test/hello_world.html+phone.erb +1 -0
- data/rails/actionview/test/fixtures/test/hello_world.pt-BR.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/hello_world.text+phone.erb +1 -0
- data/rails/actionview/test/fixtures/test/hello_world_with_partial.html.erb +2 -0
- data/rails/actionview/test/fixtures/test/html_template.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/layout_render_file.erb +2 -0
- data/rails/actionview/test/fixtures/test/layout_render_object.erb +1 -0
- data/rails/actionview/test/fixtures/test/list.erb +1 -0
- data/rails/actionview/test/fixtures/test/malformed/malformed.en.html.erb~ +1 -0
- data/rails/actionview/test/fixtures/test/malformed/malformed.erb~ +1 -0
- data/rails/actionview/test/fixtures/test/malformed/malformed.html.erb~ +1 -0
- data/rails/actionview/test/fixtures/test/malformed/malformed~ +1 -0
- data/rails/actionview/test/fixtures/test/nested_layout.erb +3 -0
- data/rails/actionview/test/fixtures/test/nested_streaming.erb +3 -0
- data/rails/actionview/test/fixtures/test/nil_return.erb +1 -0
- data/rails/actionview/test/fixtures/test/one.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/render_file_with_ivar.erb +1 -0
- data/rails/actionview/test/fixtures/test/render_file_with_locals.erb +1 -0
- data/rails/actionview/test/fixtures/test/render_file_with_locals_and_default.erb +1 -0
- data/rails/actionview/test/fixtures/test/render_partial_inside_directory.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/render_two_partials.html.erb +2 -0
- data/rails/actionview/test/fixtures/test/streaming.erb +3 -0
- data/rails/actionview/test/fixtures/test/streaming_buster.erb +3 -0
- data/rails/actionview/test/fixtures/test/sub_template_raise.html.erb +1 -0
- data/rails/actionview/test/fixtures/test/template.erb +1 -0
- data/rails/actionview/test/fixtures/test/update_element_with_capture.erb +9 -0
- data/rails/actionview/test/fixtures/test/utf8.html.erb +4 -0
- data/rails/actionview/test/fixtures/test/utf8_magic.html.erb +5 -0
- data/rails/actionview/test/fixtures/test/utf8_magic_with_bare_partial.html.erb +5 -0
- data/rails/actionview/test/fixtures/topic.rb +3 -0
- data/rails/actionview/test/fixtures/topics/_topic.html.erb +1 -0
- data/rails/actionview/test/fixtures/topics.yml +22 -0
- data/rails/actionview/test/fixtures/translations/templates/array.erb +1 -0
- data/rails/actionview/test/fixtures/translations/templates/default.erb +1 -0
- data/rails/actionview/test/fixtures/translations/templates/found.erb +1 -0
- data/rails/actionview/test/fixtures/translations/templates/missing.erb +1 -0
- data/rails/actionview/test/fixtures/with_format.json.erb +1 -0
- data/rails/actionview/test/lib/controller/fake_models.rb +201 -0
- data/rails/actionview/test/template/active_model_helper_test.rb +99 -0
- data/rails/actionview/test/template/asset_tag_helper_test.rb +796 -0
- data/rails/actionview/test/template/atom_feed_helper_test.rb +349 -0
- data/rails/actionview/test/template/capture_helper_test.rb +219 -0
- data/rails/actionview/test/template/compiled_templates_test.rb +59 -0
- data/rails/actionview/test/template/date_helper_i18n_test.rb +148 -0
- data/rails/actionview/test/template/date_helper_test.rb +3228 -0
- data/rails/actionview/test/template/dependency_tracker_test.rb +196 -0
- data/rails/actionview/test/template/digestor_test.rb +312 -0
- data/rails/actionview/test/template/erb/form_for_test.rb +11 -0
- data/rails/actionview/test/template/erb/helper.rb +24 -0
- data/rails/actionview/test/template/erb/tag_helper_test.rb +30 -0
- data/rails/actionview/test/template/erb_util_test.rb +107 -0
- data/rails/actionview/test/template/form_collections_helper_test.rb +459 -0
- data/rails/actionview/test/template/form_helper_test.rb +3461 -0
- data/rails/actionview/test/template/form_options_helper_i18n_test.rb +27 -0
- data/rails/actionview/test/template/form_options_helper_test.rb +1358 -0
- data/rails/actionview/test/template/form_tag_helper_test.rb +656 -0
- data/rails/actionview/test/template/html_test.rb +17 -0
- data/rails/actionview/test/template/javascript_helper_test.rb +69 -0
- data/rails/actionview/test/template/log_subscriber_test.rb +91 -0
- data/rails/actionview/test/template/lookup_context_test.rb +282 -0
- data/rails/actionview/test/template/number_helper_test.rb +197 -0
- data/rails/actionview/test/template/output_safety_helper_test.rb +35 -0
- data/rails/actionview/test/template/partial_iteration_test.rb +33 -0
- data/rails/actionview/test/template/record_identifier_test.rb +49 -0
- data/rails/actionview/test/template/record_tag_helper_test.rb +117 -0
- data/rails/actionview/test/template/render_test.rb +600 -0
- data/rails/actionview/test/template/resolver_patterns_test.rb +31 -0
- data/rails/actionview/test/template/sanitize_helper_test.rb +35 -0
- data/rails/actionview/test/template/streaming_render_test.rb +108 -0
- data/rails/actionview/test/template/tag_helper_test.rb +166 -0
- data/rails/actionview/test/template/template_error_test.rb +20 -0
- data/rails/actionview/test/template/template_test.rb +200 -0
- data/rails/actionview/test/template/test_case_test.rb +378 -0
- data/rails/actionview/test/template/test_test.rb +92 -0
- data/rails/actionview/test/template/testing/fixture_resolver_test.rb +18 -0
- data/rails/actionview/test/template/testing/null_resolver_test.rb +12 -0
- data/rails/actionview/test/template/text_helper_test.rb +510 -0
- data/rails/actionview/test/template/text_test.rb +17 -0
- data/rails/actionview/test/template/translation_helper_test.rb +193 -0
- data/rails/actionview/test/template/url_helper_test.rb +798 -0
- data/rails/actionview/test/tmp/.gitkeep +0 -0
- data/rails/activejob/.gitignore +1 -0
- data/rails/activejob/CHANGELOG.md +7 -0
- data/rails/activejob/MIT-LICENSE +21 -0
- data/rails/activejob/README.md +131 -0
- data/rails/activejob/Rakefile +90 -0
- data/rails/activejob/activejob.gemspec +23 -0
- data/rails/activejob/lib/active_job/arguments.rb +144 -0
- data/rails/activejob/lib/active_job/base.rb +66 -0
- data/rails/activejob/lib/active_job/callbacks.rb +146 -0
- data/rails/activejob/lib/active_job/configured_job.rb +16 -0
- data/rails/activejob/lib/active_job/core.rb +88 -0
- data/rails/activejob/lib/active_job/enqueuing.rb +77 -0
- data/rails/activejob/lib/active_job/execution.rb +42 -0
- data/rails/activejob/lib/active_job/gem_version.rb +15 -0
- data/rails/activejob/lib/active_job/logging.rb +107 -0
- data/rails/activejob/lib/active_job/queue_adapter.rb +35 -0
- data/rails/activejob/lib/active_job/queue_adapters/backburner_adapter.rb +36 -0
- data/rails/activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb +39 -0
- data/rails/activejob/lib/active_job/queue_adapters/inline_adapter.rb +23 -0
- data/rails/activejob/lib/active_job/queue_adapters/qu_adapter.rb +42 -0
- data/rails/activejob/lib/active_job/queue_adapters/que_adapter.rb +35 -0
- data/rails/activejob/lib/active_job/queue_adapters/queue_classic_adapter.rb +54 -0
- data/rails/activejob/lib/active_job/queue_adapters/resque_adapter.rb +52 -0
- data/rails/activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb +45 -0
- data/rails/activejob/lib/active_job/queue_adapters/sneakers_adapter.rb +46 -0
- data/rails/activejob/lib/active_job/queue_adapters/sucker_punch_adapter.rb +40 -0
- data/rails/activejob/lib/active_job/queue_adapters/test_adapter.rb +51 -0
- data/rails/activejob/lib/active_job/queue_adapters.rb +52 -0
- data/rails/activejob/lib/active_job/queue_name.rb +51 -0
- data/rails/activejob/lib/active_job/railtie.rb +23 -0
- data/rails/activejob/lib/active_job/test_case.rb +7 -0
- data/rails/activejob/lib/active_job/test_helper.rb +230 -0
- data/rails/activejob/lib/active_job/version.rb +8 -0
- data/rails/activejob/lib/active_job.rb +37 -0
- data/rails/activejob/lib/rails/generators/job/job_generator.rb +24 -0
- data/rails/activejob/lib/rails/generators/job/templates/job.rb +9 -0
- data/rails/activejob/test/adapters/backburner.rb +3 -0
- data/rails/activejob/test/adapters/delayed_job.rb +7 -0
- data/rails/activejob/test/adapters/inline.rb +1 -0
- data/rails/activejob/test/adapters/qu.rb +3 -0
- data/rails/activejob/test/adapters/que.rb +4 -0
- data/rails/activejob/test/adapters/queue_classic.rb +2 -0
- data/rails/activejob/test/adapters/resque.rb +2 -0
- data/rails/activejob/test/adapters/sidekiq.rb +2 -0
- data/rails/activejob/test/adapters/sneakers.rb +2 -0
- data/rails/activejob/test/adapters/sucker_punch.rb +2 -0
- data/rails/activejob/test/adapters/test.rb +3 -0
- data/rails/activejob/test/cases/adapter_test.rb +7 -0
- data/rails/activejob/test/cases/argument_serialization_test.rb +105 -0
- data/rails/activejob/test/cases/callbacks_test.rb +23 -0
- data/rails/activejob/test/cases/job_serialization_test.rb +15 -0
- data/rails/activejob/test/cases/logging_test.rb +114 -0
- data/rails/activejob/test/cases/queue_naming_test.rb +102 -0
- data/rails/activejob/test/cases/queuing_test.rb +44 -0
- data/rails/activejob/test/cases/rescue_test.rb +34 -0
- data/rails/activejob/test/cases/test_case_test.rb +14 -0
- data/rails/activejob/test/cases/test_helper_test.rb +265 -0
- data/rails/activejob/test/helper.rb +30 -0
- data/rails/activejob/test/integration/queuing_test.rb +47 -0
- data/rails/activejob/test/jobs/callback_job.rb +29 -0
- data/rails/activejob/test/jobs/gid_job.rb +8 -0
- data/rails/activejob/test/jobs/hello_job.rb +7 -0
- data/rails/activejob/test/jobs/kwargs_job.rb +7 -0
- data/rails/activejob/test/jobs/logging_job.rb +10 -0
- data/rails/activejob/test/jobs/nested_job.rb +10 -0
- data/rails/activejob/test/jobs/rescue_job.rb +27 -0
- data/rails/activejob/test/models/person.rb +20 -0
- data/rails/activejob/test/support/backburner/inline.rb +8 -0
- data/rails/activejob/test/support/delayed_job/delayed/backend/test.rb +113 -0
- data/rails/activejob/test/support/delayed_job/delayed/serialization/test.rb +0 -0
- data/rails/activejob/test/support/integration/adapters/backburner.rb +38 -0
- data/rails/activejob/test/support/integration/adapters/delayed_job.rb +20 -0
- data/rails/activejob/test/support/integration/adapters/inline.rb +15 -0
- data/rails/activejob/test/support/integration/adapters/qu.rb +38 -0
- data/rails/activejob/test/support/integration/adapters/que.rb +37 -0
- data/rails/activejob/test/support/integration/adapters/queue_classic.rb +39 -0
- data/rails/activejob/test/support/integration/adapters/resque.rb +49 -0
- data/rails/activejob/test/support/integration/adapters/sidekiq.rb +57 -0
- data/rails/activejob/test/support/integration/adapters/sneakers.rb +90 -0
- data/rails/activejob/test/support/integration/adapters/sucker_punch.rb +6 -0
- data/rails/activejob/test/support/integration/dummy_app_template.rb +27 -0
- data/rails/activejob/test/support/integration/helper.rb +30 -0
- data/rails/activejob/test/support/integration/jobs_manager.rb +27 -0
- data/rails/activejob/test/support/integration/test_case_helpers.rb +48 -0
- data/rails/activejob/test/support/job_buffer.rb +19 -0
- data/rails/activejob/test/support/que/inline.rb +9 -0
- data/rails/activejob/test/support/queue_classic/inline.rb +23 -0
- data/rails/activejob/test/support/sneakers/inline.rb +12 -0
- data/rails/activemodel/CHANGELOG.md +61 -0
- data/rails/activemodel/MIT-LICENSE +21 -0
- data/rails/activemodel/README.rdoc +272 -0
- data/rails/activemodel/Rakefile +36 -0
- data/rails/activemodel/activemodel.gemspec +24 -0
- data/rails/activemodel/lib/active_model/attribute_methods.rb +478 -0
- data/rails/activemodel/lib/active_model/callbacks.rb +149 -0
- data/rails/activemodel/lib/active_model/conversion.rb +100 -0
- data/rails/activemodel/lib/active_model/dirty.rb +267 -0
- data/rails/activemodel/lib/active_model/errors.rb +475 -0
- data/rails/activemodel/lib/active_model/forbidden_attributes_protection.rb +28 -0
- data/rails/activemodel/lib/active_model/gem_version.rb +15 -0
- data/rails/activemodel/lib/active_model/lint.rb +113 -0
- data/rails/activemodel/lib/active_model/locale/en.yml +35 -0
- data/rails/activemodel/lib/active_model/model.rb +99 -0
- data/rails/activemodel/lib/active_model/naming.rb +316 -0
- data/rails/activemodel/lib/active_model/railtie.rb +12 -0
- data/rails/activemodel/lib/active_model/secure_password.rb +134 -0
- data/rails/activemodel/lib/active_model/serialization.rb +163 -0
- data/rails/activemodel/lib/active_model/serializers/json.rb +145 -0
- data/rails/activemodel/lib/active_model/serializers/xml.rb +238 -0
- data/rails/activemodel/lib/active_model/test_case.rb +4 -0
- data/rails/activemodel/lib/active_model/translation.rb +69 -0
- data/rails/activemodel/lib/active_model/validations/absence.rb +31 -0
- data/rails/activemodel/lib/active_model/validations/acceptance.rb +55 -0
- data/rails/activemodel/lib/active_model/validations/callbacks.rb +117 -0
- data/rails/activemodel/lib/active_model/validations/clusivity.rb +51 -0
- data/rails/activemodel/lib/active_model/validations/confirmation.rb +67 -0
- data/rails/activemodel/lib/active_model/validations/exclusion.rb +46 -0
- data/rails/activemodel/lib/active_model/validations/format.rb +113 -0
- data/rails/activemodel/lib/active_model/validations/inclusion.rb +46 -0
- data/rails/activemodel/lib/active_model/validations/length.rb +126 -0
- data/rails/activemodel/lib/active_model/validations/numericality.rb +159 -0
- data/rails/activemodel/lib/active_model/validations/presence.rb +39 -0
- data/rails/activemodel/lib/active_model/validations/validates.rb +173 -0
- data/rails/activemodel/lib/active_model/validations/with.rb +153 -0
- data/rails/activemodel/lib/active_model/validations.rb +401 -0
- data/rails/activemodel/lib/active_model/validator.rb +182 -0
- data/rails/activemodel/lib/active_model/version.rb +8 -0
- data/rails/activemodel/lib/active_model.rb +71 -0
- data/rails/activemodel/test/cases/attribute_methods_test.rb +281 -0
- data/rails/activemodel/test/cases/callbacks_test.rb +114 -0
- data/rails/activemodel/test/cases/conversion_test.rb +50 -0
- data/rails/activemodel/test/cases/dirty_test.rb +228 -0
- data/rails/activemodel/test/cases/errors_test.rb +326 -0
- data/rails/activemodel/test/cases/forbidden_attributes_protection_test.rb +36 -0
- data/rails/activemodel/test/cases/helper.rb +20 -0
- data/rails/activemodel/test/cases/lint_test.rb +20 -0
- data/rails/activemodel/test/cases/model_test.rb +75 -0
- data/rails/activemodel/test/cases/naming_test.rb +280 -0
- data/rails/activemodel/test/cases/railtie_test.rb +32 -0
- data/rails/activemodel/test/cases/secure_password_test.rb +218 -0
- data/rails/activemodel/test/cases/serialization_test.rb +168 -0
- data/rails/activemodel/test/cases/serializers/json_serialization_test.rb +198 -0
- data/rails/activemodel/test/cases/serializers/xml_serialization_test.rb +250 -0
- data/rails/activemodel/test/cases/translation_test.rb +108 -0
- data/rails/activemodel/test/cases/validations/absence_validation_test.rb +68 -0
- data/rails/activemodel/test/cases/validations/acceptance_validation_test.rb +68 -0
- data/rails/activemodel/test/cases/validations/callbacks_test.rb +98 -0
- data/rails/activemodel/test/cases/validations/conditional_validation_test.rb +139 -0
- data/rails/activemodel/test/cases/validations/confirmation_validation_test.rb +108 -0
- data/rails/activemodel/test/cases/validations/exclusion_validation_test.rb +92 -0
- data/rails/activemodel/test/cases/validations/format_validation_test.rb +149 -0
- data/rails/activemodel/test/cases/validations/i18n_generate_message_validation_test.rb +150 -0
- data/rails/activemodel/test/cases/validations/i18n_validation_test.rb +373 -0
- data/rails/activemodel/test/cases/validations/inclusion_validation_test.rb +147 -0
- data/rails/activemodel/test/cases/validations/length_validation_test.rb +424 -0
- data/rails/activemodel/test/cases/validations/numericality_validation_test.rb +211 -0
- data/rails/activemodel/test/cases/validations/presence_validation_test.rb +107 -0
- data/rails/activemodel/test/cases/validations/validates_test.rb +158 -0
- data/rails/activemodel/test/cases/validations/validations_context_test.rb +50 -0
- data/rails/activemodel/test/cases/validations/with_validation_test.rb +172 -0
- data/rails/activemodel/test/cases/validations_test.rb +429 -0
- data/rails/activemodel/test/config.rb +3 -0
- data/rails/activemodel/test/models/account.rb +5 -0
- data/rails/activemodel/test/models/blog_post.rb +9 -0
- data/rails/activemodel/test/models/contact.rb +41 -0
- data/rails/activemodel/test/models/custom_reader.rb +15 -0
- data/rails/activemodel/test/models/helicopter.rb +7 -0
- data/rails/activemodel/test/models/person.rb +17 -0
- data/rails/activemodel/test/models/person_with_validator.rb +24 -0
- data/rails/activemodel/test/models/project.rb +3 -0
- data/rails/activemodel/test/models/reply.rb +32 -0
- data/rails/activemodel/test/models/sheep.rb +3 -0
- data/rails/activemodel/test/models/topic.rb +40 -0
- data/rails/activemodel/test/models/track_back.rb +11 -0
- data/rails/activemodel/test/models/user.rb +10 -0
- data/rails/activemodel/test/models/visitor.rb +10 -0
- data/rails/activemodel/test/validators/email_validator.rb +6 -0
- data/rails/activemodel/test/validators/namespace/email_validator.rb +6 -0
- data/rails/activerecord/CHANGELOG.md +1568 -0
- data/rails/activerecord/MIT-LICENSE +20 -0
- data/rails/activerecord/README.rdoc +218 -0
- data/rails/activerecord/RUNNING_UNIT_TESTS.rdoc +44 -0
- data/rails/activerecord/Rakefile +168 -0
- data/rails/activerecord/activerecord.gemspec +28 -0
- data/rails/activerecord/examples/.gitignore +1 -0
- data/rails/activerecord/examples/performance.rb +184 -0
- data/rails/activerecord/examples/simple.rb +14 -0
- data/rails/activerecord/lib/active_record/aggregations.rb +266 -0
- data/rails/activerecord/lib/active_record/association_relation.rb +22 -0
- data/rails/activerecord/lib/active_record/associations/alias_tracker.rb +87 -0
- data/rails/activerecord/lib/active_record/associations/association.rb +253 -0
- data/rails/activerecord/lib/active_record/associations/association_scope.rb +194 -0
- data/rails/activerecord/lib/active_record/associations/belongs_to_association.rb +115 -0
- data/rails/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb +40 -0
- data/rails/activerecord/lib/active_record/associations/builder/association.rb +149 -0
- data/rails/activerecord/lib/active_record/associations/builder/belongs_to.rb +116 -0
- data/rails/activerecord/lib/active_record/associations/builder/collection_association.rb +95 -0
- data/rails/activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb +124 -0
- data/rails/activerecord/lib/active_record/associations/builder/has_many.rb +15 -0
- data/rails/activerecord/lib/active_record/associations/builder/has_one.rb +23 -0
- data/rails/activerecord/lib/active_record/associations/builder/singular_association.rb +38 -0
- data/rails/activerecord/lib/active_record/associations/collection_association.rb +639 -0
- data/rails/activerecord/lib/active_record/associations/collection_proxy.rb +1028 -0
- data/rails/activerecord/lib/active_record/associations/foreign_association.rb +11 -0
- data/rails/activerecord/lib/active_record/associations/has_many_association.rb +192 -0
- data/rails/activerecord/lib/active_record/associations/has_many_through_association.rb +238 -0
- data/rails/activerecord/lib/active_record/associations/has_one_association.rb +106 -0
- data/rails/activerecord/lib/active_record/associations/has_one_through_association.rb +36 -0
- data/rails/activerecord/lib/active_record/associations/join_dependency/join_association.rb +122 -0
- data/rails/activerecord/lib/active_record/associations/join_dependency/join_base.rb +22 -0
- data/rails/activerecord/lib/active_record/associations/join_dependency/join_part.rb +71 -0
- data/rails/activerecord/lib/active_record/associations/join_dependency.rb +282 -0
- data/rails/activerecord/lib/active_record/associations/preloader/association.rb +162 -0
- data/rails/activerecord/lib/active_record/associations/preloader/belongs_to.rb +17 -0
- data/rails/activerecord/lib/active_record/associations/preloader/collection_association.rb +24 -0
- data/rails/activerecord/lib/active_record/associations/preloader/has_many.rb +17 -0
- data/rails/activerecord/lib/active_record/associations/preloader/has_many_through.rb +19 -0
- data/rails/activerecord/lib/active_record/associations/preloader/has_one.rb +23 -0
- data/rails/activerecord/lib/active_record/associations/preloader/has_one_through.rb +9 -0
- data/rails/activerecord/lib/active_record/associations/preloader/singular_association.rb +21 -0
- data/rails/activerecord/lib/active_record/associations/preloader/through_association.rb +96 -0
- data/rails/activerecord/lib/active_record/associations/preloader.rb +203 -0
- data/rails/activerecord/lib/active_record/associations/singular_association.rb +86 -0
- data/rails/activerecord/lib/active_record/associations/through_association.rb +107 -0
- data/rails/activerecord/lib/active_record/associations.rb +1725 -0
- data/rails/activerecord/lib/active_record/attribute.rb +163 -0
- data/rails/activerecord/lib/active_record/attribute_assignment.rb +212 -0
- data/rails/activerecord/lib/active_record/attribute_decorators.rb +66 -0
- data/rails/activerecord/lib/active_record/attribute_methods/before_type_cast.rb +76 -0
- data/rails/activerecord/lib/active_record/attribute_methods/dirty.rb +185 -0
- data/rails/activerecord/lib/active_record/attribute_methods/primary_key.rb +128 -0
- data/rails/activerecord/lib/active_record/attribute_methods/query.rb +40 -0
- data/rails/activerecord/lib/active_record/attribute_methods/read.rb +103 -0
- data/rails/activerecord/lib/active_record/attribute_methods/serialization.rb +70 -0
- data/rails/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb +69 -0
- data/rails/activerecord/lib/active_record/attribute_methods/write.rb +83 -0
- data/rails/activerecord/lib/active_record/attribute_methods.rb +439 -0
- data/rails/activerecord/lib/active_record/attribute_set/builder.rb +96 -0
- data/rails/activerecord/lib/active_record/attribute_set.rb +77 -0
- data/rails/activerecord/lib/active_record/attributes.rb +146 -0
- data/rails/activerecord/lib/active_record/autosave_association.rb +454 -0
- data/rails/activerecord/lib/active_record/base.rb +317 -0
- data/rails/activerecord/lib/active_record/callbacks.rb +313 -0
- data/rails/activerecord/lib/active_record/coders/json.rb +13 -0
- data/rails/activerecord/lib/active_record/coders/yaml_column.rb +38 -0
- data/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +661 -0
- data/rails/activerecord/lib/active_record/connection_adapters/abstract/database_limits.rb +67 -0
- data/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +384 -0
- data/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb +95 -0
- data/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +133 -0
- data/rails/activerecord/lib/active_record/connection_adapters/abstract/savepoints.rb +21 -0
- data/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_creation.rb +125 -0
- data/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +592 -0
- data/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_dumper.rb +50 -0
- data/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +1023 -0
- data/rails/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb +219 -0
- data/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +494 -0
- data/rails/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +905 -0
- data/rails/activerecord/lib/active_record/connection_adapters/column.rb +82 -0
- data/rails/activerecord/lib/active_record/connection_adapters/connection_specification.rb +275 -0
- data/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb +282 -0
- data/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +491 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/array_parser.rb +93 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb +20 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb +232 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/array.rb +99 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/bit.rb +52 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/bit_varying.rb +13 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/bytea.rb +15 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/cidr.rb +46 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/date.rb +11 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/date_time.rb +36 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/decimal.rb +13 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/enum.rb +17 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/float.rb +21 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/hstore.rb +59 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/inet.rb +13 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/infinity.rb +13 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/integer.rb +11 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb +35 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/jsonb.rb +23 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/money.rb +43 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/point.rb +43 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/range.rb +79 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/specialized_string.rb +19 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/time.rb +11 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb +97 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/uuid.rb +21 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/vector.rb +26 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/xml.rb +28 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid.rb +36 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb +108 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/referential_integrity.rb +30 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb +152 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb +587 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql/utils.rb +77 -0
- data/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +754 -0
- data/rails/activerecord/lib/active_record/connection_adapters/schema_cache.rb +94 -0
- data/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +622 -0
- data/rails/activerecord/lib/active_record/connection_adapters/statement_pool.rb +40 -0
- data/rails/activerecord/lib/active_record/connection_handling.rb +132 -0
- data/rails/activerecord/lib/active_record/core.rb +572 -0
- data/rails/activerecord/lib/active_record/counter_cache.rb +175 -0
- data/rails/activerecord/lib/active_record/dynamic_matchers.rb +140 -0
- data/rails/activerecord/lib/active_record/enum.rb +198 -0
- data/rails/activerecord/lib/active_record/errors.rb +252 -0
- data/rails/activerecord/lib/active_record/explain.rb +38 -0
- data/rails/activerecord/lib/active_record/explain_registry.rb +30 -0
- data/rails/activerecord/lib/active_record/explain_subscriber.rb +29 -0
- data/rails/activerecord/lib/active_record/fixture_set/file.rb +56 -0
- data/rails/activerecord/lib/active_record/fixtures.rb +1007 -0
- data/rails/activerecord/lib/active_record/gem_version.rb +15 -0
- data/rails/activerecord/lib/active_record/inheritance.rb +247 -0
- data/rails/activerecord/lib/active_record/integration.rb +113 -0
- data/rails/activerecord/lib/active_record/locale/en.yml +47 -0
- data/rails/activerecord/lib/active_record/locking/optimistic.rb +206 -0
- data/rails/activerecord/lib/active_record/locking/pessimistic.rb +77 -0
- data/rails/activerecord/lib/active_record/log_subscriber.rb +75 -0
- data/rails/activerecord/lib/active_record/migration/command_recorder.rb +197 -0
- data/rails/activerecord/lib/active_record/migration/join_table.rb +15 -0
- data/rails/activerecord/lib/active_record/migration.rb +1051 -0
- data/rails/activerecord/lib/active_record/model_schema.rb +340 -0
- data/rails/activerecord/lib/active_record/nested_attributes.rb +548 -0
- data/rails/activerecord/lib/active_record/no_touching.rb +52 -0
- data/rails/activerecord/lib/active_record/null_relation.rb +81 -0
- data/rails/activerecord/lib/active_record/persistence.rb +532 -0
- data/rails/activerecord/lib/active_record/query_cache.rb +56 -0
- data/rails/activerecord/lib/active_record/querying.rb +68 -0
- data/rails/activerecord/lib/active_record/railtie.rb +162 -0
- data/rails/activerecord/lib/active_record/railties/console_sandbox.rb +5 -0
- data/rails/activerecord/lib/active_record/railties/controller_runtime.rb +50 -0
- data/rails/activerecord/lib/active_record/railties/databases.rake +391 -0
- data/rails/activerecord/lib/active_record/railties/jdbcmysql_error.rb +16 -0
- data/rails/activerecord/lib/active_record/readonly_attributes.rb +23 -0
- data/rails/activerecord/lib/active_record/reflection.rb +881 -0
- data/rails/activerecord/lib/active_record/relation/batches.rb +138 -0
- data/rails/activerecord/lib/active_record/relation/calculations.rb +403 -0
- data/rails/activerecord/lib/active_record/relation/delegation.rb +140 -0
- data/rails/activerecord/lib/active_record/relation/finder_methods.rb +528 -0
- data/rails/activerecord/lib/active_record/relation/merger.rb +170 -0
- data/rails/activerecord/lib/active_record/relation/predicate_builder/array_handler.rb +47 -0
- data/rails/activerecord/lib/active_record/relation/predicate_builder/relation_handler.rb +13 -0
- data/rails/activerecord/lib/active_record/relation/predicate_builder.rb +141 -0
- data/rails/activerecord/lib/active_record/relation/query_methods.rb +1177 -0
- data/rails/activerecord/lib/active_record/relation/spawn_methods.rb +75 -0
- data/rails/activerecord/lib/active_record/relation.rb +681 -0
- data/rails/activerecord/lib/active_record/result.rb +131 -0
- data/rails/activerecord/lib/active_record/runtime_registry.rb +22 -0
- data/rails/activerecord/lib/active_record/sanitization.rb +191 -0
- data/rails/activerecord/lib/active_record/schema.rb +64 -0
- data/rails/activerecord/lib/active_record/schema_dumper.rb +251 -0
- data/rails/activerecord/lib/active_record/schema_migration.rb +56 -0
- data/rails/activerecord/lib/active_record/scoping/default.rb +134 -0
- data/rails/activerecord/lib/active_record/scoping/named.rb +164 -0
- data/rails/activerecord/lib/active_record/scoping.rb +87 -0
- data/rails/activerecord/lib/active_record/serialization.rb +22 -0
- data/rails/activerecord/lib/active_record/serializers/xml_serializer.rb +193 -0
- data/rails/activerecord/lib/active_record/statement_cache.rb +111 -0
- data/rails/activerecord/lib/active_record/store.rb +205 -0
- data/rails/activerecord/lib/active_record/tasks/database_tasks.rb +296 -0
- data/rails/activerecord/lib/active_record/tasks/mysql_database_tasks.rb +145 -0
- data/rails/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb +90 -0
- data/rails/activerecord/lib/active_record/tasks/sqlite_database_tasks.rb +55 -0
- data/rails/activerecord/lib/active_record/timestamp.rb +121 -0
- data/rails/activerecord/lib/active_record/transactions.rb +415 -0
- data/rails/activerecord/lib/active_record/translation.rb +22 -0
- data/rails/activerecord/lib/active_record/type/big_integer.rb +13 -0
- data/rails/activerecord/lib/active_record/type/binary.rb +50 -0
- data/rails/activerecord/lib/active_record/type/boolean.rb +30 -0
- data/rails/activerecord/lib/active_record/type/date.rb +46 -0
- data/rails/activerecord/lib/active_record/type/date_time.rb +54 -0
- data/rails/activerecord/lib/active_record/type/decimal.rb +48 -0
- data/rails/activerecord/lib/active_record/type/decimal_without_scale.rb +11 -0
- data/rails/activerecord/lib/active_record/type/decorator.rb +14 -0
- data/rails/activerecord/lib/active_record/type/float.rb +19 -0
- data/rails/activerecord/lib/active_record/type/hash_lookup_type_map.rb +17 -0
- data/rails/activerecord/lib/active_record/type/integer.rb +59 -0
- data/rails/activerecord/lib/active_record/type/mutable.rb +16 -0
- data/rails/activerecord/lib/active_record/type/numeric.rb +36 -0
- data/rails/activerecord/lib/active_record/type/serialized.rb +56 -0
- data/rails/activerecord/lib/active_record/type/string.rb +40 -0
- data/rails/activerecord/lib/active_record/type/text.rb +11 -0
- data/rails/activerecord/lib/active_record/type/time.rb +26 -0
- data/rails/activerecord/lib/active_record/type/time_value.rb +38 -0
- data/rails/activerecord/lib/active_record/type/type_map.rb +64 -0
- data/rails/activerecord/lib/active_record/type/unsigned_integer.rb +15 -0
- data/rails/activerecord/lib/active_record/type/value.rb +105 -0
- data/rails/activerecord/lib/active_record/type.rb +23 -0
- data/rails/activerecord/lib/active_record/validations/associated.rb +51 -0
- data/rails/activerecord/lib/active_record/validations/presence.rb +67 -0
- data/rails/activerecord/lib/active_record/validations/uniqueness.rb +229 -0
- data/rails/activerecord/lib/active_record/validations.rb +90 -0
- data/rails/activerecord/lib/active_record/version.rb +8 -0
- data/rails/activerecord/lib/active_record.rb +173 -0
- data/rails/activerecord/lib/rails/generators/active_record/migration/migration_generator.rb +70 -0
- data/rails/activerecord/lib/rails/generators/active_record/migration/templates/create_table_migration.rb +19 -0
- data/rails/activerecord/lib/rails/generators/active_record/migration/templates/migration.rb +39 -0
- data/rails/activerecord/lib/rails/generators/active_record/migration.rb +18 -0
- data/rails/activerecord/lib/rails/generators/active_record/model/model_generator.rb +52 -0
- data/rails/activerecord/lib/rails/generators/active_record/model/templates/model.rb +10 -0
- data/rails/activerecord/lib/rails/generators/active_record/model/templates/module.rb +7 -0
- data/rails/activerecord/lib/rails/generators/active_record.rb +17 -0
- data/rails/activerecord/test/.gitignore +1 -0
- data/rails/activerecord/test/active_record/connection_adapters/fake_adapter.rb +46 -0
- data/rails/activerecord/test/assets/example.log +1 -0
- data/rails/activerecord/test/assets/flowers.jpg +0 -0
- data/rails/activerecord/test/assets/test.txt +1 -0
- data/rails/activerecord/test/cases/adapter_test.rb +261 -0
- data/rails/activerecord/test/cases/adapters/mysql/active_schema_test.rb +155 -0
- data/rails/activerecord/test/cases/adapters/mysql/case_sensitivity_test.rb +55 -0
- data/rails/activerecord/test/cases/adapters/mysql/connection_test.rb +184 -0
- data/rails/activerecord/test/cases/adapters/mysql/consistency_test.rb +49 -0
- data/rails/activerecord/test/cases/adapters/mysql/datetime_test.rb +87 -0
- data/rails/activerecord/test/cases/adapters/mysql/enum_test.rb +10 -0
- data/rails/activerecord/test/cases/adapters/mysql/mysql_adapter_test.rb +153 -0
- data/rails/activerecord/test/cases/adapters/mysql/quoting_test.rb +25 -0
- data/rails/activerecord/test/cases/adapters/mysql/reserved_word_test.rb +153 -0
- data/rails/activerecord/test/cases/adapters/mysql/schema_test.rb +100 -0
- data/rails/activerecord/test/cases/adapters/mysql/sp_test.rb +15 -0
- data/rails/activerecord/test/cases/adapters/mysql/sql_types_test.rb +14 -0
- data/rails/activerecord/test/cases/adapters/mysql/statement_pool_test.rb +23 -0
- data/rails/activerecord/test/cases/adapters/mysql/unsigned_type_test.rb +30 -0
- data/rails/activerecord/test/cases/adapters/mysql2/active_schema_test.rb +155 -0
- data/rails/activerecord/test/cases/adapters/mysql2/bind_parameter_test.rb +50 -0
- data/rails/activerecord/test/cases/adapters/mysql2/boolean_test.rb +92 -0
- data/rails/activerecord/test/cases/adapters/mysql2/case_sensitivity_test.rb +55 -0
- data/rails/activerecord/test/cases/adapters/mysql2/connection_test.rb +134 -0
- data/rails/activerecord/test/cases/adapters/mysql2/datetime_test.rb +87 -0
- data/rails/activerecord/test/cases/adapters/mysql2/enum_test.rb +10 -0
- data/rails/activerecord/test/cases/adapters/mysql2/explain_test.rb +27 -0
- data/rails/activerecord/test/cases/adapters/mysql2/reserved_word_test.rb +152 -0
- data/rails/activerecord/test/cases/adapters/mysql2/schema_migrations_test.rb +47 -0
- data/rails/activerecord/test/cases/adapters/mysql2/schema_test.rb +81 -0
- data/rails/activerecord/test/cases/adapters/mysql2/sql_types_test.rb +14 -0
- data/rails/activerecord/test/cases/adapters/mysql2/unsigned_type_test.rb +30 -0
- data/rails/activerecord/test/cases/adapters/postgresql/active_schema_test.rb +58 -0
- data/rails/activerecord/test/cases/adapters/postgresql/array_test.rb +295 -0
- data/rails/activerecord/test/cases/adapters/postgresql/bit_string_test.rb +78 -0
- data/rails/activerecord/test/cases/adapters/postgresql/bytea_test.rb +125 -0
- data/rails/activerecord/test/cases/adapters/postgresql/change_schema_test.rb +31 -0
- data/rails/activerecord/test/cases/adapters/postgresql/citext_test.rb +71 -0
- data/rails/activerecord/test/cases/adapters/postgresql/composite_test.rb +131 -0
- data/rails/activerecord/test/cases/adapters/postgresql/connection_test.rb +215 -0
- data/rails/activerecord/test/cases/adapters/postgresql/datatype_test.rb +126 -0
- data/rails/activerecord/test/cases/adapters/postgresql/domain_test.rb +47 -0
- data/rails/activerecord/test/cases/adapters/postgresql/enum_test.rb +83 -0
- data/rails/activerecord/test/cases/adapters/postgresql/explain_test.rb +26 -0
- data/rails/activerecord/test/cases/adapters/postgresql/extension_migration_test.rb +63 -0
- data/rails/activerecord/test/cases/adapters/postgresql/full_text_test.rb +26 -0
- data/rails/activerecord/test/cases/adapters/postgresql/geometric_test.rb +72 -0
- data/rails/activerecord/test/cases/adapters/postgresql/hstore_test.rb +345 -0
- data/rails/activerecord/test/cases/adapters/postgresql/infinity_test.rb +60 -0
- data/rails/activerecord/test/cases/adapters/postgresql/integer_test.rb +25 -0
- data/rails/activerecord/test/cases/adapters/postgresql/json_test.rb +206 -0
- data/rails/activerecord/test/cases/adapters/postgresql/ltree_test.rb +46 -0
- data/rails/activerecord/test/cases/adapters/postgresql/money_test.rb +96 -0
- data/rails/activerecord/test/cases/adapters/postgresql/network_test.rb +71 -0
- data/rails/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb +462 -0
- data/rails/activerecord/test/cases/adapters/postgresql/quoting_test.rb +74 -0
- data/rails/activerecord/test/cases/adapters/postgresql/range_test.rb +323 -0
- data/rails/activerecord/test/cases/adapters/postgresql/rename_table_test.rb +34 -0
- data/rails/activerecord/test/cases/adapters/postgresql/schema_authorization_test.rb +114 -0
- data/rails/activerecord/test/cases/adapters/postgresql/schema_test.rb +462 -0
- data/rails/activerecord/test/cases/adapters/postgresql/statement_pool_test.rb +41 -0
- data/rails/activerecord/test/cases/adapters/postgresql/timestamp_test.rb +170 -0
- data/rails/activerecord/test/cases/adapters/postgresql/type_lookup_test.rb +33 -0
- data/rails/activerecord/test/cases/adapters/postgresql/utils_test.rb +61 -0
- data/rails/activerecord/test/cases/adapters/postgresql/uuid_test.rb +315 -0
- data/rails/activerecord/test/cases/adapters/postgresql/view_test.rb +63 -0
- data/rails/activerecord/test/cases/adapters/postgresql/xml_test.rb +48 -0
- data/rails/activerecord/test/cases/adapters/sqlite3/copy_table_test.rb +98 -0
- data/rails/activerecord/test/cases/adapters/sqlite3/explain_test.rb +27 -0
- data/rails/activerecord/test/cases/adapters/sqlite3/quoting_test.rb +116 -0
- data/rails/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb +461 -0
- data/rails/activerecord/test/cases/adapters/sqlite3/sqlite3_create_folder_test.rb +21 -0
- data/rails/activerecord/test/cases/adapters/sqlite3/statement_pool_test.rb +25 -0
- data/rails/activerecord/test/cases/aggregations_test.rb +158 -0
- data/rails/activerecord/test/cases/ar_schema_test.rb +161 -0
- data/rails/activerecord/test/cases/associations/association_scope_test.rb +21 -0
- data/rails/activerecord/test/cases/associations/belongs_to_associations_test.rb +978 -0
- data/rails/activerecord/test/cases/associations/callbacks_test.rb +190 -0
- data/rails/activerecord/test/cases/associations/cascaded_eager_loading_test.rb +188 -0
- data/rails/activerecord/test/cases/associations/deprecated_counter_cache_on_has_many_through_test.rb +26 -0
- data/rails/activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb +36 -0
- data/rails/activerecord/test/cases/associations/eager_load_nested_include_test.rb +128 -0
- data/rails/activerecord/test/cases/associations/eager_singularization_test.rb +148 -0
- data/rails/activerecord/test/cases/associations/eager_test.rb +1366 -0
- data/rails/activerecord/test/cases/associations/extension_test.rb +82 -0
- data/rails/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb +905 -0
- data/rails/activerecord/test/cases/associations/has_many_associations_test.rb +2099 -0
- data/rails/activerecord/test/cases/associations/has_many_through_associations_test.rb +1163 -0
- data/rails/activerecord/test/cases/associations/has_one_associations_test.rb +610 -0
- data/rails/activerecord/test/cases/associations/has_one_through_associations_test.rb +346 -0
- data/rails/activerecord/test/cases/associations/inner_join_association_test.rb +139 -0
- data/rails/activerecord/test/cases/associations/inverse_associations_test.rb +693 -0
- data/rails/activerecord/test/cases/associations/join_model_test.rb +751 -0
- data/rails/activerecord/test/cases/associations/nested_through_associations_test.rb +579 -0
- data/rails/activerecord/test/cases/associations/required_test.rb +82 -0
- data/rails/activerecord/test/cases/associations_test.rb +380 -0
- data/rails/activerecord/test/cases/attribute_decorators_test.rb +125 -0
- data/rails/activerecord/test/cases/attribute_methods/read_test.rb +60 -0
- data/rails/activerecord/test/cases/attribute_methods_test.rb +941 -0
- data/rails/activerecord/test/cases/attribute_set_test.rb +200 -0
- data/rails/activerecord/test/cases/attribute_test.rb +180 -0
- data/rails/activerecord/test/cases/attributes_test.rb +115 -0
- data/rails/activerecord/test/cases/autosave_association_test.rb +1588 -0
- data/rails/activerecord/test/cases/base_test.rb +1627 -0
- data/rails/activerecord/test/cases/batches_test.rb +212 -0
- data/rails/activerecord/test/cases/binary_test.rb +49 -0
- data/rails/activerecord/test/cases/bind_parameter_test.rb +100 -0
- data/rails/activerecord/test/cases/calculations_test.rb +634 -0
- data/rails/activerecord/test/cases/callbacks_test.rb +539 -0
- data/rails/activerecord/test/cases/clone_test.rb +40 -0
- data/rails/activerecord/test/cases/coders/yaml_column_test.rb +63 -0
- data/rails/activerecord/test/cases/column_alias_test.rb +17 -0
- data/rails/activerecord/test/cases/column_definition_test.rb +123 -0
- data/rails/activerecord/test/cases/connection_adapters/adapter_leasing_test.rb +54 -0
- data/rails/activerecord/test/cases/connection_adapters/connection_handler_test.rb +53 -0
- data/rails/activerecord/test/cases/connection_adapters/connection_specification_test.rb +12 -0
- data/rails/activerecord/test/cases/connection_adapters/merge_and_resolve_default_url_config_test.rb +293 -0
- data/rails/activerecord/test/cases/connection_adapters/mysql_type_lookup_test.rb +65 -0
- data/rails/activerecord/test/cases/connection_adapters/quoting_test.rb +13 -0
- data/rails/activerecord/test/cases/connection_adapters/schema_cache_test.rb +56 -0
- data/rails/activerecord/test/cases/connection_adapters/type_lookup_test.rb +106 -0
- data/rails/activerecord/test/cases/connection_management_test.rb +122 -0
- data/rails/activerecord/test/cases/connection_pool_test.rb +346 -0
- data/rails/activerecord/test/cases/connection_specification/resolver_test.rb +116 -0
- data/rails/activerecord/test/cases/core_test.rb +112 -0
- data/rails/activerecord/test/cases/counter_cache_test.rb +201 -0
- data/rails/activerecord/test/cases/custom_locking_test.rb +17 -0
- data/rails/activerecord/test/cases/database_statements_test.rb +19 -0
- data/rails/activerecord/test/cases/date_time_test.rb +61 -0
- data/rails/activerecord/test/cases/defaults_test.rb +223 -0
- data/rails/activerecord/test/cases/dirty_test.rb +759 -0
- data/rails/activerecord/test/cases/disconnected_test.rb +28 -0
- data/rails/activerecord/test/cases/dup_test.rb +157 -0
- data/rails/activerecord/test/cases/enum_test.rb +290 -0
- data/rails/activerecord/test/cases/explain_subscriber_test.rb +59 -0
- data/rails/activerecord/test/cases/explain_test.rb +76 -0
- data/rails/activerecord/test/cases/finder_respond_to_test.rb +60 -0
- data/rails/activerecord/test/cases/finder_test.rb +1163 -0
- data/rails/activerecord/test/cases/fixture_set/file_test.rb +138 -0
- data/rails/activerecord/test/cases/fixtures_test.rb +869 -0
- data/rails/activerecord/test/cases/forbidden_attributes_protection_test.rb +99 -0
- data/rails/activerecord/test/cases/habtm_destroy_order_test.rb +61 -0
- data/rails/activerecord/test/cases/helper.rb +210 -0
- data/rails/activerecord/test/cases/hot_compatibility_test.rb +54 -0
- data/rails/activerecord/test/cases/i18n_test.rb +45 -0
- data/rails/activerecord/test/cases/inheritance_test.rb +369 -0
- data/rails/activerecord/test/cases/integration_test.rb +139 -0
- data/rails/activerecord/test/cases/invalid_connection_test.rb +22 -0
- data/rails/activerecord/test/cases/invalid_date_test.rb +32 -0
- data/rails/activerecord/test/cases/invertible_migration_test.rb +295 -0
- data/rails/activerecord/test/cases/json_serialization_test.rb +300 -0
- data/rails/activerecord/test/cases/locking_test.rb +477 -0
- data/rails/activerecord/test/cases/log_subscriber_test.rb +136 -0
- data/rails/activerecord/test/cases/migration/change_schema_test.rb +450 -0
- data/rails/activerecord/test/cases/migration/change_table_test.rb +224 -0
- data/rails/activerecord/test/cases/migration/column_attributes_test.rb +185 -0
- data/rails/activerecord/test/cases/migration/column_positioning_test.rb +56 -0
- data/rails/activerecord/test/cases/migration/columns_test.rb +299 -0
- data/rails/activerecord/test/cases/migration/command_recorder_test.rb +305 -0
- data/rails/activerecord/test/cases/migration/create_join_table_test.rb +148 -0
- data/rails/activerecord/test/cases/migration/foreign_key_test.rb +250 -0
- data/rails/activerecord/test/cases/migration/helper.rb +39 -0
- data/rails/activerecord/test/cases/migration/index_test.rb +208 -0
- data/rails/activerecord/test/cases/migration/logger_test.rb +36 -0
- data/rails/activerecord/test/cases/migration/pending_migrations_test.rb +53 -0
- data/rails/activerecord/test/cases/migration/references_foreign_key_test.rb +111 -0
- data/rails/activerecord/test/cases/migration/references_index_test.rb +101 -0
- data/rails/activerecord/test/cases/migration/references_statements_test.rb +116 -0
- data/rails/activerecord/test/cases/migration/rename_table_test.rb +93 -0
- data/rails/activerecord/test/cases/migration/table_and_index_test.rb +24 -0
- data/rails/activerecord/test/cases/migration_test.rb +939 -0
- data/rails/activerecord/test/cases/migrator_test.rb +388 -0
- data/rails/activerecord/test/cases/mixin_test.rb +70 -0
- data/rails/activerecord/test/cases/modules_test.rb +173 -0
- data/rails/activerecord/test/cases/multiparameter_attributes_test.rb +350 -0
- data/rails/activerecord/test/cases/multiple_db_test.rb +115 -0
- data/rails/activerecord/test/cases/nested_attributes_test.rb +1057 -0
- data/rails/activerecord/test/cases/nested_attributes_with_callbacks_test.rb +144 -0
- data/rails/activerecord/test/cases/persistence_test.rb +881 -0
- data/rails/activerecord/test/cases/pooled_connections_test.rb +81 -0
- data/rails/activerecord/test/cases/primary_keys_test.rb +236 -0
- data/rails/activerecord/test/cases/query_cache_test.rb +322 -0
- data/rails/activerecord/test/cases/quoting_test.rb +156 -0
- data/rails/activerecord/test/cases/readonly_test.rb +118 -0
- data/rails/activerecord/test/cases/reaper_test.rb +85 -0
- data/rails/activerecord/test/cases/reflection_test.rb +454 -0
- data/rails/activerecord/test/cases/relation/delegation_test.rb +68 -0
- data/rails/activerecord/test/cases/relation/merging_test.rb +161 -0
- data/rails/activerecord/test/cases/relation/mutation_test.rb +165 -0
- data/rails/activerecord/test/cases/relation/predicate_builder_test.rb +14 -0
- data/rails/activerecord/test/cases/relation/where_chain_test.rb +181 -0
- data/rails/activerecord/test/cases/relation/where_test.rb +278 -0
- data/rails/activerecord/test/cases/relation_test.rb +267 -0
- data/rails/activerecord/test/cases/relations_test.rb +1756 -0
- data/rails/activerecord/test/cases/reload_models_test.rb +22 -0
- data/rails/activerecord/test/cases/result_test.rb +80 -0
- data/rails/activerecord/test/cases/sanitize_test.rb +83 -0
- data/rails/activerecord/test/cases/schema_dumper_test.rb +445 -0
- data/rails/activerecord/test/cases/scoping/default_scoping_test.rb +436 -0
- data/rails/activerecord/test/cases/scoping/named_scoping_test.rb +524 -0
- data/rails/activerecord/test/cases/scoping/relation_scoping_test.rb +357 -0
- data/rails/activerecord/test/cases/serialization_test.rb +104 -0
- data/rails/activerecord/test/cases/serialized_attribute_test.rb +267 -0
- data/rails/activerecord/test/cases/statement_cache_test.rb +98 -0
- data/rails/activerecord/test/cases/store_test.rb +194 -0
- data/rails/activerecord/test/cases/tasks/database_tasks_test.rb +380 -0
- data/rails/activerecord/test/cases/tasks/mysql_rake_test.rb +311 -0
- data/rails/activerecord/test/cases/tasks/postgresql_rake_test.rb +245 -0
- data/rails/activerecord/test/cases/tasks/sqlite_rake_test.rb +193 -0
- data/rails/activerecord/test/cases/test_case.rb +123 -0
- data/rails/activerecord/test/cases/timestamp_test.rb +446 -0
- data/rails/activerecord/test/cases/transaction_callbacks_test.rb +444 -0
- data/rails/activerecord/test/cases/transaction_isolation_test.rb +106 -0
- data/rails/activerecord/test/cases/transactions_test.rb +792 -0
- data/rails/activerecord/test/cases/type/decimal_test.rb +51 -0
- data/rails/activerecord/test/cases/type/integer_test.rb +121 -0
- data/rails/activerecord/test/cases/type/string_test.rb +36 -0
- data/rails/activerecord/test/cases/type/type_map_test.rb +177 -0
- data/rails/activerecord/test/cases/type/unsigned_integer_test.rb +18 -0
- data/rails/activerecord/test/cases/types_test.rb +141 -0
- data/rails/activerecord/test/cases/unconnected_test.rb +33 -0
- data/rails/activerecord/test/cases/validations/association_validation_test.rb +86 -0
- data/rails/activerecord/test/cases/validations/i18n_generate_message_validation_test.rb +84 -0
- data/rails/activerecord/test/cases/validations/i18n_validation_test.rb +90 -0
- data/rails/activerecord/test/cases/validations/length_validation_test.rb +47 -0
- data/rails/activerecord/test/cases/validations/presence_validation_test.rb +68 -0
- data/rails/activerecord/test/cases/validations/uniqueness_validation_test.rb +406 -0
- data/rails/activerecord/test/cases/validations_repair_helper.rb +23 -0
- data/rails/activerecord/test/cases/validations_test.rb +165 -0
- data/rails/activerecord/test/cases/view_test.rb +113 -0
- data/rails/activerecord/test/cases/xml_serialization_test.rb +447 -0
- data/rails/activerecord/test/cases/yaml_serialization_test.rb +86 -0
- data/rails/activerecord/test/config.example.yml +106 -0
- data/rails/activerecord/test/config.rb +5 -0
- data/rails/activerecord/test/fixtures/.gitignore +1 -0
- data/rails/activerecord/test/fixtures/accounts.yml +29 -0
- data/rails/activerecord/test/fixtures/admin/accounts.yml +2 -0
- data/rails/activerecord/test/fixtures/admin/randomly_named_a9.yml +7 -0
- data/rails/activerecord/test/fixtures/admin/randomly_named_b0.yml +7 -0
- data/rails/activerecord/test/fixtures/admin/users.yml +10 -0
- data/rails/activerecord/test/fixtures/all/developers.yml +0 -0
- data/rails/activerecord/test/fixtures/all/people.yml +0 -0
- data/rails/activerecord/test/fixtures/all/tasks.yml +0 -0
- data/rails/activerecord/test/fixtures/author_addresses.yml +5 -0
- data/rails/activerecord/test/fixtures/author_favorites.yml +4 -0
- data/rails/activerecord/test/fixtures/authors.yml +15 -0
- data/rails/activerecord/test/fixtures/binaries.yml +133 -0
- data/rails/activerecord/test/fixtures/books.yml +11 -0
- data/rails/activerecord/test/fixtures/bulbs.yml +5 -0
- data/rails/activerecord/test/fixtures/cars.yml +9 -0
- data/rails/activerecord/test/fixtures/categories/special_categories.yml +9 -0
- data/rails/activerecord/test/fixtures/categories/subsubdir/arbitrary_filename.yml +4 -0
- data/rails/activerecord/test/fixtures/categories.yml +19 -0
- data/rails/activerecord/test/fixtures/categories_ordered.yml +7 -0
- data/rails/activerecord/test/fixtures/categories_posts.yml +31 -0
- data/rails/activerecord/test/fixtures/categorizations.yml +23 -0
- data/rails/activerecord/test/fixtures/clubs.yml +8 -0
- data/rails/activerecord/test/fixtures/collections.yml +3 -0
- data/rails/activerecord/test/fixtures/colleges.yml +3 -0
- data/rails/activerecord/test/fixtures/comments.yml +65 -0
- data/rails/activerecord/test/fixtures/companies.yml +67 -0
- data/rails/activerecord/test/fixtures/computers.yml +10 -0
- data/rails/activerecord/test/fixtures/courses.yml +8 -0
- data/rails/activerecord/test/fixtures/customers.yml +26 -0
- data/rails/activerecord/test/fixtures/dashboards.yml +6 -0
- data/rails/activerecord/test/fixtures/developers.yml +22 -0
- data/rails/activerecord/test/fixtures/developers_projects.yml +17 -0
- data/rails/activerecord/test/fixtures/dog_lovers.yml +7 -0
- data/rails/activerecord/test/fixtures/dogs.yml +4 -0
- data/rails/activerecord/test/fixtures/edges.yml +5 -0
- data/rails/activerecord/test/fixtures/entrants.yml +14 -0
- data/rails/activerecord/test/fixtures/essays.yml +6 -0
- data/rails/activerecord/test/fixtures/faces.yml +11 -0
- data/rails/activerecord/test/fixtures/fk_test_has_fk.yml +3 -0
- data/rails/activerecord/test/fixtures/fk_test_has_pk.yml +2 -0
- data/rails/activerecord/test/fixtures/friendships.yml +4 -0
- data/rails/activerecord/test/fixtures/funny_jokes.yml +10 -0
- data/rails/activerecord/test/fixtures/interests.yml +33 -0
- data/rails/activerecord/test/fixtures/items.yml +3 -0
- data/rails/activerecord/test/fixtures/jobs.yml +7 -0
- data/rails/activerecord/test/fixtures/legacy_things.yml +3 -0
- data/rails/activerecord/test/fixtures/mateys.yml +4 -0
- data/rails/activerecord/test/fixtures/member_details.yml +8 -0
- data/rails/activerecord/test/fixtures/member_types.yml +6 -0
- data/rails/activerecord/test/fixtures/members.yml +11 -0
- data/rails/activerecord/test/fixtures/memberships.yml +34 -0
- data/rails/activerecord/test/fixtures/men.yml +5 -0
- data/rails/activerecord/test/fixtures/minimalistics.yml +2 -0
- data/rails/activerecord/test/fixtures/minivans.yml +5 -0
- data/rails/activerecord/test/fixtures/mixed_case_monkeys.yml +6 -0
- data/rails/activerecord/test/fixtures/mixins.yml +29 -0
- data/rails/activerecord/test/fixtures/movies.yml +7 -0
- data/rails/activerecord/test/fixtures/naked/csv/accounts.csv +1 -0
- data/rails/activerecord/test/fixtures/naked/yml/accounts.yml +1 -0
- data/rails/activerecord/test/fixtures/naked/yml/companies.yml +1 -0
- data/rails/activerecord/test/fixtures/naked/yml/courses.yml +1 -0
- data/rails/activerecord/test/fixtures/organizations.yml +5 -0
- data/rails/activerecord/test/fixtures/other_topics.yml +42 -0
- data/rails/activerecord/test/fixtures/owners.yml +9 -0
- data/rails/activerecord/test/fixtures/parrots.yml +27 -0
- data/rails/activerecord/test/fixtures/parrots_pirates.yml +7 -0
- data/rails/activerecord/test/fixtures/people.yml +24 -0
- data/rails/activerecord/test/fixtures/peoples_treasures.yml +3 -0
- data/rails/activerecord/test/fixtures/pets.yml +19 -0
- data/rails/activerecord/test/fixtures/pirates.yml +12 -0
- data/rails/activerecord/test/fixtures/posts.yml +80 -0
- data/rails/activerecord/test/fixtures/price_estimates.yml +7 -0
- data/rails/activerecord/test/fixtures/products.yml +4 -0
- data/rails/activerecord/test/fixtures/projects.yml +7 -0
- data/rails/activerecord/test/fixtures/randomly_named_a9.yml +7 -0
- data/rails/activerecord/test/fixtures/ratings.yml +14 -0
- data/rails/activerecord/test/fixtures/readers.yml +11 -0
- data/rails/activerecord/test/fixtures/references.yml +17 -0
- data/rails/activerecord/test/fixtures/reserved_words/distinct.yml +5 -0
- data/rails/activerecord/test/fixtures/reserved_words/distinct_select.yml +11 -0
- data/rails/activerecord/test/fixtures/reserved_words/group.yml +14 -0
- data/rails/activerecord/test/fixtures/reserved_words/select.yml +8 -0
- data/rails/activerecord/test/fixtures/reserved_words/values.yml +7 -0
- data/rails/activerecord/test/fixtures/ships.yml +6 -0
- data/rails/activerecord/test/fixtures/speedometers.yml +8 -0
- data/rails/activerecord/test/fixtures/sponsors.yml +12 -0
- data/rails/activerecord/test/fixtures/string_key_objects.yml +7 -0
- data/rails/activerecord/test/fixtures/subscribers.yml +11 -0
- data/rails/activerecord/test/fixtures/subscriptions.yml +12 -0
- data/rails/activerecord/test/fixtures/taggings.yml +78 -0
- data/rails/activerecord/test/fixtures/tags.yml +11 -0
- data/rails/activerecord/test/fixtures/tasks.yml +7 -0
- data/rails/activerecord/test/fixtures/teapots.yml +3 -0
- data/rails/activerecord/test/fixtures/to_be_linked/accounts.yml +2 -0
- data/rails/activerecord/test/fixtures/to_be_linked/users.yml +10 -0
- data/rails/activerecord/test/fixtures/topics.yml +49 -0
- data/rails/activerecord/test/fixtures/toys.yml +14 -0
- data/rails/activerecord/test/fixtures/traffic_lights.yml +10 -0
- data/rails/activerecord/test/fixtures/treasures.yml +10 -0
- data/rails/activerecord/test/fixtures/uuid_children.yml +3 -0
- data/rails/activerecord/test/fixtures/uuid_parents.yml +2 -0
- data/rails/activerecord/test/fixtures/variants.yml +4 -0
- data/rails/activerecord/test/fixtures/vegetables.yml +20 -0
- data/rails/activerecord/test/fixtures/vertices.yml +4 -0
- data/rails/activerecord/test/fixtures/warehouse-things.yml +3 -0
- data/rails/activerecord/test/fixtures/zines.yml +5 -0
- data/rails/activerecord/test/migrations/10_urban/9_add_expressions.rb +11 -0
- data/rails/activerecord/test/migrations/decimal/1_give_me_big_numbers.rb +15 -0
- data/rails/activerecord/test/migrations/empty/.gitkeep +0 -0
- data/rails/activerecord/test/migrations/magic/1_currencies_have_symbols.rb +12 -0
- data/rails/activerecord/test/migrations/missing/1000_people_have_middle_names.rb +9 -0
- data/rails/activerecord/test/migrations/missing/1_people_have_last_names.rb +9 -0
- data/rails/activerecord/test/migrations/missing/3_we_need_reminders.rb +12 -0
- data/rails/activerecord/test/migrations/missing/4_innocent_jointable.rb +12 -0
- data/rails/activerecord/test/migrations/rename/1_we_need_things.rb +11 -0
- data/rails/activerecord/test/migrations/rename/2_rename_things.rb +9 -0
- data/rails/activerecord/test/migrations/to_copy/1_people_have_hobbies.rb +9 -0
- data/rails/activerecord/test/migrations/to_copy/2_people_have_descriptions.rb +9 -0
- data/rails/activerecord/test/migrations/to_copy2/1_create_articles.rb +7 -0
- data/rails/activerecord/test/migrations/to_copy2/2_create_comments.rb +7 -0
- data/rails/activerecord/test/migrations/to_copy_with_name_collision/1_people_have_hobbies.rb +9 -0
- data/rails/activerecord/test/migrations/to_copy_with_timestamps/20090101010101_people_have_hobbies.rb +9 -0
- data/rails/activerecord/test/migrations/to_copy_with_timestamps/20090101010202_people_have_descriptions.rb +9 -0
- data/rails/activerecord/test/migrations/to_copy_with_timestamps2/20090101010101_create_articles.rb +7 -0
- data/rails/activerecord/test/migrations/to_copy_with_timestamps2/20090101010202_create_comments.rb +7 -0
- data/rails/activerecord/test/migrations/valid/1_valid_people_have_last_names.rb +9 -0
- data/rails/activerecord/test/migrations/valid/2_we_need_reminders.rb +12 -0
- data/rails/activerecord/test/migrations/valid/3_innocent_jointable.rb +12 -0
- data/rails/activerecord/test/migrations/valid_with_subdirectories/1_valid_people_have_last_names.rb +9 -0
- data/rails/activerecord/test/migrations/valid_with_subdirectories/sub/2_we_need_reminders.rb +12 -0
- data/rails/activerecord/test/migrations/valid_with_subdirectories/sub1/3_innocent_jointable.rb +12 -0
- data/rails/activerecord/test/migrations/valid_with_timestamps/20100101010101_valid_with_timestamps_people_have_last_names.rb +9 -0
- data/rails/activerecord/test/migrations/valid_with_timestamps/20100201010101_valid_with_timestamps_we_need_reminders.rb +12 -0
- data/rails/activerecord/test/migrations/valid_with_timestamps/20100301010101_valid_with_timestamps_innocent_jointable.rb +12 -0
- data/rails/activerecord/test/migrations/version_check/20131219224947_migration_version_check.rb +8 -0
- data/rails/activerecord/test/models/admin/account.rb +3 -0
- data/rails/activerecord/test/models/admin/randomly_named_c1.rb +3 -0
- data/rails/activerecord/test/models/admin/user.rb +40 -0
- data/rails/activerecord/test/models/admin.rb +5 -0
- data/rails/activerecord/test/models/aircraft.rb +4 -0
- data/rails/activerecord/test/models/arunit2_model.rb +3 -0
- data/rails/activerecord/test/models/author.rb +212 -0
- data/rails/activerecord/test/models/auto_id.rb +4 -0
- data/rails/activerecord/test/models/autoloadable/extra_firm.rb +2 -0
- data/rails/activerecord/test/models/binary.rb +2 -0
- data/rails/activerecord/test/models/bird.rb +12 -0
- data/rails/activerecord/test/models/book.rb +18 -0
- data/rails/activerecord/test/models/boolean.rb +2 -0
- data/rails/activerecord/test/models/bulb.rb +51 -0
- data/rails/activerecord/test/models/cake_designer.rb +3 -0
- data/rails/activerecord/test/models/car.rb +26 -0
- data/rails/activerecord/test/models/categorization.rb +19 -0
- data/rails/activerecord/test/models/category.rb +35 -0
- data/rails/activerecord/test/models/chef.rb +3 -0
- data/rails/activerecord/test/models/citation.rb +3 -0
- data/rails/activerecord/test/models/club.rb +23 -0
- data/rails/activerecord/test/models/college.rb +10 -0
- data/rails/activerecord/test/models/column.rb +3 -0
- data/rails/activerecord/test/models/column_name.rb +3 -0
- data/rails/activerecord/test/models/comment.rb +59 -0
- data/rails/activerecord/test/models/company.rb +225 -0
- data/rails/activerecord/test/models/company_in_module.rb +98 -0
- data/rails/activerecord/test/models/computer.rb +3 -0
- data/rails/activerecord/test/models/contact.rb +41 -0
- data/rails/activerecord/test/models/contract.rb +20 -0
- data/rails/activerecord/test/models/country.rb +7 -0
- data/rails/activerecord/test/models/course.rb +6 -0
- data/rails/activerecord/test/models/customer.rb +77 -0
- data/rails/activerecord/test/models/dashboard.rb +3 -0
- data/rails/activerecord/test/models/default.rb +2 -0
- data/rails/activerecord/test/models/department.rb +4 -0
- data/rails/activerecord/test/models/developer.rb +252 -0
- data/rails/activerecord/test/models/dog.rb +5 -0
- data/rails/activerecord/test/models/dog_lover.rb +5 -0
- data/rails/activerecord/test/models/drink_designer.rb +3 -0
- data/rails/activerecord/test/models/edge.rb +5 -0
- data/rails/activerecord/test/models/electron.rb +5 -0
- data/rails/activerecord/test/models/engine.rb +4 -0
- data/rails/activerecord/test/models/entrant.rb +3 -0
- data/rails/activerecord/test/models/essay.rb +5 -0
- data/rails/activerecord/test/models/event.rb +3 -0
- data/rails/activerecord/test/models/eye.rb +37 -0
- data/rails/activerecord/test/models/face.rb +9 -0
- data/rails/activerecord/test/models/friendship.rb +6 -0
- data/rails/activerecord/test/models/guid.rb +2 -0
- data/rails/activerecord/test/models/hotel.rb +6 -0
- data/rails/activerecord/test/models/image.rb +3 -0
- data/rails/activerecord/test/models/interest.rb +5 -0
- data/rails/activerecord/test/models/invoice.rb +4 -0
- data/rails/activerecord/test/models/item.rb +7 -0
- data/rails/activerecord/test/models/job.rb +7 -0
- data/rails/activerecord/test/models/joke.rb +7 -0
- data/rails/activerecord/test/models/keyboard.rb +3 -0
- data/rails/activerecord/test/models/legacy_thing.rb +3 -0
- data/rails/activerecord/test/models/lesson.rb +11 -0
- data/rails/activerecord/test/models/line_item.rb +3 -0
- data/rails/activerecord/test/models/liquid.rb +4 -0
- data/rails/activerecord/test/models/man.rb +11 -0
- data/rails/activerecord/test/models/matey.rb +4 -0
- data/rails/activerecord/test/models/member.rb +38 -0
- data/rails/activerecord/test/models/member_detail.rb +7 -0
- data/rails/activerecord/test/models/member_type.rb +3 -0
- data/rails/activerecord/test/models/membership.rb +20 -0
- data/rails/activerecord/test/models/minimalistic.rb +2 -0
- data/rails/activerecord/test/models/minivan.rb +9 -0
- data/rails/activerecord/test/models/mixed_case_monkey.rb +3 -0
- data/rails/activerecord/test/models/molecule.rb +6 -0
- data/rails/activerecord/test/models/movie.rb +5 -0
- data/rails/activerecord/test/models/order.rb +4 -0
- data/rails/activerecord/test/models/organization.rb +14 -0
- data/rails/activerecord/test/models/owner.rb +34 -0
- data/rails/activerecord/test/models/parrot.rb +29 -0
- data/rails/activerecord/test/models/person.rb +143 -0
- data/rails/activerecord/test/models/personal_legacy_thing.rb +4 -0
- data/rails/activerecord/test/models/pet.rb +15 -0
- data/rails/activerecord/test/models/pirate.rb +92 -0
- data/rails/activerecord/test/models/possession.rb +3 -0
- data/rails/activerecord/test/models/post.rb +243 -0
- data/rails/activerecord/test/models/price_estimate.rb +4 -0
- data/rails/activerecord/test/models/project.rb +29 -0
- data/rails/activerecord/test/models/publisher/article.rb +4 -0
- data/rails/activerecord/test/models/publisher/magazine.rb +3 -0
- data/rails/activerecord/test/models/publisher.rb +2 -0
- data/rails/activerecord/test/models/randomly_named_c1.rb +3 -0
- data/rails/activerecord/test/models/rating.rb +4 -0
- data/rails/activerecord/test/models/reader.rb +23 -0
- data/rails/activerecord/test/models/record.rb +2 -0
- data/rails/activerecord/test/models/reference.rb +22 -0
- data/rails/activerecord/test/models/reply.rb +61 -0
- data/rails/activerecord/test/models/ship.rb +26 -0
- data/rails/activerecord/test/models/ship_part.rb +8 -0
- data/rails/activerecord/test/models/shop.rb +17 -0
- data/rails/activerecord/test/models/speedometer.rb +6 -0
- data/rails/activerecord/test/models/sponsor.rb +7 -0
- data/rails/activerecord/test/models/string_key_object.rb +3 -0
- data/rails/activerecord/test/models/student.rb +4 -0
- data/rails/activerecord/test/models/subject.rb +16 -0
- data/rails/activerecord/test/models/subscriber.rb +8 -0
- data/rails/activerecord/test/models/subscription.rb +4 -0
- data/rails/activerecord/test/models/tag.rb +7 -0
- data/rails/activerecord/test/models/tagging.rb +13 -0
- data/rails/activerecord/test/models/task.rb +5 -0
- data/rails/activerecord/test/models/topic.rb +124 -0
- data/rails/activerecord/test/models/toy.rb +6 -0
- data/rails/activerecord/test/models/traffic_light.rb +4 -0
- data/rails/activerecord/test/models/treasure.rb +13 -0
- data/rails/activerecord/test/models/treaty.rb +7 -0
- data/rails/activerecord/test/models/tyre.rb +11 -0
- data/rails/activerecord/test/models/uuid_child.rb +3 -0
- data/rails/activerecord/test/models/uuid_parent.rb +3 -0
- data/rails/activerecord/test/models/vegetables.rb +24 -0
- data/rails/activerecord/test/models/vertex.rb +9 -0
- data/rails/activerecord/test/models/warehouse_thing.rb +5 -0
- data/rails/activerecord/test/models/wheel.rb +3 -0
- data/rails/activerecord/test/models/without_table.rb +3 -0
- data/rails/activerecord/test/models/zine.rb +3 -0
- data/rails/activerecord/test/schema/mysql2_specific_schema.rb +58 -0
- data/rails/activerecord/test/schema/mysql_specific_schema.rb +70 -0
- data/rails/activerecord/test/schema/oracle_specific_schema.rb +43 -0
- data/rails/activerecord/test/schema/postgresql_specific_schema.rb +198 -0
- data/rails/activerecord/test/schema/schema.rb +905 -0
- data/rails/activerecord/test/schema/sqlite_specific_schema.rb +22 -0
- data/rails/activerecord/test/support/config.rb +43 -0
- data/rails/activerecord/test/support/connection.rb +21 -0
- data/rails/activerecord/test/support/connection_helper.rb +14 -0
- data/rails/activerecord/test/support/ddl_helper.rb +8 -0
- data/rails/activerecord/test/support/schema_dumping_helper.rb +20 -0
- data/rails/activesupport/CHANGELOG.md +418 -0
- data/rails/activesupport/MIT-LICENSE +20 -0
- data/rails/activesupport/README.rdoc +40 -0
- data/rails/activesupport/Rakefile +32 -0
- data/rails/activesupport/activesupport.gemspec +28 -0
- data/rails/activesupport/bin/generate_tables +144 -0
- data/rails/activesupport/lib/active_support/all.rb +3 -0
- data/rails/activesupport/lib/active_support/backtrace_cleaner.rb +103 -0
- data/rails/activesupport/lib/active_support/benchmarkable.rb +49 -0
- data/rails/activesupport/lib/active_support/builder.rb +6 -0
- data/rails/activesupport/lib/active_support/cache/file_store.rb +190 -0
- data/rails/activesupport/lib/active_support/cache/mem_cache_store.rb +198 -0
- data/rails/activesupport/lib/active_support/cache/memory_store.rb +172 -0
- data/rails/activesupport/lib/active_support/cache/null_store.rb +44 -0
- data/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb +161 -0
- data/rails/activesupport/lib/active_support/cache/strategy/local_cache_middleware.rb +44 -0
- data/rails/activesupport/lib/active_support/cache.rb +717 -0
- data/rails/activesupport/lib/active_support/callbacks.rb +793 -0
- data/rails/activesupport/lib/active_support/concern.rb +142 -0
- data/rails/activesupport/lib/active_support/concurrency/latch.rb +27 -0
- data/rails/activesupport/lib/active_support/configurable.rb +147 -0
- data/rails/activesupport/lib/active_support/core_ext/array/access.rb +64 -0
- data/rails/activesupport/lib/active_support/core_ext/array/conversions.rb +209 -0
- data/rails/activesupport/lib/active_support/core_ext/array/extract_options.rb +29 -0
- data/rails/activesupport/lib/active_support/core_ext/array/grouping.rb +116 -0
- data/rails/activesupport/lib/active_support/core_ext/array/prepend_and_append.rb +7 -0
- data/rails/activesupport/lib/active_support/core_ext/array/wrap.rb +45 -0
- data/rails/activesupport/lib/active_support/core_ext/array.rb +6 -0
- data/rails/activesupport/lib/active_support/core_ext/benchmark.rb +14 -0
- data/rails/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb +16 -0
- data/rails/activesupport/lib/active_support/core_ext/big_decimal/yaml_conversions.rb +14 -0
- data/rails/activesupport/lib/active_support/core_ext/big_decimal.rb +1 -0
- data/rails/activesupport/lib/active_support/core_ext/class/attribute.rb +127 -0
- data/rails/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb +4 -0
- data/rails/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb +45 -0
- data/rails/activesupport/lib/active_support/core_ext/class/subclasses.rb +42 -0
- data/rails/activesupport/lib/active_support/core_ext/class.rb +3 -0
- data/rails/activesupport/lib/active_support/core_ext/date/acts_like.rb +8 -0
- data/rails/activesupport/lib/active_support/core_ext/date/calculations.rb +143 -0
- data/rails/activesupport/lib/active_support/core_ext/date/conversions.rb +88 -0
- data/rails/activesupport/lib/active_support/core_ext/date/zones.rb +6 -0
- data/rails/activesupport/lib/active_support/core_ext/date.rb +5 -0
- data/rails/activesupport/lib/active_support/core_ext/date_and_time/calculations.rb +251 -0
- data/rails/activesupport/lib/active_support/core_ext/date_and_time/zones.rb +41 -0
- data/rails/activesupport/lib/active_support/core_ext/date_time/acts_like.rb +14 -0
- data/rails/activesupport/lib/active_support/core_ext/date_time/calculations.rb +173 -0
- data/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb +103 -0
- data/rails/activesupport/lib/active_support/core_ext/date_time/zones.rb +6 -0
- data/rails/activesupport/lib/active_support/core_ext/date_time.rb +4 -0
- data/rails/activesupport/lib/active_support/core_ext/digest/uuid.rb +51 -0
- data/rails/activesupport/lib/active_support/core_ext/enumerable.rb +80 -0
- data/rails/activesupport/lib/active_support/core_ext/file/atomic.rb +63 -0
- data/rails/activesupport/lib/active_support/core_ext/file.rb +1 -0
- data/rails/activesupport/lib/active_support/core_ext/hash/compact.rb +20 -0
- data/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb +243 -0
- data/rails/activesupport/lib/active_support/core_ext/hash/deep_merge.rb +38 -0
- data/rails/activesupport/lib/active_support/core_ext/hash/except.rb +21 -0
- data/rails/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb +23 -0
- data/rails/activesupport/lib/active_support/core_ext/hash/keys.rb +166 -0
- data/rails/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb +22 -0
- data/rails/activesupport/lib/active_support/core_ext/hash/slice.rb +48 -0
- data/rails/activesupport/lib/active_support/core_ext/hash/transform_values.rb +23 -0
- data/rails/activesupport/lib/active_support/core_ext/hash.rb +9 -0
- data/rails/activesupport/lib/active_support/core_ext/integer/inflections.rb +29 -0
- data/rails/activesupport/lib/active_support/core_ext/integer/multiple.rb +10 -0
- data/rails/activesupport/lib/active_support/core_ext/integer/time.rb +44 -0
- data/rails/activesupport/lib/active_support/core_ext/integer.rb +3 -0
- data/rails/activesupport/lib/active_support/core_ext/kernel/agnostics.rb +11 -0
- data/rails/activesupport/lib/active_support/core_ext/kernel/concern.rb +10 -0
- data/rails/activesupport/lib/active_support/core_ext/kernel/debugger.rb +10 -0
- data/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb +124 -0
- data/rails/activesupport/lib/active_support/core_ext/kernel/singleton_class.rb +6 -0
- data/rails/activesupport/lib/active_support/core_ext/kernel.rb +5 -0
- data/rails/activesupport/lib/active_support/core_ext/load_error.rb +28 -0
- data/rails/activesupport/lib/active_support/core_ext/marshal.rb +21 -0
- data/rails/activesupport/lib/active_support/core_ext/module/aliasing.rb +69 -0
- data/rails/activesupport/lib/active_support/core_ext/module/anonymous.rb +19 -0
- data/rails/activesupport/lib/active_support/core_ext/module/attr_internal.rb +39 -0
- data/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb +212 -0
- data/rails/activesupport/lib/active_support/core_ext/module/concerning.rb +135 -0
- data/rails/activesupport/lib/active_support/core_ext/module/delegation.rb +217 -0
- data/rails/activesupport/lib/active_support/core_ext/module/deprecation.rb +23 -0
- data/rails/activesupport/lib/active_support/core_ext/module/introspection.rb +62 -0
- data/rails/activesupport/lib/active_support/core_ext/module/method_transplanting.rb +11 -0
- data/rails/activesupport/lib/active_support/core_ext/module/qualified_const.rb +52 -0
- data/rails/activesupport/lib/active_support/core_ext/module/reachable.rb +8 -0
- data/rails/activesupport/lib/active_support/core_ext/module/remove_method.rb +12 -0
- data/rails/activesupport/lib/active_support/core_ext/module.rb +11 -0
- data/rails/activesupport/lib/active_support/core_ext/name_error.rb +18 -0
- data/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb +44 -0
- data/rails/activesupport/lib/active_support/core_ext/numeric/conversions.rb +135 -0
- data/rails/activesupport/lib/active_support/core_ext/numeric/time.rb +69 -0
- data/rails/activesupport/lib/active_support/core_ext/numeric.rb +3 -0
- data/rails/activesupport/lib/active_support/core_ext/object/acts_like.rb +10 -0
- data/rails/activesupport/lib/active_support/core_ext/object/blank.rb +131 -0
- data/rails/activesupport/lib/active_support/core_ext/object/conversions.rb +4 -0
- data/rails/activesupport/lib/active_support/core_ext/object/deep_dup.rb +46 -0
- data/rails/activesupport/lib/active_support/core_ext/object/duplicable.rb +103 -0
- data/rails/activesupport/lib/active_support/core_ext/object/inclusion.rb +27 -0
- data/rails/activesupport/lib/active_support/core_ext/object/instance_variables.rb +28 -0
- data/rails/activesupport/lib/active_support/core_ext/object/itself.rb +15 -0
- data/rails/activesupport/lib/active_support/core_ext/object/json.rb +197 -0
- data/rails/activesupport/lib/active_support/core_ext/object/to_param.rb +1 -0
- data/rails/activesupport/lib/active_support/core_ext/object/to_query.rb +84 -0
- data/rails/activesupport/lib/active_support/core_ext/object/try.rb +100 -0
- data/rails/activesupport/lib/active_support/core_ext/object/with_options.rb +69 -0
- data/rails/activesupport/lib/active_support/core_ext/object.rb +15 -0
- data/rails/activesupport/lib/active_support/core_ext/range/conversions.rb +19 -0
- data/rails/activesupport/lib/active_support/core_ext/range/each.rb +23 -0
- data/rails/activesupport/lib/active_support/core_ext/range/include_range.rb +23 -0
- data/rails/activesupport/lib/active_support/core_ext/range/overlaps.rb +8 -0
- data/rails/activesupport/lib/active_support/core_ext/range.rb +4 -0
- data/rails/activesupport/lib/active_support/core_ext/regexp.rb +5 -0
- data/rails/activesupport/lib/active_support/core_ext/string/access.rb +104 -0
- data/rails/activesupport/lib/active_support/core_ext/string/behavior.rb +6 -0
- data/rails/activesupport/lib/active_support/core_ext/string/conversions.rb +56 -0
- data/rails/activesupport/lib/active_support/core_ext/string/exclude.rb +11 -0
- data/rails/activesupport/lib/active_support/core_ext/string/filters.rb +102 -0
- data/rails/activesupport/lib/active_support/core_ext/string/indent.rb +43 -0
- data/rails/activesupport/lib/active_support/core_ext/string/inflections.rb +217 -0
- data/rails/activesupport/lib/active_support/core_ext/string/inquiry.rb +13 -0
- data/rails/activesupport/lib/active_support/core_ext/string/multibyte.rb +49 -0
- data/rails/activesupport/lib/active_support/core_ext/string/output_safety.rb +262 -0
- data/rails/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb +4 -0
- data/rails/activesupport/lib/active_support/core_ext/string/strip.rb +26 -0
- data/rails/activesupport/lib/active_support/core_ext/string/zones.rb +14 -0
- data/rails/activesupport/lib/active_support/core_ext/string.rb +13 -0
- data/rails/activesupport/lib/active_support/core_ext/struct.rb +6 -0
- data/rails/activesupport/lib/active_support/core_ext/thread.rb +86 -0
- data/rails/activesupport/lib/active_support/core_ext/time/acts_like.rb +8 -0
- data/rails/activesupport/lib/active_support/core_ext/time/calculations.rb +265 -0
- data/rails/activesupport/lib/active_support/core_ext/time/conversions.rb +65 -0
- data/rails/activesupport/lib/active_support/core_ext/time/marshal.rb +30 -0
- data/rails/activesupport/lib/active_support/core_ext/time/zones.rb +79 -0
- data/rails/activesupport/lib/active_support/core_ext/time.rb +5 -0
- data/rails/activesupport/lib/active_support/core_ext/uri.rb +26 -0
- data/rails/activesupport/lib/active_support/core_ext.rb +3 -0
- data/rails/activesupport/lib/active_support/dependencies/autoload.rb +77 -0
- data/rails/activesupport/lib/active_support/dependencies.rb +762 -0
- data/rails/activesupport/lib/active_support/deprecation/behaviors.rb +76 -0
- data/rails/activesupport/lib/active_support/deprecation/instance_delegator.rb +24 -0
- data/rails/activesupport/lib/active_support/deprecation/method_wrappers.rb +44 -0
- data/rails/activesupport/lib/active_support/deprecation/proxy_wrappers.rb +126 -0
- data/rails/activesupport/lib/active_support/deprecation/reporting.rb +94 -0
- data/rails/activesupport/lib/active_support/deprecation.rb +43 -0
- data/rails/activesupport/lib/active_support/descendants_tracker.rb +60 -0
- data/rails/activesupport/lib/active_support/duration.rb +136 -0
- data/rails/activesupport/lib/active_support/file_update_checker.rb +137 -0
- data/rails/activesupport/lib/active_support/gem_version.rb +15 -0
- data/rails/activesupport/lib/active_support/gzip.rb +36 -0
- data/rails/activesupport/lib/active_support/hash_with_indifferent_access.rb +281 -0
- data/rails/activesupport/lib/active_support/i18n.rb +13 -0
- data/rails/activesupport/lib/active_support/i18n_railtie.rb +94 -0
- data/rails/activesupport/lib/active_support/inflections.rb +70 -0
- data/rails/activesupport/lib/active_support/inflector/inflections.rb +211 -0
- data/rails/activesupport/lib/active_support/inflector/methods.rb +383 -0
- data/rails/activesupport/lib/active_support/inflector/transliterate.rb +97 -0
- data/rails/activesupport/lib/active_support/inflector.rb +7 -0
- data/rails/activesupport/lib/active_support/json/decoding.rb +73 -0
- data/rails/activesupport/lib/active_support/json/encoding.rb +172 -0
- data/rails/activesupport/lib/active_support/json.rb +2 -0
- data/rails/activesupport/lib/active_support/key_generator.rb +73 -0
- data/rails/activesupport/lib/active_support/lazy_load_hooks.rb +48 -0
- data/rails/activesupport/lib/active_support/locale/en.yml +133 -0
- data/rails/activesupport/lib/active_support/log_subscriber/test_helper.rb +104 -0
- data/rails/activesupport/lib/active_support/log_subscriber.rb +109 -0
- data/rails/activesupport/lib/active_support/logger.rb +57 -0
- data/rails/activesupport/lib/active_support/logger_silence.rb +24 -0
- data/rails/activesupport/lib/active_support/message_encryptor.rb +107 -0
- data/rails/activesupport/lib/active_support/message_verifier.rb +72 -0
- data/rails/activesupport/lib/active_support/multibyte/chars.rb +222 -0
- data/rails/activesupport/lib/active_support/multibyte/unicode.rb +390 -0
- data/rails/activesupport/lib/active_support/multibyte.rb +21 -0
- data/rails/activesupport/lib/active_support/notifications/fanout.rb +157 -0
- data/rails/activesupport/lib/active_support/notifications/instrumenter.rb +73 -0
- data/rails/activesupport/lib/active_support/notifications.rb +212 -0
- data/rails/activesupport/lib/active_support/number_helper/number_converter.rb +182 -0
- data/rails/activesupport/lib/active_support/number_helper/number_to_currency_converter.rb +46 -0
- data/rails/activesupport/lib/active_support/number_helper/number_to_delimited_converter.rb +23 -0
- data/rails/activesupport/lib/active_support/number_helper/number_to_human_converter.rb +66 -0
- data/rails/activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb +58 -0
- data/rails/activesupport/lib/active_support/number_helper/number_to_percentage_converter.rb +12 -0
- data/rails/activesupport/lib/active_support/number_helper/number_to_phone_converter.rb +49 -0
- data/rails/activesupport/lib/active_support/number_helper/number_to_rounded_converter.rb +87 -0
- data/rails/activesupport/lib/active_support/number_helper.rb +345 -0
- data/rails/activesupport/lib/active_support/option_merger.rb +25 -0
- data/rails/activesupport/lib/active_support/ordered_hash.rb +48 -0
- data/rails/activesupport/lib/active_support/ordered_options.rb +67 -0
- data/rails/activesupport/lib/active_support/per_thread_registry.rb +53 -0
- data/rails/activesupport/lib/active_support/proxy_object.rb +13 -0
- data/rails/activesupport/lib/active_support/rails.rb +27 -0
- data/rails/activesupport/lib/active_support/railtie.rb +46 -0
- data/rails/activesupport/lib/active_support/rescuable.rb +119 -0
- data/rails/activesupport/lib/active_support/security_utils.rb +20 -0
- data/rails/activesupport/lib/active_support/string_inquirer.rb +26 -0
- data/rails/activesupport/lib/active_support/subscriber.rb +125 -0
- data/rails/activesupport/lib/active_support/tagged_logging.rb +76 -0
- data/rails/activesupport/lib/active_support/test_case.rb +100 -0
- data/rails/activesupport/lib/active_support/testing/assertions.rb +97 -0
- data/rails/activesupport/lib/active_support/testing/autorun.rb +5 -0
- data/rails/activesupport/lib/active_support/testing/constant_lookup.rb +50 -0
- data/rails/activesupport/lib/active_support/testing/declarative.rb +26 -0
- data/rails/activesupport/lib/active_support/testing/deprecation.rb +35 -0
- data/rails/activesupport/lib/active_support/testing/isolation.rb +101 -0
- data/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb +50 -0
- data/rails/activesupport/lib/active_support/testing/tagged_logging.rb +25 -0
- data/rails/activesupport/lib/active_support/testing/time_helpers.rb +131 -0
- data/rails/activesupport/lib/active_support/time.rb +18 -0
- data/rails/activesupport/lib/active_support/time_with_zone.rb +409 -0
- data/rails/activesupport/lib/active_support/values/time_zone.rb +428 -0
- data/rails/activesupport/lib/active_support/values/unicode_tables.dat +0 -0
- data/rails/activesupport/lib/active_support/version.rb +8 -0
- data/rails/activesupport/lib/active_support/xml_mini/jdom.rb +180 -0
- data/rails/activesupport/lib/active_support/xml_mini/libxml.rb +79 -0
- data/rails/activesupport/lib/active_support/xml_mini/libxmlsax.rb +85 -0
- data/rails/activesupport/lib/active_support/xml_mini/nokogiri.rb +83 -0
- data/rails/activesupport/lib/active_support/xml_mini/nokogirisax.rb +87 -0
- data/rails/activesupport/lib/active_support/xml_mini/rexml.rb +129 -0
- data/rails/activesupport/lib/active_support/xml_mini.rb +191 -0
- data/rails/activesupport/lib/active_support.rb +85 -0
- data/rails/activesupport/test/abstract_unit.rb +45 -0
- data/rails/activesupport/test/autoload_test.rb +81 -0
- data/rails/activesupport/test/autoloading_fixtures/a/b.rb +2 -0
- data/rails/activesupport/test/autoloading_fixtures/a/c/d.rb +2 -0
- data/rails/activesupport/test/autoloading_fixtures/a/c/e/f.rb +2 -0
- data/rails/activesupport/test/autoloading_fixtures/application.rb +1 -0
- data/rails/activesupport/test/autoloading_fixtures/circular1.rb +6 -0
- data/rails/activesupport/test/autoloading_fixtures/circular2.rb +4 -0
- data/rails/activesupport/test/autoloading_fixtures/class_folder/class_folder_subclass.rb +3 -0
- data/rails/activesupport/test/autoloading_fixtures/class_folder/inline_class.rb +2 -0
- data/rails/activesupport/test/autoloading_fixtures/class_folder/nested_class.rb +7 -0
- data/rails/activesupport/test/autoloading_fixtures/class_folder.rb +3 -0
- data/rails/activesupport/test/autoloading_fixtures/conflict.rb +1 -0
- data/rails/activesupport/test/autoloading_fixtures/counting_loader.rb +5 -0
- data/rails/activesupport/test/autoloading_fixtures/cross_site_dependency.rb +2 -0
- data/rails/activesupport/test/autoloading_fixtures/e.rb +2 -0
- data/rails/activesupport/test/autoloading_fixtures/html/some_class.rb +4 -0
- data/rails/activesupport/test/autoloading_fixtures/load_path/loaded_constant.rb +3 -0
- data/rails/activesupport/test/autoloading_fixtures/loads_constant.rb +5 -0
- data/rails/activesupport/test/autoloading_fixtures/module_folder/inline_class.rb +2 -0
- data/rails/activesupport/test/autoloading_fixtures/module_folder/nested_class.rb +4 -0
- data/rails/activesupport/test/autoloading_fixtures/module_folder/nested_sibling.rb +2 -0
- data/rails/activesupport/test/autoloading_fixtures/module_with_custom_const_missing/a/b.rb +1 -0
- data/rails/activesupport/test/autoloading_fixtures/multiple_constant_file.rb +2 -0
- data/rails/activesupport/test/autoloading_fixtures/raises_name_error.rb +3 -0
- data/rails/activesupport/test/autoloading_fixtures/raises_no_method_error.rb +3 -0
- data/rails/activesupport/test/autoloading_fixtures/requires_constant.rb +5 -0
- data/rails/activesupport/test/autoloading_fixtures/should_not_be_required.rb +1 -0
- data/rails/activesupport/test/autoloading_fixtures/typo.rb +2 -0
- data/rails/activesupport/test/benchmarkable_test.rb +62 -0
- data/rails/activesupport/test/broadcast_logger_test.rb +82 -0
- data/rails/activesupport/test/caching_test.rb +1076 -0
- data/rails/activesupport/test/callback_inheritance_test.rb +176 -0
- data/rails/activesupport/test/callbacks_test.rb +1003 -0
- data/rails/activesupport/test/class_cache_test.rb +78 -0
- data/rails/activesupport/test/clean_backtrace_test.rb +75 -0
- data/rails/activesupport/test/clean_logger_test.rb +29 -0
- data/rails/activesupport/test/concern_test.rb +104 -0
- data/rails/activesupport/test/configurable_test.rb +123 -0
- data/rails/activesupport/test/constantize_test_cases.rb +116 -0
- data/rails/activesupport/test/core_ext/array/access_test.rb +30 -0
- data/rails/activesupport/test/core_ext/array/conversions_test.rb +197 -0
- data/rails/activesupport/test/core_ext/array/extract_options_test.rb +45 -0
- data/rails/activesupport/test/core_ext/array/grouping_test.rb +126 -0
- data/rails/activesupport/test/core_ext/array/prepend_append_test.rb +12 -0
- data/rails/activesupport/test/core_ext/array/wrap_test.rb +77 -0
- data/rails/activesupport/test/core_ext/big_decimal/yaml_conversions_test.rb +11 -0
- data/rails/activesupport/test/core_ext/bigdecimal_test.rb +9 -0
- data/rails/activesupport/test/core_ext/class/attribute_test.rb +91 -0
- data/rails/activesupport/test/core_ext/class/delegating_attributes_test.rb +122 -0
- data/rails/activesupport/test/core_ext/class_test.rb +28 -0
- data/rails/activesupport/test/core_ext/date_and_time_behavior.rb +241 -0
- data/rails/activesupport/test/core_ext/date_ext_test.rb +373 -0
- data/rails/activesupport/test/core_ext/date_time_ext_test.rb +358 -0
- data/rails/activesupport/test/core_ext/digest/uuid_test.rb +24 -0
- data/rails/activesupport/test/core_ext/duration_test.rb +223 -0
- data/rails/activesupport/test/core_ext/enumerable_test.rb +106 -0
- data/rails/activesupport/test/core_ext/file_test.rb +68 -0
- data/rails/activesupport/test/core_ext/hash/transform_keys_test.rb +32 -0
- data/rails/activesupport/test/core_ext/hash/transform_values_test.rb +61 -0
- data/rails/activesupport/test/core_ext/hash_ext_test.rb +1688 -0
- data/rails/activesupport/test/core_ext/integer_ext_test.rb +30 -0
- data/rails/activesupport/test/core_ext/kernel/concern_test.rb +13 -0
- data/rails/activesupport/test/core_ext/kernel_test.rb +138 -0
- data/rails/activesupport/test/core_ext/load_error_test.rb +41 -0
- data/rails/activesupport/test/core_ext/marshal_test.rb +124 -0
- data/rails/activesupport/test/core_ext/module/anonymous_test.rb +14 -0
- data/rails/activesupport/test/core_ext/module/attr_internal_test.rb +53 -0
- data/rails/activesupport/test/core_ext/module/attribute_accessor_test.rb +79 -0
- data/rails/activesupport/test/core_ext/module/attribute_aliasing_test.rb +59 -0
- data/rails/activesupport/test/core_ext/module/concerning_test.rb +65 -0
- data/rails/activesupport/test/core_ext/module/qualified_const_test.rb +108 -0
- data/rails/activesupport/test/core_ext/module/reachable_test.rb +41 -0
- data/rails/activesupport/test/core_ext/module/remove_method_test.rb +29 -0
- data/rails/activesupport/test/core_ext/module_test.rb +509 -0
- data/rails/activesupport/test/core_ext/name_error_test.rb +21 -0
- data/rails/activesupport/test/core_ext/numeric_ext_test.rb +392 -0
- data/rails/activesupport/test/core_ext/object/acts_like_test.rb +33 -0
- data/rails/activesupport/test/core_ext/object/blank_test.rb +36 -0
- data/rails/activesupport/test/core_ext/object/deep_dup_test.rb +53 -0
- data/rails/activesupport/test/core_ext/object/duplicable_test.rb +31 -0
- data/rails/activesupport/test/core_ext/object/inclusion_test.rb +59 -0
- data/rails/activesupport/test/core_ext/object/instance_variables_test.rb +31 -0
- data/rails/activesupport/test/core_ext/object/itself_test.rb +9 -0
- data/rails/activesupport/test/core_ext/object/json_cherry_pick_test.rb +42 -0
- data/rails/activesupport/test/core_ext/object/to_param_test.rb +37 -0
- data/rails/activesupport/test/core_ext/object/to_query_test.rb +82 -0
- data/rails/activesupport/test/core_ext/object/try_test.rb +99 -0
- data/rails/activesupport/test/core_ext/range_ext_test.rb +125 -0
- data/rails/activesupport/test/core_ext/regexp_ext_test.rb +10 -0
- data/rails/activesupport/test/core_ext/string_ext_test.rb +864 -0
- data/rails/activesupport/test/core_ext/struct_test.rb +10 -0
- data/rails/activesupport/test/core_ext/thread_test.rb +75 -0
- data/rails/activesupport/test/core_ext/time_ext_test.rb +901 -0
- data/rails/activesupport/test/core_ext/time_with_zone_test.rb +1121 -0
- data/rails/activesupport/test/core_ext/uri_ext_test.rb +13 -0
- data/rails/activesupport/test/dependencies/check_warnings.rb +2 -0
- data/rails/activesupport/test/dependencies/conflict.rb +1 -0
- data/rails/activesupport/test/dependencies/cross_site_depender.rb +3 -0
- data/rails/activesupport/test/dependencies/mutual_one.rb +4 -0
- data/rails/activesupport/test/dependencies/mutual_two.rb +4 -0
- data/rails/activesupport/test/dependencies/raises_exception.rb +3 -0
- data/rails/activesupport/test/dependencies/raises_exception_without_blame_file.rb +5 -0
- data/rails/activesupport/test/dependencies/requires_nonexistent0.rb +1 -0
- data/rails/activesupport/test/dependencies/requires_nonexistent1.rb +1 -0
- data/rails/activesupport/test/dependencies/service_one.rb +5 -0
- data/rails/activesupport/test/dependencies/service_two.rb +2 -0
- data/rails/activesupport/test/dependencies_test.rb +1059 -0
- data/rails/activesupport/test/dependencies_test_helpers.rb +28 -0
- data/rails/activesupport/test/deprecation/proxy_wrappers_test.rb +22 -0
- data/rails/activesupport/test/deprecation_test.rb +375 -0
- data/rails/activesupport/test/descendants_tracker_test_cases.rb +65 -0
- data/rails/activesupport/test/descendants_tracker_with_autoloading_test.rb +34 -0
- data/rails/activesupport/test/descendants_tracker_without_autoloading_test.rb +17 -0
- data/rails/activesupport/test/file_update_checker_test.rb +112 -0
- data/rails/activesupport/test/fixtures/autoload/another_class.rb +2 -0
- data/rails/activesupport/test/fixtures/autoload/some_class.rb +2 -0
- data/rails/activesupport/test/fixtures/xml/jdom_doctype.dtd +1 -0
- data/rails/activesupport/test/fixtures/xml/jdom_entities.txt +1 -0
- data/rails/activesupport/test/fixtures/xml/jdom_include.txt +1 -0
- data/rails/activesupport/test/gzip_test.rb +33 -0
- data/rails/activesupport/test/hash_with_indifferent_access_test.rb +10 -0
- data/rails/activesupport/test/i18n_test.rb +104 -0
- data/rails/activesupport/test/inflector_test.rb +537 -0
- data/rails/activesupport/test/inflector_test_cases.rb +324 -0
- data/rails/activesupport/test/json/decoding_test.rb +113 -0
- data/rails/activesupport/test/json/encoding_test.rb +547 -0
- data/rails/activesupport/test/key_generator_test.rb +62 -0
- data/rails/activesupport/test/lazy_load_hooks_test.rb +96 -0
- data/rails/activesupport/test/load_paths_test.rb +16 -0
- data/rails/activesupport/test/log_subscriber_test.rb +123 -0
- data/rails/activesupport/test/logger_test.rb +133 -0
- data/rails/activesupport/test/message_encryptor_test.rb +101 -0
- data/rails/activesupport/test/message_verifier_test.rb +86 -0
- data/rails/activesupport/test/multibyte_chars_test.rb +714 -0
- data/rails/activesupport/test/multibyte_conformance_test.rb +133 -0
- data/rails/activesupport/test/multibyte_proxy_test.rb +34 -0
- data/rails/activesupport/test/multibyte_test_helpers.rb +19 -0
- data/rails/activesupport/test/multibyte_unicode_database_test.rb +26 -0
- data/rails/activesupport/test/notifications/evented_notification_test.rb +87 -0
- data/rails/activesupport/test/notifications/instrumenter_test.rb +58 -0
- data/rails/activesupport/test/notifications_test.rb +266 -0
- data/rails/activesupport/test/number_helper_i18n_test.rb +148 -0
- data/rails/activesupport/test/number_helper_test.rb +396 -0
- data/rails/activesupport/test/option_merger_test.rb +95 -0
- data/rails/activesupport/test/ordered_hash_test.rb +322 -0
- data/rails/activesupport/test/ordered_options_test.rb +88 -0
- data/rails/activesupport/test/rescuable_test.rb +105 -0
- data/rails/activesupport/test/safe_buffer_test.rb +180 -0
- data/rails/activesupport/test/security_utils_test.rb +9 -0
- data/rails/activesupport/test/string_inquirer_test.rb +23 -0
- data/rails/activesupport/test/subscriber_test.rb +54 -0
- data/rails/activesupport/test/tagged_logging_test.rb +102 -0
- data/rails/activesupport/test/test_case_test.rb +221 -0
- data/rails/activesupport/test/testing/constant_lookup_test.rb +76 -0
- data/rails/activesupport/test/time_travel_test.rb +72 -0
- data/rails/activesupport/test/time_zone_test.rb +422 -0
- data/rails/activesupport/test/time_zone_test_helpers.rb +16 -0
- data/rails/activesupport/test/transliterate_test.rb +35 -0
- data/rails/activesupport/test/xml_mini/jdom_engine_test.rb +188 -0
- data/rails/activesupport/test/xml_mini/libxml_engine_test.rb +204 -0
- data/rails/activesupport/test/xml_mini/libxmlsax_engine_test.rb +195 -0
- data/rails/activesupport/test/xml_mini/nokogiri_engine_test.rb +217 -0
- data/rails/activesupport/test/xml_mini/nokogirisax_engine_test.rb +218 -0
- data/rails/activesupport/test/xml_mini/rexml_engine_test.rb +37 -0
- data/rails/activesupport/test/xml_mini_test.rb +353 -0
- data/rails/ci/travis.rb +145 -0
- data/rails/guides/.document +0 -0
- data/rails/guides/CHANGELOG.md +31 -0
- data/rails/guides/Rakefile +79 -0
- data/rails/guides/assets/images/akshaysurve.jpg +0 -0
- data/rails/guides/assets/images/belongs_to.png +0 -0
- data/rails/guides/assets/images/book_icon.gif +0 -0
- data/rails/guides/assets/images/bullet.gif +0 -0
- data/rails/guides/assets/images/chapters_icon.gif +0 -0
- data/rails/guides/assets/images/check_bullet.gif +0 -0
- data/rails/guides/assets/images/credits_pic_blank.gif +0 -0
- data/rails/guides/assets/images/csrf.png +0 -0
- data/rails/guides/assets/images/edge_badge.png +0 -0
- data/rails/guides/assets/images/favicon.ico +0 -0
- data/rails/guides/assets/images/feature_tile.gif +0 -0
- data/rails/guides/assets/images/footer_tile.gif +0 -0
- data/rails/guides/assets/images/fxn.png +0 -0
- data/rails/guides/assets/images/getting_started/article_with_comments.png +0 -0
- data/rails/guides/assets/images/getting_started/challenge.png +0 -0
- data/rails/guides/assets/images/getting_started/confirm_dialog.png +0 -0
- data/rails/guides/assets/images/getting_started/forbidden_attributes_for_new_article.png +0 -0
- data/rails/guides/assets/images/getting_started/form_with_errors.png +0 -0
- data/rails/guides/assets/images/getting_started/index_action_with_edit_link.png +0 -0
- data/rails/guides/assets/images/getting_started/new_article.png +0 -0
- data/rails/guides/assets/images/getting_started/rails_welcome.png +0 -0
- data/rails/guides/assets/images/getting_started/routing_error_no_controller.png +0 -0
- data/rails/guides/assets/images/getting_started/routing_error_no_route_matches.png +0 -0
- data/rails/guides/assets/images/getting_started/show_action_for_articles.png +0 -0
- data/rails/guides/assets/images/getting_started/template_is_missing_articles_new.png +0 -0
- data/rails/guides/assets/images/getting_started/unknown_action_create_for_articles.png +0 -0
- data/rails/guides/assets/images/getting_started/unknown_action_new_for_articles.png +0 -0
- data/rails/guides/assets/images/grey_bullet.gif +0 -0
- data/rails/guides/assets/images/habtm.png +0 -0
- data/rails/guides/assets/images/has_many.png +0 -0
- data/rails/guides/assets/images/has_many_through.png +0 -0
- data/rails/guides/assets/images/has_one.png +0 -0
- data/rails/guides/assets/images/has_one_through.png +0 -0
- data/rails/guides/assets/images/header_backdrop.png +0 -0
- data/rails/guides/assets/images/header_tile.gif +0 -0
- data/rails/guides/assets/images/i18n/demo_html_safe.png +0 -0
- data/rails/guides/assets/images/i18n/demo_localized_pirate.png +0 -0
- data/rails/guides/assets/images/i18n/demo_translated_en.png +0 -0
- data/rails/guides/assets/images/i18n/demo_translated_pirate.png +0 -0
- data/rails/guides/assets/images/i18n/demo_translation_missing.png +0 -0
- data/rails/guides/assets/images/i18n/demo_untranslated.png +0 -0
- data/rails/guides/assets/images/icons/README +5 -0
- data/rails/guides/assets/images/icons/callouts/1.png +0 -0
- data/rails/guides/assets/images/icons/callouts/10.png +0 -0
- data/rails/guides/assets/images/icons/callouts/11.png +0 -0
- data/rails/guides/assets/images/icons/callouts/12.png +0 -0
- data/rails/guides/assets/images/icons/callouts/13.png +0 -0
- data/rails/guides/assets/images/icons/callouts/14.png +0 -0
- data/rails/guides/assets/images/icons/callouts/15.png +0 -0
- data/rails/guides/assets/images/icons/callouts/2.png +0 -0
- data/rails/guides/assets/images/icons/callouts/3.png +0 -0
- data/rails/guides/assets/images/icons/callouts/4.png +0 -0
- data/rails/guides/assets/images/icons/callouts/5.png +0 -0
- data/rails/guides/assets/images/icons/callouts/6.png +0 -0
- data/rails/guides/assets/images/icons/callouts/7.png +0 -0
- data/rails/guides/assets/images/icons/callouts/8.png +0 -0
- data/rails/guides/assets/images/icons/callouts/9.png +0 -0
- data/rails/guides/assets/images/icons/caution.png +0 -0
- data/rails/guides/assets/images/icons/example.png +0 -0
- data/rails/guides/assets/images/icons/home.png +0 -0
- data/rails/guides/assets/images/icons/important.png +0 -0
- data/rails/guides/assets/images/icons/next.png +0 -0
- data/rails/guides/assets/images/icons/note.png +0 -0
- data/rails/guides/assets/images/icons/prev.png +0 -0
- data/rails/guides/assets/images/icons/tip.png +0 -0
- data/rails/guides/assets/images/icons/up.png +0 -0
- data/rails/guides/assets/images/icons/warning.png +0 -0
- data/rails/guides/assets/images/nav_arrow.gif +0 -0
- data/rails/guides/assets/images/oscardelben.jpg +0 -0
- data/rails/guides/assets/images/polymorphic.png +0 -0
- data/rails/guides/assets/images/radar.png +0 -0
- data/rails/guides/assets/images/rails4_features.png +0 -0
- data/rails/guides/assets/images/rails_guides_kindle_cover.jpg +0 -0
- data/rails/guides/assets/images/rails_guides_logo.gif +0 -0
- data/rails/guides/assets/images/rails_logo_remix.gif +0 -0
- data/rails/guides/assets/images/session_fixation.png +0 -0
- data/rails/guides/assets/images/tab_grey.gif +0 -0
- data/rails/guides/assets/images/tab_info.gif +0 -0
- data/rails/guides/assets/images/tab_note.gif +0 -0
- data/rails/guides/assets/images/tab_red.gif +0 -0
- data/rails/guides/assets/images/tab_yellow.gif +0 -0
- data/rails/guides/assets/images/tab_yellow.png +0 -0
- data/rails/guides/assets/images/vijaydev.jpg +0 -0
- data/rails/guides/assets/javascripts/guides.js +59 -0
- data/rails/guides/assets/javascripts/jquery.min.js +4 -0
- data/rails/guides/assets/javascripts/responsive-tables.js +43 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushAS3.js +59 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushAppleScript.js +75 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushBash.js +59 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushCSharp.js +65 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushColdFusion.js +100 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushCpp.js +97 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushCss.js +91 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushDelphi.js +55 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushDiff.js +41 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushErlang.js +52 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushGroovy.js +67 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushJScript.js +52 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushJava.js +57 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushJavaFX.js +58 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushPerl.js +72 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushPhp.js +88 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushPlain.js +33 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushPowerShell.js +74 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushPython.js +64 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushRuby.js +55 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushSass.js +94 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushScala.js +51 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushSql.js +66 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushVb.js +56 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shBrushXml.js +69 -0
- data/rails/guides/assets/javascripts/syntaxhighlighter/shCore.js +17 -0
- data/rails/guides/assets/stylesheets/fixes.css +16 -0
- data/rails/guides/assets/stylesheets/kindle.css +11 -0
- data/rails/guides/assets/stylesheets/main.css +713 -0
- data/rails/guides/assets/stylesheets/print.css +52 -0
- data/rails/guides/assets/stylesheets/reset.css +43 -0
- data/rails/guides/assets/stylesheets/responsive-tables.css +50 -0
- data/rails/guides/assets/stylesheets/style.css +13 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shCore.css +226 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shCoreDefault.css +328 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shCoreDjango.css +331 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shCoreEclipse.css +339 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shCoreEmacs.css +324 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shCoreFadeToGrey.css +328 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shCoreMDUltra.css +324 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shCoreMidnight.css +324 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shCoreRDark.css +324 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shThemeDefault.css +117 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shThemeDjango.css +120 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shThemeEclipse.css +128 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shThemeEmacs.css +113 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shThemeFadeToGrey.css +117 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shThemeMDUltra.css +113 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shThemeMidnight.css +113 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shThemeRDark.css +113 -0
- data/rails/guides/assets/stylesheets/syntaxhighlighter/shThemeRailsGuides.css +116 -0
- data/rails/guides/bug_report_templates/action_controller_gem.rb +47 -0
- data/rails/guides/bug_report_templates/action_controller_master.rb +54 -0
- data/rails/guides/bug_report_templates/active_record_gem.rb +40 -0
- data/rails/guides/bug_report_templates/active_record_master.rb +49 -0
- data/rails/guides/rails_guides/generator.rb +248 -0
- data/rails/guides/rails_guides/helpers.rb +53 -0
- data/rails/guides/rails_guides/indexer.rb +68 -0
- data/rails/guides/rails_guides/kindle.rb +119 -0
- data/rails/guides/rails_guides/levenshtein.rb +39 -0
- data/rails/guides/rails_guides/markdown/renderer.rb +82 -0
- data/rails/guides/rails_guides/markdown.rb +167 -0
- data/rails/guides/rails_guides.rb +63 -0
- data/rails/guides/source/2_2_release_notes.md +435 -0
- data/rails/guides/source/2_3_release_notes.md +621 -0
- data/rails/guides/source/3_0_release_notes.md +611 -0
- data/rails/guides/source/3_1_release_notes.md +559 -0
- data/rails/guides/source/3_2_release_notes.md +568 -0
- data/rails/guides/source/4_0_release_notes.md +279 -0
- data/rails/guides/source/4_1_release_notes.md +730 -0
- data/rails/guides/source/4_2_release_notes.md +853 -0
- data/rails/guides/source/_license.html.erb +2 -0
- data/rails/guides/source/_welcome.html.erb +19 -0
- data/rails/guides/source/action_controller_overview.md +1192 -0
- data/rails/guides/source/action_mailer_basics.md +754 -0
- data/rails/guides/source/action_view_overview.md +1620 -0
- data/rails/guides/source/active_job_basics.md +318 -0
- data/rails/guides/source/active_model_basics.md +554 -0
- data/rails/guides/source/active_record_basics.md +374 -0
- data/rails/guides/source/active_record_callbacks.md +413 -0
- data/rails/guides/source/active_record_migrations.md +1018 -0
- data/rails/guides/source/active_record_postgresql.md +433 -0
- data/rails/guides/source/active_record_querying.md +1783 -0
- data/rails/guides/source/active_record_validations.md +1178 -0
- data/rails/guides/source/active_support_core_extensions.md +3904 -0
- data/rails/guides/source/active_support_instrumentation.md +499 -0
- data/rails/guides/source/api_documentation_guidelines.md +361 -0
- data/rails/guides/source/asset_pipeline.md +1360 -0
- data/rails/guides/source/association_basics.md +2235 -0
- data/rails/guides/source/autoloading_and_reloading_constants.md +1310 -0
- data/rails/guides/source/caching_with_rails.md +379 -0
- data/rails/guides/source/command_line.md +625 -0
- data/rails/guides/source/configuring.md +1045 -0
- data/rails/guides/source/contributing_to_ruby_on_rails.md +628 -0
- data/rails/guides/source/credits.html.erb +80 -0
- data/rails/guides/source/debugging_rails_applications.md +861 -0
- data/rails/guides/source/development_dependencies_install.md +289 -0
- data/rails/guides/source/documents.yaml +205 -0
- data/rails/guides/source/engines.md +1412 -0
- data/rails/guides/source/form_helpers.md +1024 -0
- data/rails/guides/source/generators.md +676 -0
- data/rails/guides/source/getting_started.md +2091 -0
- data/rails/guides/source/i18n.md +1087 -0
- data/rails/guides/source/index.html.erb +28 -0
- data/rails/guides/source/initialization.md +704 -0
- data/rails/guides/source/kindle/copyright.html.erb +1 -0
- data/rails/guides/source/kindle/layout.html.erb +27 -0
- data/rails/guides/source/kindle/rails_guides.opf.erb +52 -0
- data/rails/guides/source/kindle/toc.html.erb +24 -0
- data/rails/guides/source/kindle/toc.ncx.erb +64 -0
- data/rails/guides/source/kindle/welcome.html.erb +5 -0
- data/rails/guides/source/layout.html.erb +143 -0
- data/rails/guides/source/layouts_and_rendering.md +1227 -0
- data/rails/guides/source/maintenance_policy.md +78 -0
- data/rails/guides/source/nested_model_forms.md +228 -0
- data/rails/guides/source/plugins.md +444 -0
- data/rails/guides/source/rails_application_templates.md +266 -0
- data/rails/guides/source/rails_on_rack.md +336 -0
- data/rails/guides/source/routing.md +1141 -0
- data/rails/guides/source/ruby_on_rails_guides_guidelines.md +127 -0
- data/rails/guides/source/security.md +1024 -0
- data/rails/guides/source/testing.md +1132 -0
- data/rails/guides/source/upgrading_ruby_on_rails.md +1170 -0
- data/rails/guides/source/working_with_javascript_in_rails.md +407 -0
- data/rails/guides/w3c_validator.rb +97 -0
- data/rails/install.rb +16 -0
- data/rails/load_paths.rb +3 -0
- data/rails/rails.gemspec +32 -0
- data/rails/railties/.gitignore +1 -0
- data/rails/railties/CHANGELOG.md +233 -0
- data/rails/railties/MIT-LICENSE +20 -0
- data/rails/railties/RDOC_MAIN.rdoc +73 -0
- data/rails/railties/README.rdoc +41 -0
- data/rails/railties/Rakefile +50 -0
- data/rails/railties/bin/rails +9 -0
- data/rails/railties/lib/rails/all.rb +16 -0
- data/rails/railties/lib/rails/api/task.rb +170 -0
- data/rails/railties/lib/rails/app_rails_loader.rb +63 -0
- data/rails/railties/lib/rails/application/bootstrap.rb +94 -0
- data/rails/railties/lib/rails/application/configuration.rb +208 -0
- data/rails/railties/lib/rails/application/default_middleware_stack.rb +103 -0
- data/rails/railties/lib/rails/application/finisher.rb +113 -0
- data/rails/railties/lib/rails/application/routes_reloader.rb +56 -0
- data/rails/railties/lib/rails/application.rb +539 -0
- data/rails/railties/lib/rails/application_controller.rb +16 -0
- data/rails/railties/lib/rails/backtrace_cleaner.rb +32 -0
- data/rails/railties/lib/rails/cli.rb +15 -0
- data/rails/railties/lib/rails/code_statistics.rb +104 -0
- data/rails/railties/lib/rails/code_statistics_calculator.rb +79 -0
- data/rails/railties/lib/rails/commands/application.rb +17 -0
- data/rails/railties/lib/rails/commands/commands_tasks.rb +169 -0
- data/rails/railties/lib/rails/commands/console.rb +113 -0
- data/rails/railties/lib/rails/commands/dbconsole.rb +192 -0
- data/rails/railties/lib/rails/commands/destroy.rb +11 -0
- data/rails/railties/lib/rails/commands/generate.rb +13 -0
- data/rails/railties/lib/rails/commands/plugin.rb +23 -0
- data/rails/railties/lib/rails/commands/runner.rb +63 -0
- data/rails/railties/lib/rails/commands/server.rb +148 -0
- data/rails/railties/lib/rails/commands.rb +17 -0
- data/rails/railties/lib/rails/configuration.rb +119 -0
- data/rails/railties/lib/rails/console/app.rb +32 -0
- data/rails/railties/lib/rails/console/helpers.rb +17 -0
- data/rails/railties/lib/rails/deprecation.rb +19 -0
- data/rails/railties/lib/rails/engine/commands.rb +41 -0
- data/rails/railties/lib/rails/engine/configuration.rb +91 -0
- data/rails/railties/lib/rails/engine/railties.rb +21 -0
- data/rails/railties/lib/rails/engine.rb +694 -0
- data/rails/railties/lib/rails/gem_version.rb +15 -0
- data/rails/railties/lib/rails/generators/actions/create_migration.rb +69 -0
- data/rails/railties/lib/rails/generators/actions.rb +282 -0
- data/rails/railties/lib/rails/generators/active_model.rb +78 -0
- data/rails/railties/lib/rails/generators/app_base.rb +354 -0
- data/rails/railties/lib/rails/generators/base.rb +379 -0
- data/rails/railties/lib/rails/generators/css/assets/assets_generator.rb +13 -0
- data/rails/railties/lib/rails/generators/css/assets/templates/stylesheet.css +4 -0
- data/rails/railties/lib/rails/generators/css/scaffold/scaffold_generator.rb +16 -0
- data/rails/railties/lib/rails/generators/erb/controller/controller_generator.rb +22 -0
- data/rails/railties/lib/rails/generators/erb/controller/templates/view.html.erb +2 -0
- data/rails/railties/lib/rails/generators/erb/mailer/mailer_generator.rb +36 -0
- data/rails/railties/lib/rails/generators/erb/mailer/templates/layout.html.erb +5 -0
- data/rails/railties/lib/rails/generators/erb/mailer/templates/layout.text.erb +1 -0
- data/rails/railties/lib/rails/generators/erb/mailer/templates/view.html.erb +5 -0
- data/rails/railties/lib/rails/generators/erb/mailer/templates/view.text.erb +3 -0
- data/rails/railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb +31 -0
- data/rails/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb +32 -0
- data/rails/railties/lib/rails/generators/erb/scaffold/templates/edit.html.erb +6 -0
- data/rails/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb +31 -0
- data/rails/railties/lib/rails/generators/erb/scaffold/templates/new.html.erb +5 -0
- data/rails/railties/lib/rails/generators/erb/scaffold/templates/show.html.erb +11 -0
- data/rails/railties/lib/rails/generators/erb.rb +25 -0
- data/rails/railties/lib/rails/generators/generated_attribute.rb +170 -0
- data/rails/railties/lib/rails/generators/js/assets/assets_generator.rb +13 -0
- data/rails/railties/lib/rails/generators/js/assets/templates/javascript.js +2 -0
- data/rails/railties/lib/rails/generators/migration.rb +69 -0
- data/rails/railties/lib/rails/generators/model_helpers.rb +28 -0
- data/rails/railties/lib/rails/generators/named_base.rb +205 -0
- data/rails/railties/lib/rails/generators/rails/app/USAGE +15 -0
- data/rails/railties/lib/rails/generators/rails/app/app_generator.rb +407 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/Gemfile +46 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/README.rdoc +28 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/Rakefile +6 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt +20 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css +15 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb.tt +5 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/app/helpers/application_helper.rb +2 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +23 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/bin/bundle +2 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/bin/rails +3 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/bin/rake +3 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/bin/setup +28 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/application.rb +41 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/boot.rb +3 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml +49 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml +85 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml +68 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml +52 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml +68 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml +23 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml +58 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/databases/oracle.yml +58 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml +85 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml +25 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml +68 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/environment.rb +5 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +45 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +83 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +42 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +11 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/initializers/backtrace_silencers.rb +7 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/initializers/cookies_serializer.rb +3 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb +4 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/initializers/inflections.rb +16 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/initializers/mime_types.rb +4 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/initializers/session_store.rb.tt +3 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt +16 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/locales/en.yml +23 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/routes.rb +56 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config/secrets.yml +22 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/config.ru +4 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +7 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/gitignore +19 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/public/404.html +67 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/public/422.html +67 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/public/500.html +66 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/public/favicon.ico +0 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/public/robots.txt +5 -0
- data/rails/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb +12 -0
- data/rails/railties/lib/rails/generators/rails/assets/USAGE +20 -0
- data/rails/railties/lib/rails/generators/rails/assets/assets_generator.rb +25 -0
- data/rails/railties/lib/rails/generators/rails/assets/templates/javascript.js +2 -0
- data/rails/railties/lib/rails/generators/rails/assets/templates/stylesheet.css +4 -0
- data/rails/railties/lib/rails/generators/rails/controller/USAGE +18 -0
- data/rails/railties/lib/rails/generators/rails/controller/controller_generator.rb +58 -0
- data/rails/railties/lib/rails/generators/rails/controller/templates/controller.rb +13 -0
- data/rails/railties/lib/rails/generators/rails/generator/USAGE +13 -0
- data/rails/railties/lib/rails/generators/rails/generator/generator_generator.rb +27 -0
- data/rails/railties/lib/rails/generators/rails/generator/templates/%file_name%_generator.rb.tt +3 -0
- data/rails/railties/lib/rails/generators/rails/generator/templates/USAGE.tt +8 -0
- data/rails/railties/lib/rails/generators/rails/generator/templates/templates/.empty_directory +0 -0
- data/rails/railties/lib/rails/generators/rails/helper/USAGE +13 -0
- data/rails/railties/lib/rails/generators/rails/helper/helper_generator.rb +13 -0
- data/rails/railties/lib/rails/generators/rails/helper/templates/helper.rb +4 -0
- data/rails/railties/lib/rails/generators/rails/integration_test/USAGE +10 -0
- data/rails/railties/lib/rails/generators/rails/integration_test/integration_test_generator.rb +7 -0
- data/rails/railties/lib/rails/generators/rails/migration/USAGE +35 -0
- data/rails/railties/lib/rails/generators/rails/migration/migration_generator.rb +8 -0
- data/rails/railties/lib/rails/generators/rails/model/USAGE +109 -0
- data/rails/railties/lib/rails/generators/rails/model/model_generator.rb +12 -0
- data/rails/railties/lib/rails/generators/rails/plugin/USAGE +10 -0
- data/rails/railties/lib/rails/generators/rails/plugin/plugin_generator.rb +393 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/%name%.gemspec +27 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/Gemfile +51 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/MIT-LICENSE +20 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/README.rdoc +3 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/Rakefile +29 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/app/controllers/%name%/application_controller.rb.tt +4 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/app/helpers/%name%/application_helper.rb.tt +4 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/app/mailers/.empty_directory +0 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/app/models/.empty_directory +0 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/app/views/layouts/%name%/application.html.erb.tt +14 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/bin/rails.tt +11 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/config/routes.rb +6 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/gitignore +10 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/lib/%name%/engine.rb +7 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/lib/%name%/version.rb +3 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/lib/%name%.rb +6 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/lib/tasks/%name%_tasks.rake +4 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/rails/application.rb +18 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/rails/boot.rb +5 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/rails/javascripts.js +13 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/rails/routes.rb +4 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/rails/stylesheets.css +15 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/test/%name%_test.rb +7 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/test/integration/navigation_test.rb +12 -0
- data/rails/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb +24 -0
- data/rails/railties/lib/rails/generators/rails/resource/USAGE +23 -0
- data/rails/railties/lib/rails/generators/rails/resource/resource_generator.rb +20 -0
- data/rails/railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb +50 -0
- data/rails/railties/lib/rails/generators/rails/scaffold/USAGE +41 -0
- data/rails/railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb +32 -0
- data/rails/railties/lib/rails/generators/rails/scaffold/templates/scaffold.css +56 -0
- data/rails/railties/lib/rails/generators/rails/scaffold_controller/USAGE +19 -0
- data/rails/railties/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +28 -0
- data/rails/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb +68 -0
- data/rails/railties/lib/rails/generators/rails/task/USAGE +9 -0
- data/rails/railties/lib/rails/generators/rails/task/task_generator.rb +12 -0
- data/rails/railties/lib/rails/generators/rails/task/templates/task.rb +8 -0
- data/rails/railties/lib/rails/generators/resource_helpers.rb +82 -0
- data/rails/railties/lib/rails/generators/test_case.rb +36 -0
- data/rails/railties/lib/rails/generators/test_unit/controller/controller_generator.rb +15 -0
- data/rails/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb +19 -0
- data/rails/railties/lib/rails/generators/test_unit/generator/generator_generator.rb +26 -0
- data/rails/railties/lib/rails/generators/test_unit/generator/templates/generator_test.rb +16 -0
- data/rails/railties/lib/rails/generators/test_unit/helper/helper_generator.rb +9 -0
- data/rails/railties/lib/rails/generators/test_unit/integration/integration_generator.rb +13 -0
- data/rails/railties/lib/rails/generators/test_unit/integration/templates/integration_test.rb +7 -0
- data/rails/railties/lib/rails/generators/test_unit/job/job_generator.rb +13 -0
- data/rails/railties/lib/rails/generators/test_unit/job/templates/unit_test.rb.erb +9 -0
- data/rails/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb +21 -0
- data/rails/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb +21 -0
- data/rails/railties/lib/rails/generators/test_unit/mailer/templates/preview.rb +13 -0
- data/rails/railties/lib/rails/generators/test_unit/model/model_generator.rb +36 -0
- data/rails/railties/lib/rails/generators/test_unit/model/templates/fixtures.yml +27 -0
- data/rails/railties/lib/rails/generators/test_unit/model/templates/unit_test.rb +9 -0
- data/rails/railties/lib/rails/generators/test_unit/plugin/plugin_generator.rb +13 -0
- data/rails/railties/lib/rails/generators/test_unit/plugin/templates/%file_name%_test.rb.tt +7 -0
- data/rails/railties/lib/rails/generators/test_unit/plugin/templates/test_helper.rb +2 -0
- data/rails/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +33 -0
- data/rails/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb +51 -0
- data/rails/railties/lib/rails/generators/test_unit.rb +8 -0
- data/rails/railties/lib/rails/generators/testing/assertions.rb +123 -0
- data/rails/railties/lib/rails/generators/testing/behaviour.rb +123 -0
- data/rails/railties/lib/rails/generators/testing/setup_and_teardown.rb +18 -0
- data/rails/railties/lib/rails/generators.rb +373 -0
- data/rails/railties/lib/rails/info.rb +102 -0
- data/rails/railties/lib/rails/info_controller.rb +23 -0
- data/rails/railties/lib/rails/initializable.rb +89 -0
- data/rails/railties/lib/rails/mailers_controller.rb +73 -0
- data/rails/railties/lib/rails/paths.rb +211 -0
- data/rails/railties/lib/rails/rack/debugger.rb +24 -0
- data/rails/railties/lib/rails/rack/log_tailer.rb +38 -0
- data/rails/railties/lib/rails/rack/logger.rb +86 -0
- data/rails/railties/lib/rails/rack.rb +7 -0
- data/rails/railties/lib/rails/railtie/configurable.rb +35 -0
- data/rails/railties/lib/rails/railtie/configuration.rb +100 -0
- data/rails/railties/lib/rails/railtie.rb +250 -0
- data/rails/railties/lib/rails/ruby_version_check.rb +13 -0
- data/rails/railties/lib/rails/source_annotation_extractor.rb +133 -0
- data/rails/railties/lib/rails/tasks/annotations.rake +20 -0
- data/rails/railties/lib/rails/tasks/documentation.rake +70 -0
- data/rails/railties/lib/rails/tasks/engine.rake +72 -0
- data/rails/railties/lib/rails/tasks/framework.rake +66 -0
- data/rails/railties/lib/rails/tasks/log.rake +23 -0
- data/rails/railties/lib/rails/tasks/middleware.rake +7 -0
- data/rails/railties/lib/rails/tasks/misc.rake +60 -0
- data/rails/railties/lib/rails/tasks/routes.rake +7 -0
- data/rails/railties/lib/rails/tasks/statistics.rake +29 -0
- data/rails/railties/lib/rails/tasks/tmp.rake +45 -0
- data/rails/railties/lib/rails/tasks.rb +14 -0
- data/rails/railties/lib/rails/templates/layouts/application.html.erb +36 -0
- data/rails/railties/lib/rails/templates/rails/info/properties.html.erb +1 -0
- data/rails/railties/lib/rails/templates/rails/info/routes.html.erb +9 -0
- data/rails/railties/lib/rails/templates/rails/mailers/email.html.erb +105 -0
- data/rails/railties/lib/rails/templates/rails/mailers/index.html.erb +8 -0
- data/rails/railties/lib/rails/templates/rails/mailers/mailer.html.erb +6 -0
- data/rails/railties/lib/rails/templates/rails/welcome/index.html.erb +261 -0
- data/rails/railties/lib/rails/test_help.rb +43 -0
- data/rails/railties/lib/rails/test_unit/railtie.rb +18 -0
- data/rails/railties/lib/rails/test_unit/sub_test_task.rb +126 -0
- data/rails/railties/lib/rails/test_unit/testing.rake +66 -0
- data/rails/railties/lib/rails/version.rb +8 -0
- data/rails/railties/lib/rails/welcome_controller.rb +8 -0
- data/rails/railties/lib/rails.rb +93 -0
- data/rails/railties/railties.gemspec +33 -0
- data/rails/railties/test/abstract_unit.rb +53 -0
- data/rails/railties/test/app_rails_loader_test.rb +89 -0
- data/rails/railties/test/application/asset_debugging_test.rb +64 -0
- data/rails/railties/test/application/assets_test.rb +493 -0
- data/rails/railties/test/application/build_original_fullpath_test.rb +27 -0
- data/rails/railties/test/application/configuration/base_test.rb +37 -0
- data/rails/railties/test/application/configuration/custom_test.rb +22 -0
- data/rails/railties/test/application/configuration_test.rb +1344 -0
- data/rails/railties/test/application/console_test.rb +153 -0
- data/rails/railties/test/application/generators_test.rb +129 -0
- data/rails/railties/test/application/initializers/frameworks_test.rb +231 -0
- data/rails/railties/test/application/initializers/hooks_test.rb +90 -0
- data/rails/railties/test/application/initializers/i18n_test.rb +216 -0
- data/rails/railties/test/application/initializers/load_path_test.rb +110 -0
- data/rails/railties/test/application/initializers/notifications_test.rb +56 -0
- data/rails/railties/test/application/loading_test.rb +341 -0
- data/rails/railties/test/application/mailer_previews_test.rb +494 -0
- data/rails/railties/test/application/middleware/cache_test.rb +180 -0
- data/rails/railties/test/application/middleware/cookies_test.rb +47 -0
- data/rails/railties/test/application/middleware/exceptions_test.rb +126 -0
- data/rails/railties/test/application/middleware/remote_ip_test.rb +78 -0
- data/rails/railties/test/application/middleware/sendfile_test.rb +74 -0
- data/rails/railties/test/application/middleware/session_test.rb +343 -0
- data/rails/railties/test/application/middleware/static_test.rb +31 -0
- data/rails/railties/test/application/middleware_test.rb +240 -0
- data/rails/railties/test/application/multiple_applications_test.rb +176 -0
- data/rails/railties/test/application/paths_test.rb +83 -0
- data/rails/railties/test/application/rack/logger_test.rb +56 -0
- data/rails/railties/test/application/rackup_test.rb +43 -0
- data/rails/railties/test/application/rake/dbs_test.rb +233 -0
- data/rails/railties/test/application/rake/migrations_test.rb +204 -0
- data/rails/railties/test/application/rake/notes_test.rb +156 -0
- data/rails/railties/test/application/rake_test.rb +286 -0
- data/rails/railties/test/application/rendering_test.rb +45 -0
- data/rails/railties/test/application/routing_test.rb +468 -0
- data/rails/railties/test/application/runner_test.rb +89 -0
- data/rails/railties/test/application/test_runner_test.rb +331 -0
- data/rails/railties/test/application/test_test.rb +322 -0
- data/rails/railties/test/application/url_generation_test.rb +46 -0
- data/rails/railties/test/backtrace_cleaner_test.rb +24 -0
- data/rails/railties/test/code_statistics_calculator_test.rb +288 -0
- data/rails/railties/test/commands/console_test.rb +176 -0
- data/rails/railties/test/commands/dbconsole_test.rb +274 -0
- data/rails/railties/test/commands/server_test.rb +88 -0
- data/rails/railties/test/configuration/middleware_stack_proxy_test.rb +61 -0
- data/rails/railties/test/engine_test.rb +25 -0
- data/rails/railties/test/env_helpers.rb +30 -0
- data/rails/railties/test/fixtures/about_yml_plugins/bad_about_yml/about.yml +1 -0
- data/rails/railties/test/fixtures/about_yml_plugins/bad_about_yml/init.rb +1 -0
- data/rails/railties/test/fixtures/about_yml_plugins/plugin_without_about_yml/init.rb +1 -0
- data/rails/railties/test/fixtures/lib/create_test_dummy_template.rb +1 -0
- data/rails/railties/test/fixtures/lib/generators/active_record/fixjour_generator.rb +8 -0
- data/rails/railties/test/fixtures/lib/generators/fixjour_generator.rb +2 -0
- data/rails/railties/test/fixtures/lib/generators/model_generator.rb +1 -0
- data/rails/railties/test/fixtures/lib/generators/usage_template/USAGE +1 -0
- data/rails/railties/test/fixtures/lib/generators/usage_template/usage_template_generator.rb +5 -0
- data/rails/railties/test/fixtures/lib/rails/generators/foobar/foobar_generator.rb +4 -0
- data/rails/railties/test/fixtures/lib/template.rb +1 -0
- data/rails/railties/test/generators/actions_test.rb +259 -0
- data/rails/railties/test/generators/app_generator_test.rb +528 -0
- data/rails/railties/test/generators/argv_scrubber_test.rb +136 -0
- data/rails/railties/test/generators/assets_generator_test.rb +19 -0
- data/rails/railties/test/generators/controller_generator_test.rb +101 -0
- data/rails/railties/test/generators/create_migration_test.rb +134 -0
- data/rails/railties/test/generators/generated_attribute_test.rb +152 -0
- data/rails/railties/test/generators/generator_generator_test.rb +71 -0
- data/rails/railties/test/generators/generator_test.rb +85 -0
- data/rails/railties/test/generators/generators_test_helper.rb +52 -0
- data/rails/railties/test/generators/helper_generator_test.rb +39 -0
- data/rails/railties/test/generators/integration_test_generator_test.rb +12 -0
- data/rails/railties/test/generators/mailer_generator_test.rb +170 -0
- data/rails/railties/test/generators/migration_generator_test.rb +288 -0
- data/rails/railties/test/generators/model_generator_test.rb +446 -0
- data/rails/railties/test/generators/named_base_test.rb +145 -0
- data/rails/railties/test/generators/namespaced_generators_test.rb +398 -0
- data/rails/railties/test/generators/orm_test.rb +38 -0
- data/rails/railties/test/generators/plugin_generator_test.rb +442 -0
- data/rails/railties/test/generators/resource_generator_test.rb +88 -0
- data/rails/railties/test/generators/scaffold_controller_generator_test.rb +177 -0
- data/rails/railties/test/generators/scaffold_generator_test.rb +386 -0
- data/rails/railties/test/generators/shared_generator_tests.rb +144 -0
- data/rails/railties/test/generators/task_generator_test.rb +24 -0
- data/rails/railties/test/generators_test.rb +234 -0
- data/rails/railties/test/initializable_test.rb +230 -0
- data/rails/railties/test/isolation/abstract_unit.rb +359 -0
- data/rails/railties/test/path_generation_test.rb +88 -0
- data/rails/railties/test/paths_test.rb +234 -0
- data/rails/railties/test/rack_logger_test.rb +75 -0
- data/rails/railties/test/rails_info_controller_test.rb +57 -0
- data/rails/railties/test/rails_info_test.rb +71 -0
- data/rails/railties/test/railties/engine_test.rb +1317 -0
- data/rails/railties/test/railties/generators_test.rb +126 -0
- data/rails/railties/test/railties/mounted_engine_test.rb +274 -0
- data/rails/railties/test/railties/railtie_test.rb +208 -0
- data/rails/railties/test/test_info_test.rb +60 -0
- data/rails/railties/test/version_test.rb +12 -0
- data/rails/tasks/release.rb +128 -0
- data/rails/tools/README.md +7 -0
- data/rails/tools/console +7 -0
- data/rails/tools/line_statistics +42 -0
- data/rails/tools/profile +136 -0
- data/rails/version.rb +15 -0
- data/test/cases/lock_test.rb +29 -0
- data/test/helper.rb +30 -0
- data/test/integration/lock_queuing_test.rb +43 -0
- metadata +3007 -0
@@ -0,0 +1,2026 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'abstract_unit'
|
3
|
+
require 'controller/fake_controllers'
|
4
|
+
require 'active_support/core_ext/object/with_options'
|
5
|
+
require 'active_support/core_ext/object/json'
|
6
|
+
|
7
|
+
class MilestonesController < ActionController::Base
|
8
|
+
def index() head :ok end
|
9
|
+
alias_method :show, :index
|
10
|
+
end
|
11
|
+
|
12
|
+
ROUTING = ActionDispatch::Routing
|
13
|
+
|
14
|
+
# See RFC 3986, section 3.3 for allowed path characters.
|
15
|
+
class UriReservedCharactersRoutingTest < ActiveSupport::TestCase
|
16
|
+
include RoutingTestHelpers
|
17
|
+
|
18
|
+
def setup
|
19
|
+
@set = ActionDispatch::Routing::RouteSet.new
|
20
|
+
@set.draw do
|
21
|
+
get ':controller/:action/:variable/*additional'
|
22
|
+
end
|
23
|
+
|
24
|
+
safe, unsafe = %w(: @ & = + $ , ;), %w(^ ? # [ ])
|
25
|
+
hex = unsafe.map { |char| '%' + char.unpack('H2').first.upcase }
|
26
|
+
|
27
|
+
@segment = "#{safe.join}#{unsafe.join}".freeze
|
28
|
+
@escaped = "#{safe.join}#{hex.join}".freeze
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_route_generation_escapes_unsafe_path_characters
|
32
|
+
assert_equal "/content/act#{@escaped}ion/var#{@escaped}iable/add#{@escaped}itional-1/add#{@escaped}itional-2",
|
33
|
+
url_for(@set, {
|
34
|
+
:controller => "content",
|
35
|
+
:action => "act#{@segment}ion",
|
36
|
+
:variable => "var#{@segment}iable",
|
37
|
+
:additional => ["add#{@segment}itional-1", "add#{@segment}itional-2"]
|
38
|
+
})
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_route_recognition_unescapes_path_components
|
42
|
+
options = { :controller => "content",
|
43
|
+
:action => "act#{@segment}ion",
|
44
|
+
:variable => "var#{@segment}iable",
|
45
|
+
:additional => "add#{@segment}itional-1/add#{@segment}itional-2" }
|
46
|
+
assert_equal options, @set.recognize_path("/content/act#{@escaped}ion/var#{@escaped}iable/add#{@escaped}itional-1/add#{@escaped}itional-2")
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_route_generation_allows_passing_non_string_values_to_generated_helper
|
50
|
+
assert_equal "/content/action/variable/1/2",
|
51
|
+
url_for(@set, {
|
52
|
+
:controller => "content",
|
53
|
+
:action => "action",
|
54
|
+
:variable => "variable",
|
55
|
+
:additional => [1, 2]
|
56
|
+
})
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
class MockController
|
61
|
+
def self.build(helpers, additional_options = {})
|
62
|
+
Class.new do
|
63
|
+
define_method :url_options do
|
64
|
+
options = super()
|
65
|
+
options[:protocol] ||= "http"
|
66
|
+
options[:host] ||= "test.host"
|
67
|
+
options.merge(additional_options)
|
68
|
+
end
|
69
|
+
|
70
|
+
include helpers
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
class LegacyRouteSetTests < ActiveSupport::TestCase
|
76
|
+
include RoutingTestHelpers
|
77
|
+
include ActionDispatch::RoutingVerbs
|
78
|
+
|
79
|
+
attr_reader :rs
|
80
|
+
attr_accessor :controller
|
81
|
+
alias :routes :rs
|
82
|
+
|
83
|
+
def setup
|
84
|
+
@rs = make_set
|
85
|
+
@response = nil
|
86
|
+
end
|
87
|
+
|
88
|
+
def test_symbols_with_dashes
|
89
|
+
rs.draw do
|
90
|
+
get '/:artist/:song-omg', :to => lambda { |env|
|
91
|
+
resp = ActiveSupport::JSON.encode ActionDispatch::Request.new(env).path_parameters
|
92
|
+
[200, {}, [resp]]
|
93
|
+
}
|
94
|
+
end
|
95
|
+
|
96
|
+
hash = ActiveSupport::JSON.decode get(URI('http://example.org/journey/faithfully-omg'))
|
97
|
+
assert_equal({"artist"=>"journey", "song"=>"faithfully"}, hash)
|
98
|
+
end
|
99
|
+
|
100
|
+
def test_id_with_dash
|
101
|
+
rs.draw do
|
102
|
+
get '/journey/:id', :to => lambda { |env|
|
103
|
+
resp = ActiveSupport::JSON.encode ActionDispatch::Request.new(env).path_parameters
|
104
|
+
[200, {}, [resp]]
|
105
|
+
}
|
106
|
+
end
|
107
|
+
|
108
|
+
hash = ActiveSupport::JSON.decode get(URI('http://example.org/journey/faithfully-omg'))
|
109
|
+
assert_equal({"id"=>"faithfully-omg"}, hash)
|
110
|
+
end
|
111
|
+
|
112
|
+
def test_dash_with_custom_regexp
|
113
|
+
rs.draw do
|
114
|
+
get '/:artist/:song-omg', :constraints => { :song => /\d+/ }, :to => lambda { |env|
|
115
|
+
resp = ActiveSupport::JSON.encode ActionDispatch::Request.new(env).path_parameters
|
116
|
+
[200, {}, [resp]]
|
117
|
+
}
|
118
|
+
end
|
119
|
+
|
120
|
+
hash = ActiveSupport::JSON.decode get(URI('http://example.org/journey/123-omg'))
|
121
|
+
assert_equal({"artist"=>"journey", "song"=>"123"}, hash)
|
122
|
+
assert_equal 'Not Found', get(URI('http://example.org/journey/faithfully-omg'))
|
123
|
+
end
|
124
|
+
|
125
|
+
def test_pre_dash
|
126
|
+
rs.draw do
|
127
|
+
get '/:artist/omg-:song', :to => lambda { |env|
|
128
|
+
resp = ActiveSupport::JSON.encode ActionDispatch::Request.new(env).path_parameters
|
129
|
+
[200, {}, [resp]]
|
130
|
+
}
|
131
|
+
end
|
132
|
+
|
133
|
+
hash = ActiveSupport::JSON.decode get(URI('http://example.org/journey/omg-faithfully'))
|
134
|
+
assert_equal({"artist"=>"journey", "song"=>"faithfully"}, hash)
|
135
|
+
end
|
136
|
+
|
137
|
+
def test_pre_dash_with_custom_regexp
|
138
|
+
rs.draw do
|
139
|
+
get '/:artist/omg-:song', :constraints => { :song => /\d+/ }, :to => lambda { |env|
|
140
|
+
resp = ActiveSupport::JSON.encode ActionDispatch::Request.new(env).path_parameters
|
141
|
+
[200, {}, [resp]]
|
142
|
+
}
|
143
|
+
end
|
144
|
+
|
145
|
+
hash = ActiveSupport::JSON.decode get(URI('http://example.org/journey/omg-123'))
|
146
|
+
assert_equal({"artist"=>"journey", "song"=>"123"}, hash)
|
147
|
+
assert_equal 'Not Found', get(URI('http://example.org/journey/omg-faithfully'))
|
148
|
+
end
|
149
|
+
|
150
|
+
def test_star_paths_are_greedy
|
151
|
+
rs.draw do
|
152
|
+
get "/*path", :to => lambda { |env|
|
153
|
+
x = env["action_dispatch.request.path_parameters"][:path]
|
154
|
+
[200, {}, [x]]
|
155
|
+
}, :format => false
|
156
|
+
end
|
157
|
+
|
158
|
+
u = URI('http://example.org/foo/bar.html')
|
159
|
+
assert_equal u.path.sub(/^\//, ''), get(u)
|
160
|
+
end
|
161
|
+
|
162
|
+
def test_star_paths_are_greedy_but_not_too_much
|
163
|
+
rs.draw do
|
164
|
+
get "/*path", :to => lambda { |env|
|
165
|
+
x = ActiveSupport::JSON.encode env["action_dispatch.request.path_parameters"]
|
166
|
+
[200, {}, [x]]
|
167
|
+
}
|
168
|
+
end
|
169
|
+
|
170
|
+
expected = { "path" => "foo/bar", "format" => "html" }
|
171
|
+
u = URI('http://example.org/foo/bar.html')
|
172
|
+
assert_equal expected, ActiveSupport::JSON.decode(get(u))
|
173
|
+
end
|
174
|
+
|
175
|
+
def test_optional_star_paths_are_greedy
|
176
|
+
rs.draw do
|
177
|
+
get "/(*filters)", :to => lambda { |env|
|
178
|
+
x = env["action_dispatch.request.path_parameters"][:filters]
|
179
|
+
[200, {}, [x]]
|
180
|
+
}, :format => false
|
181
|
+
end
|
182
|
+
|
183
|
+
u = URI('http://example.org/ne_27.065938,-80.6092/sw_25.489856,-82.542794')
|
184
|
+
assert_equal u.path.sub(/^\//, ''), get(u)
|
185
|
+
end
|
186
|
+
|
187
|
+
def test_optional_star_paths_are_greedy_but_not_too_much
|
188
|
+
rs.draw do
|
189
|
+
get "/(*filters)", :to => lambda { |env|
|
190
|
+
x = ActiveSupport::JSON.encode env["action_dispatch.request.path_parameters"]
|
191
|
+
[200, {}, [x]]
|
192
|
+
}
|
193
|
+
end
|
194
|
+
|
195
|
+
expected = { "filters" => "ne_27.065938,-80.6092/sw_25.489856,-82",
|
196
|
+
"format" => "542794" }
|
197
|
+
u = URI('http://example.org/ne_27.065938,-80.6092/sw_25.489856,-82.542794')
|
198
|
+
assert_equal expected, ActiveSupport::JSON.decode(get(u))
|
199
|
+
end
|
200
|
+
|
201
|
+
def test_regexp_precidence
|
202
|
+
rs.draw do
|
203
|
+
get '/whois/:domain', :constraints => {
|
204
|
+
:domain => /\w+\.[\w\.]+/ },
|
205
|
+
:to => lambda { |env| [200, {}, %w{regexp}] }
|
206
|
+
|
207
|
+
get '/whois/:id', :to => lambda { |env| [200, {}, %w{id}] }
|
208
|
+
end
|
209
|
+
|
210
|
+
assert_equal 'regexp', get(URI('http://example.org/whois/example.org'))
|
211
|
+
assert_equal 'id', get(URI('http://example.org/whois/123'))
|
212
|
+
end
|
213
|
+
|
214
|
+
def test_class_and_lambda_constraints
|
215
|
+
subdomain = Class.new {
|
216
|
+
def matches? request
|
217
|
+
request.subdomain.present? and request.subdomain != 'clients'
|
218
|
+
end
|
219
|
+
}
|
220
|
+
|
221
|
+
rs.draw do
|
222
|
+
get '/', :constraints => subdomain.new,
|
223
|
+
:to => lambda { |env| [200, {}, %w{default}] }
|
224
|
+
get '/', :constraints => { :subdomain => 'clients' },
|
225
|
+
:to => lambda { |env| [200, {}, %w{clients}] }
|
226
|
+
end
|
227
|
+
|
228
|
+
assert_equal 'default', get(URI('http://www.example.org/'))
|
229
|
+
assert_equal 'clients', get(URI('http://clients.example.org/'))
|
230
|
+
end
|
231
|
+
|
232
|
+
def test_lambda_constraints
|
233
|
+
rs.draw do
|
234
|
+
get '/', :constraints => lambda { |req|
|
235
|
+
req.subdomain.present? and req.subdomain != "clients" },
|
236
|
+
:to => lambda { |env| [200, {}, %w{default}] }
|
237
|
+
|
238
|
+
get '/', :constraints => lambda { |req|
|
239
|
+
req.subdomain.present? && req.subdomain == "clients" },
|
240
|
+
:to => lambda { |env| [200, {}, %w{clients}] }
|
241
|
+
end
|
242
|
+
|
243
|
+
assert_equal 'default', get(URI('http://www.example.org/'))
|
244
|
+
assert_equal 'clients', get(URI('http://clients.example.org/'))
|
245
|
+
end
|
246
|
+
|
247
|
+
def test_scoped_lambda
|
248
|
+
scope_called = false
|
249
|
+
rs.draw do
|
250
|
+
scope '/foo', :constraints => lambda { |req| scope_called = true } do
|
251
|
+
get '/', :to => lambda { |env| [200, {}, %w{default}] }
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
assert_equal 'default', get(URI('http://www.example.org/foo/'))
|
256
|
+
assert scope_called, "scope constraint should be called"
|
257
|
+
end
|
258
|
+
|
259
|
+
def test_scoped_lambda_with_get_lambda
|
260
|
+
inner_called = false
|
261
|
+
|
262
|
+
rs.draw do
|
263
|
+
scope '/foo', :constraints => lambda { |req| flunk "should not be called" } do
|
264
|
+
get '/', :constraints => lambda { |req| inner_called = true },
|
265
|
+
:to => lambda { |env| [200, {}, %w{default}] }
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
assert_equal 'default', get(URI('http://www.example.org/foo/'))
|
270
|
+
assert inner_called, "inner constraint should be called"
|
271
|
+
end
|
272
|
+
|
273
|
+
def test_empty_string_match
|
274
|
+
rs.draw do
|
275
|
+
get '/:username', :constraints => { :username => /[^\/]+/ },
|
276
|
+
:to => lambda { |e| [200, {}, ['foo']] }
|
277
|
+
end
|
278
|
+
assert_equal 'Not Found', get(URI('http://example.org/'))
|
279
|
+
assert_equal 'foo', get(URI('http://example.org/hello'))
|
280
|
+
end
|
281
|
+
|
282
|
+
def test_non_greedy_glob_regexp
|
283
|
+
params = nil
|
284
|
+
rs.draw do
|
285
|
+
get '/posts/:id(/*filters)', :constraints => { :filters => /.+?/ },
|
286
|
+
:to => lambda { |e|
|
287
|
+
params = e["action_dispatch.request.path_parameters"]
|
288
|
+
[200, {}, ['foo']]
|
289
|
+
}
|
290
|
+
end
|
291
|
+
assert_equal 'foo', get(URI('http://example.org/posts/1/foo.js'))
|
292
|
+
assert_equal({:id=>"1", :filters=>"foo", :format=>"js"}, params)
|
293
|
+
end
|
294
|
+
|
295
|
+
def test_draw_with_block_arity_one_raises
|
296
|
+
assert_raise(RuntimeError) do
|
297
|
+
rs.draw { |map| map.match '/:controller(/:action(/:id))' }
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
301
|
+
def test_specific_controller_action_failure
|
302
|
+
rs.draw do
|
303
|
+
mount lambda {} => "/foo"
|
304
|
+
end
|
305
|
+
|
306
|
+
assert_raises(ActionController::UrlGenerationError) do
|
307
|
+
url_for(rs, :controller => "omg", :action => "lol")
|
308
|
+
end
|
309
|
+
end
|
310
|
+
|
311
|
+
def test_default_setup
|
312
|
+
rs.draw { get '/:controller(/:action(/:id))' }
|
313
|
+
assert_equal({:controller => "content", :action => 'index'}, rs.recognize_path("/content"))
|
314
|
+
assert_equal({:controller => "content", :action => 'list'}, rs.recognize_path("/content/list"))
|
315
|
+
assert_equal({:controller => "content", :action => 'show', :id => '10'}, rs.recognize_path("/content/show/10"))
|
316
|
+
|
317
|
+
assert_equal({:controller => "admin/user", :action => 'show', :id => '10'}, rs.recognize_path("/admin/user/show/10"))
|
318
|
+
|
319
|
+
assert_equal '/admin/user/show/10', url_for(rs, { :controller => 'admin/user', :action => 'show', :id => 10 })
|
320
|
+
|
321
|
+
get URI('http://test.host/admin/user/list/10')
|
322
|
+
|
323
|
+
assert_equal({ :controller => 'admin/user', :action => 'list', :id => '10' },
|
324
|
+
controller.request.path_parameters)
|
325
|
+
|
326
|
+
assert_equal '/admin/user/show', controller.url_for({ :action => 'show', :only_path => true })
|
327
|
+
assert_equal '/admin/user/list/10', controller.url_for({:only_path => true})
|
328
|
+
|
329
|
+
assert_equal '/admin/stuff', controller.url_for({ :controller => 'stuff', :only_path => true })
|
330
|
+
assert_equal '/stuff', controller.url_for({ :controller => '/stuff', :only_path => true })
|
331
|
+
end
|
332
|
+
|
333
|
+
def test_ignores_leading_slash
|
334
|
+
rs.clear!
|
335
|
+
rs.draw { get '/:controller(/:action(/:id))'}
|
336
|
+
test_default_setup
|
337
|
+
end
|
338
|
+
|
339
|
+
def test_route_with_colon_first
|
340
|
+
rs.draw do
|
341
|
+
get '/:controller/:action/:id', :action => 'index', :id => nil
|
342
|
+
get ':url', :controller => 'tiny_url', :action => 'translate'
|
343
|
+
end
|
344
|
+
end
|
345
|
+
|
346
|
+
def test_route_with_regexp_for_controller
|
347
|
+
rs.draw do
|
348
|
+
get ':controller/:admintoken(/:action(/:id))', :controller => /admin\/.+/
|
349
|
+
get '/:controller(/:action(/:id))'
|
350
|
+
end
|
351
|
+
|
352
|
+
assert_equal({:controller => "admin/user", :admintoken => "foo", :action => "index"},
|
353
|
+
rs.recognize_path("/admin/user/foo"))
|
354
|
+
assert_equal({:controller => "content", :action => "foo"},
|
355
|
+
rs.recognize_path("/content/foo"))
|
356
|
+
|
357
|
+
assert_equal '/admin/user/foo', url_for(rs, { :controller => "admin/user", :admintoken => "foo", :action => "index" })
|
358
|
+
assert_equal '/content/foo', url_for(rs, { :controller => "content", :action => "foo" })
|
359
|
+
end
|
360
|
+
|
361
|
+
def test_route_with_regexp_and_captures_for_controller
|
362
|
+
rs.draw do
|
363
|
+
get '/:controller(/:action(/:id))', :controller => /admin\/(accounts|users)/
|
364
|
+
end
|
365
|
+
assert_equal({:controller => "admin/accounts", :action => "index"}, rs.recognize_path("/admin/accounts"))
|
366
|
+
assert_equal({:controller => "admin/users", :action => "index"}, rs.recognize_path("/admin/users"))
|
367
|
+
assert_raise(ActionController::RoutingError) { rs.recognize_path("/admin/products") }
|
368
|
+
end
|
369
|
+
|
370
|
+
def test_route_with_regexp_and_dot
|
371
|
+
rs.draw do
|
372
|
+
get ':controller/:action/:file',
|
373
|
+
:controller => /admin|user/,
|
374
|
+
:action => /upload|download/,
|
375
|
+
:defaults => {:file => nil},
|
376
|
+
:constraints => {:file => %r{[^/]+(\.[^/]+)?}}
|
377
|
+
end
|
378
|
+
# Without a file extension
|
379
|
+
assert_equal '/user/download/file',
|
380
|
+
url_for(rs, { :controller => "user", :action => "download", :file => "file" })
|
381
|
+
|
382
|
+
assert_equal({:controller => "user", :action => "download", :file => "file"},
|
383
|
+
rs.recognize_path("/user/download/file"))
|
384
|
+
|
385
|
+
# Now, let's try a file with an extension, really a dot (.)
|
386
|
+
assert_equal '/user/download/file.jpg',
|
387
|
+
url_for(rs, { :controller => "user", :action => "download", :file => "file.jpg" })
|
388
|
+
|
389
|
+
assert_equal({:controller => "user", :action => "download", :file => "file.jpg"},
|
390
|
+
rs.recognize_path("/user/download/file.jpg"))
|
391
|
+
end
|
392
|
+
|
393
|
+
def test_basic_named_route
|
394
|
+
rs.draw do
|
395
|
+
root :to => 'content#list', :as => 'home'
|
396
|
+
end
|
397
|
+
assert_equal("http://test.host/", setup_for_named_route.send(:home_url))
|
398
|
+
end
|
399
|
+
|
400
|
+
def test_named_route_with_option
|
401
|
+
rs.draw do
|
402
|
+
get 'page/:title' => 'content#show_page', :as => 'page'
|
403
|
+
end
|
404
|
+
|
405
|
+
assert_equal("http://test.host/page/new%20stuff",
|
406
|
+
setup_for_named_route.send(:page_url, :title => 'new stuff'))
|
407
|
+
end
|
408
|
+
|
409
|
+
def test_named_route_with_default
|
410
|
+
rs.draw do
|
411
|
+
get 'page/:title' => 'content#show_page', :title => 'AboutPage', :as => 'page'
|
412
|
+
end
|
413
|
+
|
414
|
+
assert_equal("http://test.host/page/AboutRails",
|
415
|
+
setup_for_named_route.send(:page_url, :title => "AboutRails"))
|
416
|
+
end
|
417
|
+
|
418
|
+
def test_named_route_with_path_prefix
|
419
|
+
rs.draw do
|
420
|
+
scope "my" do
|
421
|
+
get 'page' => 'content#show_page', :as => 'page'
|
422
|
+
end
|
423
|
+
end
|
424
|
+
|
425
|
+
assert_equal("http://test.host/my/page",
|
426
|
+
setup_for_named_route.send(:page_url))
|
427
|
+
end
|
428
|
+
|
429
|
+
def test_named_route_with_blank_path_prefix
|
430
|
+
rs.draw do
|
431
|
+
scope "" do
|
432
|
+
get 'page' => 'content#show_page', :as => 'page'
|
433
|
+
end
|
434
|
+
end
|
435
|
+
|
436
|
+
assert_equal("http://test.host/page",
|
437
|
+
setup_for_named_route.send(:page_url))
|
438
|
+
end
|
439
|
+
|
440
|
+
def test_named_route_with_nested_controller
|
441
|
+
rs.draw do
|
442
|
+
get 'admin/user' => 'admin/user#index', :as => "users"
|
443
|
+
end
|
444
|
+
|
445
|
+
assert_equal("http://test.host/admin/user",
|
446
|
+
setup_for_named_route.send(:users_url))
|
447
|
+
end
|
448
|
+
|
449
|
+
def test_optimised_named_route_with_host
|
450
|
+
rs.draw do
|
451
|
+
get 'page' => 'content#show_page', :as => 'pages', :host => 'foo.com'
|
452
|
+
end
|
453
|
+
routes = setup_for_named_route
|
454
|
+
assert_equal "http://foo.com/page", routes.pages_url
|
455
|
+
end
|
456
|
+
|
457
|
+
def setup_for_named_route(options = {})
|
458
|
+
MockController.build(rs.url_helpers, options).new
|
459
|
+
end
|
460
|
+
|
461
|
+
def test_named_route_without_hash
|
462
|
+
rs.draw do
|
463
|
+
get ':controller/:action/:id', :as => 'normal'
|
464
|
+
end
|
465
|
+
end
|
466
|
+
|
467
|
+
def test_named_route_root
|
468
|
+
rs.draw do
|
469
|
+
root :to => "hello#index"
|
470
|
+
end
|
471
|
+
routes = setup_for_named_route
|
472
|
+
assert_equal("http://test.host/", routes.send(:root_url))
|
473
|
+
assert_equal("/", routes.send(:root_path))
|
474
|
+
end
|
475
|
+
|
476
|
+
def test_named_route_root_without_hash
|
477
|
+
rs.draw do
|
478
|
+
root "hello#index"
|
479
|
+
end
|
480
|
+
routes = setup_for_named_route
|
481
|
+
assert_equal("http://test.host/", routes.send(:root_url))
|
482
|
+
assert_equal("/", routes.send(:root_path))
|
483
|
+
end
|
484
|
+
|
485
|
+
def test_named_route_root_with_hash
|
486
|
+
rs.draw do
|
487
|
+
root "hello#index", as: :index
|
488
|
+
end
|
489
|
+
|
490
|
+
routes = setup_for_named_route
|
491
|
+
assert_equal("http://test.host/", routes.send(:index_url))
|
492
|
+
assert_equal("/", routes.send(:index_path))
|
493
|
+
end
|
494
|
+
|
495
|
+
def test_root_without_path_raises_argument_error
|
496
|
+
assert_raises ArgumentError do
|
497
|
+
rs.draw { root nil }
|
498
|
+
end
|
499
|
+
end
|
500
|
+
|
501
|
+
def test_named_route_root_with_trailing_slash
|
502
|
+
rs.draw do
|
503
|
+
root "hello#index"
|
504
|
+
end
|
505
|
+
|
506
|
+
routes = setup_for_named_route(trailing_slash: true)
|
507
|
+
assert_equal("http://test.host/", routes.send(:root_url))
|
508
|
+
assert_equal("http://test.host/?foo=bar", routes.send(:root_url, foo: :bar))
|
509
|
+
end
|
510
|
+
|
511
|
+
def test_named_route_with_regexps
|
512
|
+
rs.draw do
|
513
|
+
get 'page/:year/:month/:day/:title' => 'page#show', :as => 'article',
|
514
|
+
:year => /\d+/, :month => /\d+/, :day => /\d+/
|
515
|
+
get ':controller/:action/:id'
|
516
|
+
end
|
517
|
+
|
518
|
+
routes = setup_for_named_route
|
519
|
+
|
520
|
+
assert_equal "http://test.host/page/2005/6/10/hi",
|
521
|
+
routes.send(:article_url, :title => 'hi', :day => 10, :year => 2005, :month => 6)
|
522
|
+
end
|
523
|
+
|
524
|
+
def test_changing_controller
|
525
|
+
rs.draw { get ':controller/:action/:id' }
|
526
|
+
|
527
|
+
get URI('http://test.host/admin/user/index/10')
|
528
|
+
|
529
|
+
assert_equal '/admin/stuff/show/10',
|
530
|
+
controller.url_for({:controller => 'stuff', :action => 'show', :id => 10, :only_path => true})
|
531
|
+
end
|
532
|
+
|
533
|
+
def test_paths_escaped
|
534
|
+
rs.draw do
|
535
|
+
get 'file/*path' => 'content#show_file', :as => 'path'
|
536
|
+
get ':controller/:action/:id'
|
537
|
+
end
|
538
|
+
|
539
|
+
# No + to space in URI escaping, only for query params.
|
540
|
+
results = rs.recognize_path "/file/hello+world/how+are+you%3F"
|
541
|
+
assert results, "Recognition should have succeeded"
|
542
|
+
assert_equal 'hello+world/how+are+you?', results[:path]
|
543
|
+
|
544
|
+
# Use %20 for space instead.
|
545
|
+
results = rs.recognize_path "/file/hello%20world/how%20are%20you%3F"
|
546
|
+
assert results, "Recognition should have succeeded"
|
547
|
+
assert_equal 'hello world/how are you?', results[:path]
|
548
|
+
end
|
549
|
+
|
550
|
+
def test_paths_slashes_unescaped_with_ordered_parameters
|
551
|
+
rs.draw do
|
552
|
+
get '/file/*path' => 'content#index', :as => 'path'
|
553
|
+
end
|
554
|
+
|
555
|
+
# No / to %2F in URI, only for query params.
|
556
|
+
assert_equal("/file/hello/world", setup_for_named_route.send(:path_path, ['hello', 'world']))
|
557
|
+
end
|
558
|
+
|
559
|
+
def test_non_controllers_cannot_be_matched
|
560
|
+
rs.draw do
|
561
|
+
get ':controller/:action/:id'
|
562
|
+
end
|
563
|
+
assert_raise(ActionController::RoutingError) { rs.recognize_path("/not_a/show/10") }
|
564
|
+
end
|
565
|
+
|
566
|
+
def test_should_list_options_diff_when_routing_constraints_dont_match
|
567
|
+
rs.draw do
|
568
|
+
get 'post/:id' => 'post#show', :constraints => { :id => /\d+/ }, :as => 'post'
|
569
|
+
end
|
570
|
+
assert_raise(ActionController::UrlGenerationError) do
|
571
|
+
url_for(rs, { :controller => 'post', :action => 'show', :bad_param => "foo", :use_route => "post" })
|
572
|
+
end
|
573
|
+
end
|
574
|
+
|
575
|
+
def test_dynamic_path_allowed
|
576
|
+
rs.draw do
|
577
|
+
get '*path' => 'content#show_file'
|
578
|
+
end
|
579
|
+
|
580
|
+
assert_equal '/pages/boo',
|
581
|
+
url_for(rs, { :controller => 'content', :action => 'show_file', :path => %w(pages boo) })
|
582
|
+
end
|
583
|
+
|
584
|
+
def test_dynamic_recall_paths_allowed
|
585
|
+
rs.draw do
|
586
|
+
get '*path' => 'content#show_file'
|
587
|
+
end
|
588
|
+
|
589
|
+
get URI('http://test.host/pages/boo')
|
590
|
+
assert_equal({:controller=>"content", :action=>"show_file", :path=>"pages/boo"},
|
591
|
+
controller.request.path_parameters)
|
592
|
+
|
593
|
+
assert_equal '/pages/boo',
|
594
|
+
controller.url_for(:only_path => true)
|
595
|
+
end
|
596
|
+
|
597
|
+
def test_backwards
|
598
|
+
rs.draw do
|
599
|
+
get 'page/:id(/:action)' => 'pages#show'
|
600
|
+
get ':controller(/:action(/:id))'
|
601
|
+
end
|
602
|
+
|
603
|
+
get URI('http://test.host/pages/show')
|
604
|
+
assert_equal '/page/20', controller.url_for({ :id => 20, :only_path => true })
|
605
|
+
assert_equal '/page/20', url_for(rs, { :controller => 'pages', :id => 20, :action => 'show' })
|
606
|
+
assert_equal '/pages/boo', url_for(rs, { :controller => 'pages', :action => 'boo' })
|
607
|
+
end
|
608
|
+
|
609
|
+
def test_route_with_fixnum_default
|
610
|
+
rs.draw do
|
611
|
+
get 'page(/:id)' => 'content#show_page', :id => 1
|
612
|
+
get ':controller/:action/:id'
|
613
|
+
end
|
614
|
+
|
615
|
+
assert_equal '/page', url_for(rs, { :controller => 'content', :action => 'show_page' })
|
616
|
+
assert_equal '/page', url_for(rs, { :controller => 'content', :action => 'show_page', :id => 1 })
|
617
|
+
assert_equal '/page', url_for(rs, { :controller => 'content', :action => 'show_page', :id => '1' })
|
618
|
+
assert_equal '/page/10', url_for(rs, { :controller => 'content', :action => 'show_page', :id => 10 })
|
619
|
+
|
620
|
+
assert_equal({:controller => "content", :action => 'show_page', :id => 1 }, rs.recognize_path("/page"))
|
621
|
+
assert_equal({:controller => "content", :action => 'show_page', :id => '1'}, rs.recognize_path("/page/1"))
|
622
|
+
assert_equal({:controller => "content", :action => 'show_page', :id => '10'}, rs.recognize_path("/page/10"))
|
623
|
+
end
|
624
|
+
|
625
|
+
# For newer revision
|
626
|
+
def test_route_with_text_default
|
627
|
+
rs.draw do
|
628
|
+
get 'page/:id' => 'content#show_page', :id => 1
|
629
|
+
get ':controller/:action/:id'
|
630
|
+
end
|
631
|
+
|
632
|
+
assert_equal '/page/foo', url_for(rs, { :controller => 'content', :action => 'show_page', :id => 'foo' })
|
633
|
+
assert_equal({ :controller => "content", :action => 'show_page', :id => 'foo' }, rs.recognize_path("/page/foo"))
|
634
|
+
|
635
|
+
token = "\321\202\320\265\320\272\321\201\321\202" # 'text' in Russian
|
636
|
+
token.force_encoding(Encoding::BINARY)
|
637
|
+
escaped_token = CGI::escape(token)
|
638
|
+
|
639
|
+
assert_equal '/page/' + escaped_token, url_for(rs, { :controller => 'content', :action => 'show_page', :id => token })
|
640
|
+
assert_equal({ :controller => "content", :action => 'show_page', :id => token }, rs.recognize_path("/page/#{escaped_token}"))
|
641
|
+
end
|
642
|
+
|
643
|
+
def test_action_expiry
|
644
|
+
rs.draw { get ':controller(/:action(/:id))' }
|
645
|
+
get URI('http://test.host/content/show')
|
646
|
+
assert_equal '/content', controller.url_for(:controller => 'content', :only_path => true)
|
647
|
+
end
|
648
|
+
|
649
|
+
def test_requirement_should_prevent_optional_id
|
650
|
+
rs.draw do
|
651
|
+
get 'post/:id' => 'post#show', :constraints => {:id => /\d+/}, :as => 'post'
|
652
|
+
end
|
653
|
+
|
654
|
+
assert_equal '/post/10', url_for(rs, { :controller => 'post', :action => 'show', :id => 10 })
|
655
|
+
|
656
|
+
assert_raise(ActionController::UrlGenerationError) do
|
657
|
+
url_for(rs, { :controller => 'post', :action => 'show' })
|
658
|
+
end
|
659
|
+
end
|
660
|
+
|
661
|
+
def test_both_requirement_and_optional
|
662
|
+
rs.draw do
|
663
|
+
get('test(/:year)' => 'post#show', :as => 'blog',
|
664
|
+
:defaults => { :year => nil },
|
665
|
+
:constraints => { :year => /\d{4}/ }
|
666
|
+
)
|
667
|
+
get ':controller/:action/:id'
|
668
|
+
end
|
669
|
+
|
670
|
+
assert_equal '/test', url_for(rs, { :controller => 'post', :action => 'show' })
|
671
|
+
assert_equal '/test', url_for(rs, { :controller => 'post', :action => 'show', :year => nil })
|
672
|
+
|
673
|
+
assert_equal("http://test.host/test", setup_for_named_route.send(:blog_url))
|
674
|
+
end
|
675
|
+
|
676
|
+
def test_set_to_nil_forgets
|
677
|
+
rs.draw do
|
678
|
+
get 'pages(/:year(/:month(/:day)))' => 'content#list_pages', :month => nil, :day => nil
|
679
|
+
get ':controller/:action/:id'
|
680
|
+
end
|
681
|
+
|
682
|
+
assert_equal '/pages/2005',
|
683
|
+
url_for(rs, { :controller => 'content', :action => 'list_pages', :year => 2005 })
|
684
|
+
assert_equal '/pages/2005/6',
|
685
|
+
url_for(rs, { :controller => 'content', :action => 'list_pages', :year => 2005, :month => 6 })
|
686
|
+
assert_equal '/pages/2005/6/12',
|
687
|
+
url_for(rs, { :controller => 'content', :action => 'list_pages', :year => 2005, :month => 6, :day => 12 })
|
688
|
+
|
689
|
+
get URI('http://test.host/pages/2005/6/12')
|
690
|
+
assert_equal({ :controller => 'content', :action => 'list_pages', :year => '2005', :month => '6', :day => '12' },
|
691
|
+
controller.request.path_parameters)
|
692
|
+
|
693
|
+
assert_equal '/pages/2005/6/4',
|
694
|
+
controller.url_for({ :day => 4, :only_path => true })
|
695
|
+
|
696
|
+
assert_equal '/pages/2005/6',
|
697
|
+
controller.url_for({ :day => nil, :only_path => true })
|
698
|
+
|
699
|
+
assert_equal '/pages/2005',
|
700
|
+
controller.url_for({ :day => nil, :month => nil, :only_path => true })
|
701
|
+
end
|
702
|
+
|
703
|
+
def test_root_url_generation_with_controller_and_action
|
704
|
+
rs.draw do
|
705
|
+
root :to => "content#index"
|
706
|
+
end
|
707
|
+
|
708
|
+
assert_equal '/', url_for(rs, { :controller => 'content', :action => 'index' })
|
709
|
+
assert_equal '/', url_for(rs, { :controller => 'content' })
|
710
|
+
end
|
711
|
+
|
712
|
+
def test_named_root_url_generation_with_controller_and_action
|
713
|
+
rs.draw do
|
714
|
+
root :to => "content#index", :as => 'home'
|
715
|
+
end
|
716
|
+
|
717
|
+
assert_equal '/', url_for(rs, { :controller => 'content', :action => 'index' })
|
718
|
+
assert_equal '/', url_for(rs, { :controller => 'content' })
|
719
|
+
|
720
|
+
assert_equal("http://test.host/", setup_for_named_route.send(:home_url))
|
721
|
+
end
|
722
|
+
|
723
|
+
def test_named_route_method
|
724
|
+
rs.draw do
|
725
|
+
get 'categories' => 'content#categories', :as => 'categories'
|
726
|
+
get ':controller(/:action(/:id))'
|
727
|
+
end
|
728
|
+
|
729
|
+
assert_equal '/categories', url_for(rs, { :controller => 'content', :action => 'categories' })
|
730
|
+
assert_equal '/content/hi', url_for(rs, { :controller => 'content', :action => 'hi' })
|
731
|
+
end
|
732
|
+
|
733
|
+
def test_named_routes_array
|
734
|
+
test_named_route_method
|
735
|
+
assert_equal [:categories], rs.named_routes.names
|
736
|
+
end
|
737
|
+
|
738
|
+
def test_nil_defaults
|
739
|
+
rs.draw do
|
740
|
+
get 'journal' => 'content#list_journal',
|
741
|
+
:date => nil, :user_id => nil
|
742
|
+
get ':controller/:action/:id'
|
743
|
+
end
|
744
|
+
|
745
|
+
assert_equal '/journal', url_for(rs, {
|
746
|
+
:controller => 'content',
|
747
|
+
:action => 'list_journal',
|
748
|
+
:date => nil,
|
749
|
+
:user_id => nil
|
750
|
+
})
|
751
|
+
end
|
752
|
+
|
753
|
+
def setup_request_method_routes_for(method)
|
754
|
+
rs.draw do
|
755
|
+
match '/match' => "books##{method}", :via => method.to_sym
|
756
|
+
end
|
757
|
+
end
|
758
|
+
|
759
|
+
%w(GET PATCH POST PUT DELETE).each do |request_method|
|
760
|
+
define_method("test_request_method_recognized_with_#{request_method}") do
|
761
|
+
setup_request_method_routes_for(request_method.downcase)
|
762
|
+
params = rs.recognize_path("/match", :method => request_method)
|
763
|
+
assert_equal request_method.downcase, params[:action]
|
764
|
+
end
|
765
|
+
end
|
766
|
+
|
767
|
+
def test_recognize_array_of_methods
|
768
|
+
rs.draw do
|
769
|
+
match '/match' => 'books#get_or_post', :via => [:get, :post]
|
770
|
+
put '/match' => 'books#not_get_or_post'
|
771
|
+
end
|
772
|
+
|
773
|
+
params = rs.recognize_path("/match", :method => :post)
|
774
|
+
assert_equal 'get_or_post', params[:action]
|
775
|
+
|
776
|
+
params = rs.recognize_path("/match", :method => :put)
|
777
|
+
assert_equal 'not_get_or_post', params[:action]
|
778
|
+
end
|
779
|
+
|
780
|
+
def test_subpath_recognized
|
781
|
+
rs.draw do
|
782
|
+
get '/books/:id/edit' => 'subpath_books#edit'
|
783
|
+
get '/items/:id/:action' => 'subpath_books'
|
784
|
+
get '/posts/new/:action' => 'subpath_books'
|
785
|
+
get '/posts/:id' => 'subpath_books#show'
|
786
|
+
end
|
787
|
+
|
788
|
+
hash = rs.recognize_path "/books/17/edit"
|
789
|
+
assert_not_nil hash
|
790
|
+
assert_equal %w(subpath_books 17 edit), [hash[:controller], hash[:id], hash[:action]]
|
791
|
+
|
792
|
+
hash = rs.recognize_path "/items/3/complete"
|
793
|
+
assert_not_nil hash
|
794
|
+
assert_equal %w(subpath_books 3 complete), [hash[:controller], hash[:id], hash[:action]]
|
795
|
+
|
796
|
+
hash = rs.recognize_path "/posts/new/preview"
|
797
|
+
assert_not_nil hash
|
798
|
+
assert_equal %w(subpath_books preview), [hash[:controller], hash[:action]]
|
799
|
+
|
800
|
+
hash = rs.recognize_path "/posts/7"
|
801
|
+
assert_not_nil hash
|
802
|
+
assert_equal %w(subpath_books show 7), [hash[:controller], hash[:action], hash[:id]]
|
803
|
+
end
|
804
|
+
|
805
|
+
def test_subpath_generated
|
806
|
+
rs.draw do
|
807
|
+
get '/books/:id/edit' => 'subpath_books#edit'
|
808
|
+
get '/items/:id/:action' => 'subpath_books'
|
809
|
+
get '/posts/new/:action' => 'subpath_books'
|
810
|
+
end
|
811
|
+
|
812
|
+
assert_equal "/books/7/edit", url_for(rs, { :controller => "subpath_books", :id => 7, :action => "edit" })
|
813
|
+
assert_equal "/items/15/complete", url_for(rs, { :controller => "subpath_books", :id => 15, :action => "complete" })
|
814
|
+
assert_equal "/posts/new/preview", url_for(rs, { :controller => "subpath_books", :action => "preview" })
|
815
|
+
end
|
816
|
+
|
817
|
+
def test_failed_constraints_raises_exception_with_violated_constraints
|
818
|
+
rs.draw do
|
819
|
+
get 'foos/:id' => 'foos#show', :as => 'foo_with_requirement', :constraints => { :id => /\d+/ }
|
820
|
+
end
|
821
|
+
|
822
|
+
assert_raise(ActionController::UrlGenerationError) do
|
823
|
+
setup_for_named_route.send(:foo_with_requirement_url, "I am Against the constraints")
|
824
|
+
end
|
825
|
+
end
|
826
|
+
|
827
|
+
def test_routes_changed_correctly_after_clear
|
828
|
+
rs = ::ActionDispatch::Routing::RouteSet.new
|
829
|
+
rs.draw do
|
830
|
+
get 'ca' => 'ca#aa'
|
831
|
+
get 'cb' => 'cb#ab'
|
832
|
+
get 'cc' => 'cc#ac'
|
833
|
+
get ':controller/:action/:id'
|
834
|
+
get ':controller/:action/:id.:format'
|
835
|
+
end
|
836
|
+
|
837
|
+
hash = rs.recognize_path "/cc"
|
838
|
+
|
839
|
+
assert_not_nil hash
|
840
|
+
assert_equal %w(cc ac), [hash[:controller], hash[:action]]
|
841
|
+
|
842
|
+
rs.draw do
|
843
|
+
get 'cb' => 'cb#ab'
|
844
|
+
get 'cc' => 'cc#ac'
|
845
|
+
get ':controller/:action/:id'
|
846
|
+
get ':controller/:action/:id.:format'
|
847
|
+
end
|
848
|
+
|
849
|
+
hash = rs.recognize_path "/cc"
|
850
|
+
|
851
|
+
assert_not_nil hash
|
852
|
+
assert_equal %w(cc ac), [hash[:controller], hash[:action]]
|
853
|
+
end
|
854
|
+
end
|
855
|
+
|
856
|
+
class RouteSetTest < ActiveSupport::TestCase
|
857
|
+
include RoutingTestHelpers
|
858
|
+
include ActionDispatch::RoutingVerbs
|
859
|
+
|
860
|
+
attr_reader :set
|
861
|
+
alias :routes :set
|
862
|
+
attr_accessor :controller
|
863
|
+
|
864
|
+
def setup
|
865
|
+
super
|
866
|
+
@set = make_set
|
867
|
+
end
|
868
|
+
|
869
|
+
def request
|
870
|
+
@request ||= ActionController::TestRequest.new
|
871
|
+
end
|
872
|
+
|
873
|
+
def default_route_set
|
874
|
+
@default_route_set ||= begin
|
875
|
+
set = ROUTING::RouteSet.new
|
876
|
+
set.draw do
|
877
|
+
get '/:controller(/:action(/:id))'
|
878
|
+
end
|
879
|
+
set
|
880
|
+
end
|
881
|
+
end
|
882
|
+
|
883
|
+
def test_generate_extras
|
884
|
+
set.draw { get ':controller/(:action(/:id))' }
|
885
|
+
path, extras = set.generate_extras(:controller => "foo", :action => "bar", :id => 15, :this => "hello", :that => "world")
|
886
|
+
assert_equal "/foo/bar/15", path
|
887
|
+
assert_equal %w(that this), extras.map { |e| e.to_s }.sort
|
888
|
+
end
|
889
|
+
|
890
|
+
def test_extra_keys
|
891
|
+
set.draw { get ':controller/:action/:id' }
|
892
|
+
extras = set.extra_keys(:controller => "foo", :action => "bar", :id => 15, :this => "hello", :that => "world")
|
893
|
+
assert_equal %w(that this), extras.map { |e| e.to_s }.sort
|
894
|
+
end
|
895
|
+
|
896
|
+
def test_generate_extras_not_first
|
897
|
+
set.draw do
|
898
|
+
get ':controller/:action/:id.:format'
|
899
|
+
get ':controller/:action/:id'
|
900
|
+
end
|
901
|
+
path, extras = set.generate_extras(:controller => "foo", :action => "bar", :id => 15, :this => "hello", :that => "world")
|
902
|
+
assert_equal "/foo/bar/15", path
|
903
|
+
assert_equal %w(that this), extras.map { |e| e.to_s }.sort
|
904
|
+
end
|
905
|
+
|
906
|
+
def test_generate_not_first
|
907
|
+
set.draw do
|
908
|
+
get ':controller/:action/:id.:format'
|
909
|
+
get ':controller/:action/:id'
|
910
|
+
end
|
911
|
+
assert_equal "/foo/bar/15?this=hello",
|
912
|
+
url_for(set, { :controller => "foo", :action => "bar", :id => 15, :this => "hello" })
|
913
|
+
end
|
914
|
+
|
915
|
+
def test_extra_keys_not_first
|
916
|
+
set.draw do
|
917
|
+
get ':controller/:action/:id.:format'
|
918
|
+
get ':controller/:action/:id'
|
919
|
+
end
|
920
|
+
extras = set.extra_keys(:controller => "foo", :action => "bar", :id => 15, :this => "hello", :that => "world")
|
921
|
+
assert_equal %w(that this), extras.map { |e| e.to_s }.sort
|
922
|
+
end
|
923
|
+
|
924
|
+
def test_draw
|
925
|
+
assert_equal 0, set.routes.size
|
926
|
+
set.draw do
|
927
|
+
get '/hello/world' => 'a#b'
|
928
|
+
end
|
929
|
+
assert_equal 1, set.routes.size
|
930
|
+
end
|
931
|
+
|
932
|
+
def test_draw_symbol_controller_name
|
933
|
+
assert_equal 0, set.routes.size
|
934
|
+
set.draw do
|
935
|
+
get '/users/index' => 'users#index'
|
936
|
+
end
|
937
|
+
set.recognize_path('/users/index', :method => :get)
|
938
|
+
assert_equal 1, set.routes.size
|
939
|
+
end
|
940
|
+
|
941
|
+
def test_named_draw
|
942
|
+
assert_equal 0, set.routes.size
|
943
|
+
set.draw do
|
944
|
+
get '/hello/world' => 'a#b', :as => 'hello'
|
945
|
+
end
|
946
|
+
assert_equal 1, set.routes.size
|
947
|
+
assert_equal set.routes.first, set.named_routes[:hello]
|
948
|
+
end
|
949
|
+
|
950
|
+
def test_duplicate_named_route_raises_rather_than_pick_precedence
|
951
|
+
assert_raise ArgumentError do
|
952
|
+
set.draw do
|
953
|
+
get '/hello/world' => 'a#b', :as => 'hello'
|
954
|
+
get '/hello' => 'a#b', :as => 'hello'
|
955
|
+
end
|
956
|
+
end
|
957
|
+
end
|
958
|
+
|
959
|
+
def setup_named_route_test
|
960
|
+
set.draw do
|
961
|
+
get '/people(/:id)' => 'people#show', :as => 'show'
|
962
|
+
get '/people' => 'people#index', :as => 'index'
|
963
|
+
get '/people/go/:foo/:bar/joe(/:id)' => 'people#multi', :as => 'multi'
|
964
|
+
get '/admin/users' => 'admin/users#index', :as => "users"
|
965
|
+
end
|
966
|
+
|
967
|
+
get URI('http://test.host/people')
|
968
|
+
controller
|
969
|
+
end
|
970
|
+
|
971
|
+
def test_named_route_url_method
|
972
|
+
controller = setup_named_route_test
|
973
|
+
|
974
|
+
assert_equal "http://test.host/people/5", controller.send(:show_url, :id => 5)
|
975
|
+
assert_equal "/people/5", controller.send(:show_path, :id => 5)
|
976
|
+
|
977
|
+
assert_equal "http://test.host/people", controller.send(:index_url)
|
978
|
+
assert_equal "/people", controller.send(:index_path)
|
979
|
+
|
980
|
+
assert_equal "http://test.host/admin/users", controller.send(:users_url)
|
981
|
+
assert_equal '/admin/users', controller.send(:users_path)
|
982
|
+
end
|
983
|
+
|
984
|
+
def test_named_route_url_method_with_anchor
|
985
|
+
controller = setup_named_route_test
|
986
|
+
|
987
|
+
assert_equal "http://test.host/people/5#location", controller.send(:show_url, :id => 5, :anchor => 'location')
|
988
|
+
assert_equal "/people/5#location", controller.send(:show_path, :id => 5, :anchor => 'location')
|
989
|
+
|
990
|
+
assert_equal "http://test.host/people#location", controller.send(:index_url, :anchor => 'location')
|
991
|
+
assert_equal "/people#location", controller.send(:index_path, :anchor => 'location')
|
992
|
+
|
993
|
+
assert_equal "http://test.host/admin/users#location", controller.send(:users_url, :anchor => 'location')
|
994
|
+
assert_equal '/admin/users#location', controller.send(:users_path, :anchor => 'location')
|
995
|
+
|
996
|
+
assert_equal "http://test.host/people/go/7/hello/joe/5#location",
|
997
|
+
controller.send(:multi_url, 7, "hello", 5, :anchor => 'location')
|
998
|
+
|
999
|
+
assert_equal "http://test.host/people/go/7/hello/joe/5?baz=bar#location",
|
1000
|
+
controller.send(:multi_url, 7, "hello", 5, :baz => "bar", :anchor => 'location')
|
1001
|
+
|
1002
|
+
assert_equal "http://test.host/people?baz=bar#location",
|
1003
|
+
controller.send(:index_url, :baz => "bar", :anchor => 'location')
|
1004
|
+
|
1005
|
+
assert_equal "http://test.host/people", controller.send(:index_url, anchor: nil)
|
1006
|
+
assert_equal "http://test.host/people", controller.send(:index_url, anchor: false)
|
1007
|
+
end
|
1008
|
+
|
1009
|
+
def test_named_route_url_method_with_port
|
1010
|
+
controller = setup_named_route_test
|
1011
|
+
assert_equal "http://test.host:8080/people/5", controller.send(:show_url, 5, :port=>8080)
|
1012
|
+
end
|
1013
|
+
|
1014
|
+
def test_named_route_url_method_with_host
|
1015
|
+
controller = setup_named_route_test
|
1016
|
+
assert_equal "http://some.example.com/people/5", controller.send(:show_url, 5, :host=>"some.example.com")
|
1017
|
+
end
|
1018
|
+
|
1019
|
+
def test_named_route_url_method_with_protocol
|
1020
|
+
controller = setup_named_route_test
|
1021
|
+
assert_equal "https://test.host/people/5", controller.send(:show_url, 5, :protocol => "https")
|
1022
|
+
end
|
1023
|
+
|
1024
|
+
def test_named_route_url_method_with_ordered_parameters
|
1025
|
+
controller = setup_named_route_test
|
1026
|
+
assert_equal "http://test.host/people/go/7/hello/joe/5",
|
1027
|
+
controller.send(:multi_url, 7, "hello", 5)
|
1028
|
+
end
|
1029
|
+
|
1030
|
+
def test_named_route_url_method_with_ordered_parameters_and_hash
|
1031
|
+
controller = setup_named_route_test
|
1032
|
+
assert_equal "http://test.host/people/go/7/hello/joe/5?baz=bar",
|
1033
|
+
controller.send(:multi_url, 7, "hello", 5, :baz => "bar")
|
1034
|
+
end
|
1035
|
+
|
1036
|
+
def test_named_route_url_method_with_ordered_parameters_and_empty_hash
|
1037
|
+
controller = setup_named_route_test
|
1038
|
+
assert_equal "http://test.host/people/go/7/hello/joe/5",
|
1039
|
+
controller.send(:multi_url, 7, "hello", 5, {})
|
1040
|
+
end
|
1041
|
+
|
1042
|
+
def test_named_route_url_method_with_no_positional_arguments
|
1043
|
+
controller = setup_named_route_test
|
1044
|
+
assert_equal "http://test.host/people?baz=bar",
|
1045
|
+
controller.send(:index_url, :baz => "bar")
|
1046
|
+
end
|
1047
|
+
|
1048
|
+
def test_draw_default_route
|
1049
|
+
set.draw do
|
1050
|
+
get '/:controller/:action/:id'
|
1051
|
+
end
|
1052
|
+
|
1053
|
+
assert_equal 1, set.routes.size
|
1054
|
+
|
1055
|
+
assert_equal '/users/show/10', url_for(set, { :controller => 'users', :action => 'show', :id => 10 })
|
1056
|
+
assert_equal '/users/index/10', url_for(set, { :controller => 'users', :id => 10 })
|
1057
|
+
|
1058
|
+
assert_equal({:controller => 'users', :action => 'index', :id => '10'}, set.recognize_path('/users/index/10'))
|
1059
|
+
assert_equal({:controller => 'users', :action => 'index', :id => '10'}, set.recognize_path('/users/index/10/'))
|
1060
|
+
end
|
1061
|
+
|
1062
|
+
def test_route_with_parameter_shell
|
1063
|
+
set.draw do
|
1064
|
+
get 'page/:id' => 'pages#show', :id => /\d+/
|
1065
|
+
get '/:controller(/:action(/:id))'
|
1066
|
+
end
|
1067
|
+
|
1068
|
+
assert_equal({:controller => 'pages', :action => 'index'}, request_path_params('/pages'))
|
1069
|
+
assert_equal({:controller => 'pages', :action => 'index'}, request_path_params('/pages/index'))
|
1070
|
+
assert_equal({:controller => 'pages', :action => 'list'}, request_path_params('/pages/list'))
|
1071
|
+
|
1072
|
+
assert_equal({:controller => 'pages', :action => 'show', :id => '10'}, request_path_params('/pages/show/10'))
|
1073
|
+
assert_equal({:controller => 'pages', :action => 'show', :id => '10'}, request_path_params('/page/10'))
|
1074
|
+
end
|
1075
|
+
|
1076
|
+
def test_route_constraints_on_request_object_with_anchors_are_valid
|
1077
|
+
assert_nothing_raised do
|
1078
|
+
set.draw do
|
1079
|
+
get 'page/:id' => 'pages#show', :constraints => { :host => /^foo$/ }
|
1080
|
+
end
|
1081
|
+
end
|
1082
|
+
end
|
1083
|
+
|
1084
|
+
def test_route_constraints_with_anchor_chars_are_invalid
|
1085
|
+
assert_raise ArgumentError do
|
1086
|
+
set.draw do
|
1087
|
+
get 'page/:id' => 'pages#show', :id => /^\d+/
|
1088
|
+
end
|
1089
|
+
end
|
1090
|
+
assert_raise ArgumentError do
|
1091
|
+
set.draw do
|
1092
|
+
get 'page/:id' => 'pages#show', :id => /\A\d+/
|
1093
|
+
end
|
1094
|
+
end
|
1095
|
+
assert_raise ArgumentError do
|
1096
|
+
set.draw do
|
1097
|
+
get 'page/:id' => 'pages#show', :id => /\d+$/
|
1098
|
+
end
|
1099
|
+
end
|
1100
|
+
assert_raise ArgumentError do
|
1101
|
+
set.draw do
|
1102
|
+
get 'page/:id' => 'pages#show', :id => /\d+\Z/
|
1103
|
+
end
|
1104
|
+
end
|
1105
|
+
assert_raise ArgumentError do
|
1106
|
+
set.draw do
|
1107
|
+
get 'page/:id' => 'pages#show', :id => /\d+\z/
|
1108
|
+
end
|
1109
|
+
end
|
1110
|
+
end
|
1111
|
+
|
1112
|
+
def test_route_constraints_with_options_method_condition_is_valid
|
1113
|
+
assert_nothing_raised do
|
1114
|
+
set.draw do
|
1115
|
+
match 'valid/route' => 'pages#show', :via => :options
|
1116
|
+
end
|
1117
|
+
end
|
1118
|
+
end
|
1119
|
+
|
1120
|
+
def test_route_error_with_missing_controller
|
1121
|
+
set.draw do
|
1122
|
+
get "/people" => "missing#index"
|
1123
|
+
end
|
1124
|
+
|
1125
|
+
assert_raises(ActionController::RoutingError) { request_path_params '/people' }
|
1126
|
+
end
|
1127
|
+
|
1128
|
+
def test_recognize_with_encoded_id_and_regex
|
1129
|
+
set.draw do
|
1130
|
+
get 'page/:id' => 'pages#show', :id => /[a-zA-Z0-9\+]+/
|
1131
|
+
end
|
1132
|
+
|
1133
|
+
assert_equal({:controller => 'pages', :action => 'show', :id => '10'}, request_path_params('/page/10'))
|
1134
|
+
assert_equal({:controller => 'pages', :action => 'show', :id => 'hello+world'}, request_path_params('/page/hello+world'))
|
1135
|
+
end
|
1136
|
+
|
1137
|
+
def test_recognize_with_http_methods
|
1138
|
+
set.draw do
|
1139
|
+
get "/people" => "people#index", :as => "people"
|
1140
|
+
post "/people" => "people#create"
|
1141
|
+
get "/people/:id" => "people#show", :as => "person"
|
1142
|
+
put "/people/:id" => "people#update"
|
1143
|
+
patch "/people/:id" => "people#update"
|
1144
|
+
delete "/people/:id" => "people#destroy"
|
1145
|
+
end
|
1146
|
+
|
1147
|
+
params = request_path_params("/people", :method => :get)
|
1148
|
+
assert_equal("index", params[:action])
|
1149
|
+
|
1150
|
+
params = request_path_params("/people", :method => :post)
|
1151
|
+
assert_equal("create", params[:action])
|
1152
|
+
|
1153
|
+
params = request_path_params("/people/5", :method => :put)
|
1154
|
+
assert_equal("update", params[:action])
|
1155
|
+
|
1156
|
+
params = request_path_params("/people/5", :method => :patch)
|
1157
|
+
assert_equal("update", params[:action])
|
1158
|
+
|
1159
|
+
assert_raise(ActionController::UnknownHttpMethod) {
|
1160
|
+
request_path_params("/people", :method => :bacon)
|
1161
|
+
}
|
1162
|
+
|
1163
|
+
params = request_path_params("/people/5", :method => :get)
|
1164
|
+
assert_equal("show", params[:action])
|
1165
|
+
assert_equal("5", params[:id])
|
1166
|
+
|
1167
|
+
params = request_path_params("/people/5", :method => :put)
|
1168
|
+
assert_equal("update", params[:action])
|
1169
|
+
assert_equal("5", params[:id])
|
1170
|
+
|
1171
|
+
params = request_path_params("/people/5", :method => :patch)
|
1172
|
+
assert_equal("update", params[:action])
|
1173
|
+
assert_equal("5", params[:id])
|
1174
|
+
|
1175
|
+
params = request_path_params("/people/5", :method => :delete)
|
1176
|
+
assert_equal("destroy", params[:action])
|
1177
|
+
assert_equal("5", params[:id])
|
1178
|
+
|
1179
|
+
assert_raise(ActionController::RoutingError) {
|
1180
|
+
request_path_params("/people/5", :method => :post)
|
1181
|
+
}
|
1182
|
+
end
|
1183
|
+
|
1184
|
+
def test_recognize_with_alias_in_conditions
|
1185
|
+
set.draw do
|
1186
|
+
match "/people" => 'people#index', :as => 'people', :via => :get
|
1187
|
+
root :to => "people#index"
|
1188
|
+
end
|
1189
|
+
|
1190
|
+
params = request_path_params("/people", :method => :get)
|
1191
|
+
assert_equal("people", params[:controller])
|
1192
|
+
assert_equal("index", params[:action])
|
1193
|
+
|
1194
|
+
params = request_path_params("/", :method => :get)
|
1195
|
+
assert_equal("people", params[:controller])
|
1196
|
+
assert_equal("index", params[:action])
|
1197
|
+
end
|
1198
|
+
|
1199
|
+
def test_typo_recognition
|
1200
|
+
set.draw do
|
1201
|
+
get 'articles/:year/:month/:day/:title' => 'articles#permalink',
|
1202
|
+
:year => /\d{4}/, :day => /\d{1,2}/, :month => /\d{1,2}/
|
1203
|
+
end
|
1204
|
+
|
1205
|
+
params = request_path_params("/articles/2005/11/05/a-very-interesting-article", :method => :get)
|
1206
|
+
assert_equal("permalink", params[:action])
|
1207
|
+
assert_equal("2005", params[:year])
|
1208
|
+
assert_equal("11", params[:month])
|
1209
|
+
assert_equal("05", params[:day])
|
1210
|
+
assert_equal("a-very-interesting-article", params[:title])
|
1211
|
+
end
|
1212
|
+
|
1213
|
+
def test_routing_traversal_does_not_load_extra_classes
|
1214
|
+
assert !Object.const_defined?("Profiler__"), "Profiler should not be loaded"
|
1215
|
+
set.draw do
|
1216
|
+
get '/profile' => 'profile#index'
|
1217
|
+
end
|
1218
|
+
|
1219
|
+
request_path_params("/profile") rescue nil
|
1220
|
+
|
1221
|
+
assert !Object.const_defined?("Profiler__"), "Profiler should not be loaded"
|
1222
|
+
end
|
1223
|
+
|
1224
|
+
def test_recognize_with_conditions_and_format
|
1225
|
+
set.draw do
|
1226
|
+
get "people/:id" => "people#show", :as => "person"
|
1227
|
+
put "people/:id" => "people#update"
|
1228
|
+
patch "people/:id" => "people#update"
|
1229
|
+
get "people/:id(.:format)" => "people#show"
|
1230
|
+
end
|
1231
|
+
|
1232
|
+
params = request_path_params("/people/5", :method => :get)
|
1233
|
+
assert_equal("show", params[:action])
|
1234
|
+
assert_equal("5", params[:id])
|
1235
|
+
|
1236
|
+
params = request_path_params("/people/5", :method => :put)
|
1237
|
+
assert_equal("update", params[:action])
|
1238
|
+
|
1239
|
+
params = request_path_params("/people/5", :method => :patch)
|
1240
|
+
assert_equal("update", params[:action])
|
1241
|
+
|
1242
|
+
params = request_path_params("/people/5.png", :method => :get)
|
1243
|
+
assert_equal("show", params[:action])
|
1244
|
+
assert_equal("5", params[:id])
|
1245
|
+
assert_equal("png", params[:format])
|
1246
|
+
end
|
1247
|
+
|
1248
|
+
def test_generate_with_default_action
|
1249
|
+
set.draw do
|
1250
|
+
get "/people", :controller => "people", :action => "index"
|
1251
|
+
get "/people/list", :controller => "people", :action => "list"
|
1252
|
+
end
|
1253
|
+
|
1254
|
+
url = url_for(set, { :controller => "people", :action => "list" })
|
1255
|
+
assert_equal "/people/list", url
|
1256
|
+
end
|
1257
|
+
|
1258
|
+
def test_root_map
|
1259
|
+
set.draw { root :to => 'people#index' }
|
1260
|
+
|
1261
|
+
params = request_path_params("", :method => :get)
|
1262
|
+
assert_equal("people", params[:controller])
|
1263
|
+
assert_equal("index", params[:action])
|
1264
|
+
end
|
1265
|
+
|
1266
|
+
def test_namespace
|
1267
|
+
set.draw do
|
1268
|
+
|
1269
|
+
namespace 'api' do
|
1270
|
+
get 'inventory' => 'products#inventory'
|
1271
|
+
end
|
1272
|
+
|
1273
|
+
end
|
1274
|
+
|
1275
|
+
params = request_path_params("/api/inventory", :method => :get)
|
1276
|
+
assert_equal("api/products", params[:controller])
|
1277
|
+
assert_equal("inventory", params[:action])
|
1278
|
+
end
|
1279
|
+
|
1280
|
+
def test_namespaced_root_map
|
1281
|
+
set.draw do
|
1282
|
+
namespace 'api' do
|
1283
|
+
root :to => 'products#index'
|
1284
|
+
end
|
1285
|
+
end
|
1286
|
+
|
1287
|
+
params = request_path_params("/api", :method => :get)
|
1288
|
+
assert_equal("api/products", params[:controller])
|
1289
|
+
assert_equal("index", params[:action])
|
1290
|
+
end
|
1291
|
+
|
1292
|
+
def test_namespace_with_path_prefix
|
1293
|
+
set.draw do
|
1294
|
+
scope :module => "api", :path => "prefix" do
|
1295
|
+
get 'inventory' => 'products#inventory'
|
1296
|
+
end
|
1297
|
+
end
|
1298
|
+
|
1299
|
+
params = request_path_params("/prefix/inventory", :method => :get)
|
1300
|
+
assert_equal("api/products", params[:controller])
|
1301
|
+
assert_equal("inventory", params[:action])
|
1302
|
+
end
|
1303
|
+
|
1304
|
+
def test_namespace_with_blank_path_prefix
|
1305
|
+
set.draw do
|
1306
|
+
scope :module => "api", :path => "" do
|
1307
|
+
get 'inventory' => 'products#inventory'
|
1308
|
+
end
|
1309
|
+
end
|
1310
|
+
|
1311
|
+
params = request_path_params("/inventory", :method => :get)
|
1312
|
+
assert_equal("api/products", params[:controller])
|
1313
|
+
assert_equal("inventory", params[:action])
|
1314
|
+
end
|
1315
|
+
|
1316
|
+
def test_id_is_sticky_when_it_ought_to_be
|
1317
|
+
@set = make_set false
|
1318
|
+
|
1319
|
+
set.draw do
|
1320
|
+
get ':controller/:id/:action'
|
1321
|
+
end
|
1322
|
+
|
1323
|
+
get URI('http://test.host/people/7/show')
|
1324
|
+
|
1325
|
+
assert_equal "/people/7/destroy", controller.url_for(:action => 'destroy', :only_path => true)
|
1326
|
+
end
|
1327
|
+
|
1328
|
+
def test_use_static_path_when_possible
|
1329
|
+
@set = make_set false
|
1330
|
+
|
1331
|
+
set.draw do
|
1332
|
+
get 'about' => "welcome#about"
|
1333
|
+
get ':controller/:action/:id'
|
1334
|
+
end
|
1335
|
+
|
1336
|
+
get URI('http://test.host/welcom/get/7')
|
1337
|
+
|
1338
|
+
assert_equal "/about", controller.url_for(:controller => 'welcome',
|
1339
|
+
:action => 'about',
|
1340
|
+
:only_path => true)
|
1341
|
+
end
|
1342
|
+
|
1343
|
+
def test_generate
|
1344
|
+
set.draw { get ':controller/:action/:id' }
|
1345
|
+
|
1346
|
+
args = { :controller => "foo", :action => "bar", :id => "7", :x => "y" }
|
1347
|
+
assert_equal "/foo/bar/7?x=y", url_for(set, args)
|
1348
|
+
assert_equal ["/foo/bar/7", [:x]], set.generate_extras(args)
|
1349
|
+
assert_equal [:x], set.extra_keys(args)
|
1350
|
+
end
|
1351
|
+
|
1352
|
+
def test_generate_with_path_prefix
|
1353
|
+
set.draw do
|
1354
|
+
scope "my" do
|
1355
|
+
get ':controller(/:action(/:id))'
|
1356
|
+
end
|
1357
|
+
end
|
1358
|
+
|
1359
|
+
args = { :controller => "foo", :action => "bar", :id => "7", :x => "y" }
|
1360
|
+
assert_equal "/my/foo/bar/7?x=y", url_for(set, args)
|
1361
|
+
end
|
1362
|
+
|
1363
|
+
def test_generate_with_blank_path_prefix
|
1364
|
+
set.draw do
|
1365
|
+
scope "" do
|
1366
|
+
get ':controller(/:action(/:id))'
|
1367
|
+
end
|
1368
|
+
end
|
1369
|
+
|
1370
|
+
args = { :controller => "foo", :action => "bar", :id => "7", :x => "y" }
|
1371
|
+
assert_equal "/foo/bar/7?x=y", url_for(set, args)
|
1372
|
+
end
|
1373
|
+
|
1374
|
+
def test_named_routes_are_never_relative_to_modules
|
1375
|
+
@set = make_set false
|
1376
|
+
|
1377
|
+
set.draw do
|
1378
|
+
get "/connection/manage(/:action)" => 'connection/manage#index'
|
1379
|
+
get "/connection/connection" => "connection/connection#index"
|
1380
|
+
get '/connection' => 'connection#index', :as => 'family_connection'
|
1381
|
+
end
|
1382
|
+
|
1383
|
+
assert_equal({ :controller => 'connection/manage',
|
1384
|
+
:action => 'index', }, request_path_params('/connection/manage'))
|
1385
|
+
|
1386
|
+
url = controller.url_for({ :controller => "connection", :only_path => true })
|
1387
|
+
assert_equal "/connection/connection", url
|
1388
|
+
|
1389
|
+
url = controller.url_for({ :use_route => "family_connection",
|
1390
|
+
:controller => "connection", :only_path => true })
|
1391
|
+
assert_equal "/connection", url
|
1392
|
+
end
|
1393
|
+
|
1394
|
+
def test_action_left_off_when_id_is_recalled
|
1395
|
+
@set = make_set false
|
1396
|
+
|
1397
|
+
set.draw do
|
1398
|
+
get ':controller(/:action(/:id))'
|
1399
|
+
end
|
1400
|
+
|
1401
|
+
get URI('http://test.host/books/show/10')
|
1402
|
+
|
1403
|
+
assert_equal '/books', controller.url_for(:controller => 'books',
|
1404
|
+
:only_path => true,
|
1405
|
+
:action => 'index')
|
1406
|
+
end
|
1407
|
+
|
1408
|
+
def test_query_params_will_be_shown_when_recalled
|
1409
|
+
@set = make_set false
|
1410
|
+
|
1411
|
+
set.draw do
|
1412
|
+
get 'show_weblog/:parameter' => 'weblog#show'
|
1413
|
+
get ':controller(/:action(/:id))'
|
1414
|
+
end
|
1415
|
+
|
1416
|
+
get URI('http://test.host/weblog/show/1')
|
1417
|
+
|
1418
|
+
assert_equal '/weblog/edit?parameter=1', controller.url_for(
|
1419
|
+
{:action => 'edit', :parameter => 1, :only_path => true})
|
1420
|
+
end
|
1421
|
+
|
1422
|
+
def test_format_is_not_inherit
|
1423
|
+
set.draw do
|
1424
|
+
get '/posts(.:format)' => 'posts#index'
|
1425
|
+
end
|
1426
|
+
|
1427
|
+
get URI('http://test.host/posts.xml')
|
1428
|
+
assert_equal({:controller => 'posts', :action => 'index', :format => 'xml'},
|
1429
|
+
controller.request.path_parameters)
|
1430
|
+
|
1431
|
+
assert_equal '/posts', controller.url_for(
|
1432
|
+
{:controller => 'posts', :only_path => true})
|
1433
|
+
|
1434
|
+
assert_equal '/posts.xml', controller.url_for(
|
1435
|
+
{:controller => 'posts', :format => 'xml', :only_path => true})
|
1436
|
+
end
|
1437
|
+
|
1438
|
+
def test_expiry_determination_should_consider_values_with_to_param
|
1439
|
+
@set = make_set false
|
1440
|
+
|
1441
|
+
set.draw { get 'projects/:project_id/:controller/:action' }
|
1442
|
+
|
1443
|
+
get URI('http://test.host/projects/1/weblog/show')
|
1444
|
+
|
1445
|
+
assert_equal(
|
1446
|
+
{ :controller => 'weblog', :action => 'show', :project_id => '1' },
|
1447
|
+
controller.request.path_parameters)
|
1448
|
+
|
1449
|
+
assert_equal '/projects/1/weblog/show',
|
1450
|
+
controller.url_for({ :action => 'show', :project_id => 1, :only_path => true })
|
1451
|
+
end
|
1452
|
+
|
1453
|
+
def test_named_route_in_nested_resource
|
1454
|
+
set.draw do
|
1455
|
+
resources :projects do
|
1456
|
+
member do
|
1457
|
+
get 'milestones' => 'milestones#index', :as => 'milestones'
|
1458
|
+
end
|
1459
|
+
end
|
1460
|
+
end
|
1461
|
+
|
1462
|
+
params = set.recognize_path("/projects/1/milestones", :method => :get)
|
1463
|
+
assert_equal("milestones", params[:controller])
|
1464
|
+
assert_equal("index", params[:action])
|
1465
|
+
end
|
1466
|
+
|
1467
|
+
def test_setting_root_in_namespace_using_symbol
|
1468
|
+
assert_nothing_raised do
|
1469
|
+
set.draw do
|
1470
|
+
namespace :admin do
|
1471
|
+
root :to => "home#index"
|
1472
|
+
end
|
1473
|
+
end
|
1474
|
+
end
|
1475
|
+
end
|
1476
|
+
|
1477
|
+
def test_setting_root_in_namespace_using_string
|
1478
|
+
assert_nothing_raised do
|
1479
|
+
set.draw do
|
1480
|
+
namespace 'admin' do
|
1481
|
+
root :to => "home#index"
|
1482
|
+
end
|
1483
|
+
end
|
1484
|
+
end
|
1485
|
+
end
|
1486
|
+
|
1487
|
+
def test_route_constraints_with_unsupported_regexp_options_must_error
|
1488
|
+
assert_raise ArgumentError do
|
1489
|
+
set.draw do
|
1490
|
+
get 'page/:name' => 'pages#show',
|
1491
|
+
:constraints => { :name => /(david|jamis)/m }
|
1492
|
+
end
|
1493
|
+
end
|
1494
|
+
end
|
1495
|
+
|
1496
|
+
def test_route_constraints_with_supported_options_must_not_error
|
1497
|
+
assert_nothing_raised do
|
1498
|
+
set.draw do
|
1499
|
+
get 'page/:name' => 'pages#show',
|
1500
|
+
:constraints => { :name => /(david|jamis)/i }
|
1501
|
+
end
|
1502
|
+
end
|
1503
|
+
assert_nothing_raised do
|
1504
|
+
set.draw do
|
1505
|
+
get 'page/:name' => 'pages#show',
|
1506
|
+
:constraints => { :name => / # Desperately overcommented regexp
|
1507
|
+
( #Either
|
1508
|
+
david #The Creator
|
1509
|
+
| #Or
|
1510
|
+
jamis #The Deployer
|
1511
|
+
)/x }
|
1512
|
+
end
|
1513
|
+
end
|
1514
|
+
end
|
1515
|
+
|
1516
|
+
def test_route_with_subdomain_and_constraints_must_receive_params
|
1517
|
+
name_param = nil
|
1518
|
+
set.draw do
|
1519
|
+
get 'page/:name' => 'pages#show', :constraints => lambda {|request|
|
1520
|
+
name_param = request.params[:name]
|
1521
|
+
return true
|
1522
|
+
}
|
1523
|
+
end
|
1524
|
+
assert_equal({:controller => 'pages', :action => 'show', :name => 'mypage'},
|
1525
|
+
set.recognize_path('http://subdomain.example.org/page/mypage'))
|
1526
|
+
assert_equal(name_param, 'mypage')
|
1527
|
+
end
|
1528
|
+
|
1529
|
+
def test_route_requirement_recognize_with_ignore_case
|
1530
|
+
set.draw do
|
1531
|
+
get 'page/:name' => 'pages#show',
|
1532
|
+
:constraints => {:name => /(david|jamis)/i}
|
1533
|
+
end
|
1534
|
+
assert_equal({:controller => 'pages', :action => 'show', :name => 'jamis'}, set.recognize_path('/page/jamis'))
|
1535
|
+
assert_raise ActionController::RoutingError do
|
1536
|
+
set.recognize_path('/page/davidjamis')
|
1537
|
+
end
|
1538
|
+
assert_equal({:controller => 'pages', :action => 'show', :name => 'DAVID'}, set.recognize_path('/page/DAVID'))
|
1539
|
+
end
|
1540
|
+
|
1541
|
+
def test_route_requirement_generate_with_ignore_case
|
1542
|
+
set.draw do
|
1543
|
+
get 'page/:name' => 'pages#show',
|
1544
|
+
:constraints => {:name => /(david|jamis)/i}
|
1545
|
+
end
|
1546
|
+
|
1547
|
+
url = url_for(set, { :controller => 'pages', :action => 'show', :name => 'david' })
|
1548
|
+
assert_equal "/page/david", url
|
1549
|
+
assert_raise(ActionController::UrlGenerationError) do
|
1550
|
+
url_for(set, { :controller => 'pages', :action => 'show', :name => 'davidjamis' })
|
1551
|
+
end
|
1552
|
+
url = url_for(set, { :controller => 'pages', :action => 'show', :name => 'JAMIS' })
|
1553
|
+
assert_equal "/page/JAMIS", url
|
1554
|
+
end
|
1555
|
+
|
1556
|
+
def test_route_requirement_recognize_with_extended_syntax
|
1557
|
+
set.draw do
|
1558
|
+
get 'page/:name' => 'pages#show',
|
1559
|
+
:constraints => {:name => / # Desperately overcommented regexp
|
1560
|
+
( #Either
|
1561
|
+
david #The Creator
|
1562
|
+
| #Or
|
1563
|
+
jamis #The Deployer
|
1564
|
+
)/x}
|
1565
|
+
end
|
1566
|
+
assert_equal({:controller => 'pages', :action => 'show', :name => 'jamis'}, set.recognize_path('/page/jamis'))
|
1567
|
+
assert_equal({:controller => 'pages', :action => 'show', :name => 'david'}, set.recognize_path('/page/david'))
|
1568
|
+
assert_raise ActionController::RoutingError do
|
1569
|
+
set.recognize_path('/page/david #The Creator')
|
1570
|
+
end
|
1571
|
+
assert_raise ActionController::RoutingError do
|
1572
|
+
set.recognize_path('/page/David')
|
1573
|
+
end
|
1574
|
+
end
|
1575
|
+
|
1576
|
+
def test_route_requirement_with_xi_modifiers
|
1577
|
+
set.draw do
|
1578
|
+
get 'page/:name' => 'pages#show',
|
1579
|
+
:constraints => {:name => / # Desperately overcommented regexp
|
1580
|
+
( #Either
|
1581
|
+
david #The Creator
|
1582
|
+
| #Or
|
1583
|
+
jamis #The Deployer
|
1584
|
+
)/xi}
|
1585
|
+
end
|
1586
|
+
|
1587
|
+
assert_equal({:controller => 'pages', :action => 'show', :name => 'JAMIS'},
|
1588
|
+
set.recognize_path('/page/JAMIS'))
|
1589
|
+
|
1590
|
+
assert_equal "/page/JAMIS",
|
1591
|
+
url_for(set, { :controller => 'pages', :action => 'show', :name => 'JAMIS' })
|
1592
|
+
end
|
1593
|
+
|
1594
|
+
def test_routes_with_symbols
|
1595
|
+
set.draw do
|
1596
|
+
get 'unnamed', :controller => :pages, :action => :show, :name => :as_symbol
|
1597
|
+
get 'named' , :controller => :pages, :action => :show, :name => :as_symbol, :as => :named
|
1598
|
+
end
|
1599
|
+
assert_equal({:controller => 'pages', :action => 'show', :name => :as_symbol}, set.recognize_path('/unnamed'))
|
1600
|
+
assert_equal({:controller => 'pages', :action => 'show', :name => :as_symbol}, set.recognize_path('/named'))
|
1601
|
+
end
|
1602
|
+
|
1603
|
+
def test_regexp_chunk_should_add_question_mark_for_optionals
|
1604
|
+
set.draw do
|
1605
|
+
get '/' => 'foo#index'
|
1606
|
+
get '/hello' => 'bar#index'
|
1607
|
+
end
|
1608
|
+
|
1609
|
+
assert_equal '/', url_for(set, { :controller => 'foo' })
|
1610
|
+
assert_equal '/hello', url_for(set, { :controller => 'bar' })
|
1611
|
+
|
1612
|
+
assert_equal({:controller => "foo", :action => "index"}, set.recognize_path('/'))
|
1613
|
+
assert_equal({:controller => "bar", :action => "index"}, set.recognize_path('/hello'))
|
1614
|
+
end
|
1615
|
+
|
1616
|
+
def test_assign_route_options_with_anchor_chars
|
1617
|
+
set.draw do
|
1618
|
+
get '/cars/:action/:person/:car/', :controller => 'cars'
|
1619
|
+
end
|
1620
|
+
|
1621
|
+
assert_equal '/cars/buy/1/2', url_for(set, { :controller => 'cars', :action => 'buy', :person => '1', :car => '2' })
|
1622
|
+
|
1623
|
+
assert_equal({:controller => "cars", :action => "buy", :person => "1", :car => "2"}, set.recognize_path('/cars/buy/1/2'))
|
1624
|
+
end
|
1625
|
+
|
1626
|
+
def test_segmentation_of_dot_path
|
1627
|
+
set.draw do
|
1628
|
+
get '/books/:action.rss', :controller => 'books'
|
1629
|
+
end
|
1630
|
+
|
1631
|
+
assert_equal '/books/list.rss', url_for(set, { :controller => 'books', :action => 'list' })
|
1632
|
+
|
1633
|
+
assert_equal({:controller => "books", :action => "list"}, set.recognize_path('/books/list.rss'))
|
1634
|
+
end
|
1635
|
+
|
1636
|
+
def test_segmentation_of_dynamic_dot_path
|
1637
|
+
set.draw do
|
1638
|
+
get '/books(/:action(.:format))', :controller => 'books'
|
1639
|
+
end
|
1640
|
+
|
1641
|
+
assert_equal '/books/list.rss', url_for(set, { :controller => 'books', :action => 'list', :format => 'rss' })
|
1642
|
+
assert_equal '/books/list.xml', url_for(set, { :controller => 'books', :action => 'list', :format => 'xml' })
|
1643
|
+
assert_equal '/books/list', url_for(set, { :controller => 'books', :action => 'list' })
|
1644
|
+
assert_equal '/books', url_for(set, { :controller => 'books', :action => 'index' })
|
1645
|
+
|
1646
|
+
assert_equal({:controller => "books", :action => "list", :format => "rss"}, set.recognize_path('/books/list.rss'))
|
1647
|
+
assert_equal({:controller => "books", :action => "list", :format => "xml"}, set.recognize_path('/books/list.xml'))
|
1648
|
+
assert_equal({:controller => "books", :action => "list"}, set.recognize_path('/books/list'))
|
1649
|
+
assert_equal({:controller => "books", :action => "index"}, set.recognize_path('/books'))
|
1650
|
+
end
|
1651
|
+
|
1652
|
+
def test_slashes_are_implied
|
1653
|
+
set.draw { get("/:controller(/:action(/:id))") }
|
1654
|
+
|
1655
|
+
assert_equal '/content', url_for(set, { :controller => 'content', :action => 'index' })
|
1656
|
+
assert_equal '/content/list', url_for(set, { :controller => 'content', :action => 'list' })
|
1657
|
+
assert_equal '/content/show/1', url_for(set, { :controller => 'content', :action => 'show', :id => '1' })
|
1658
|
+
|
1659
|
+
assert_equal({:controller => "content", :action => "index"}, set.recognize_path('/content'))
|
1660
|
+
assert_equal({:controller => "content", :action => "index"}, set.recognize_path('/content/index'))
|
1661
|
+
assert_equal({:controller => "content", :action => "list"}, set.recognize_path('/content/list'))
|
1662
|
+
assert_equal({:controller => "content", :action => "show", :id => "1"}, set.recognize_path('/content/show/1'))
|
1663
|
+
end
|
1664
|
+
|
1665
|
+
def test_default_route_recognition
|
1666
|
+
expected = {:controller => 'pages', :action => 'show', :id => '10'}
|
1667
|
+
assert_equal expected, default_route_set.recognize_path('/pages/show/10')
|
1668
|
+
assert_equal expected, default_route_set.recognize_path('/pages/show/10/')
|
1669
|
+
|
1670
|
+
expected[:id] = 'jamis'
|
1671
|
+
assert_equal expected, default_route_set.recognize_path('/pages/show/jamis/')
|
1672
|
+
|
1673
|
+
expected.delete :id
|
1674
|
+
assert_equal expected, default_route_set.recognize_path('/pages/show')
|
1675
|
+
assert_equal expected, default_route_set.recognize_path('/pages/show/')
|
1676
|
+
|
1677
|
+
expected[:action] = 'index'
|
1678
|
+
assert_equal expected, default_route_set.recognize_path('/pages/')
|
1679
|
+
assert_equal expected, default_route_set.recognize_path('/pages')
|
1680
|
+
|
1681
|
+
assert_raise(ActionController::RoutingError) { default_route_set.recognize_path('/') }
|
1682
|
+
assert_raise(ActionController::RoutingError) { default_route_set.recognize_path('/pages/how/goood/it/is/to/be/free') }
|
1683
|
+
end
|
1684
|
+
|
1685
|
+
def test_default_route_should_omit_default_action
|
1686
|
+
assert_equal '/accounts', url_for(default_route_set, { :controller => 'accounts', :action => 'index' })
|
1687
|
+
end
|
1688
|
+
|
1689
|
+
def test_default_route_should_include_default_action_when_id_present
|
1690
|
+
assert_equal '/accounts/index/20', url_for(default_route_set, { :controller => 'accounts', :action => 'index', :id => '20' })
|
1691
|
+
end
|
1692
|
+
|
1693
|
+
def test_default_route_should_work_with_action_but_no_id
|
1694
|
+
assert_equal '/accounts/list_all', url_for(default_route_set, { :controller => 'accounts', :action => 'list_all' })
|
1695
|
+
end
|
1696
|
+
|
1697
|
+
def test_default_route_should_uri_escape_pluses
|
1698
|
+
expected = { :controller => 'pages', :action => 'show', :id => 'hello world' }
|
1699
|
+
assert_equal expected, default_route_set.recognize_path('/pages/show/hello%20world')
|
1700
|
+
assert_equal '/pages/show/hello%20world', url_for(default_route_set, expected)
|
1701
|
+
|
1702
|
+
expected[:id] = 'hello+world'
|
1703
|
+
assert_equal expected, default_route_set.recognize_path('/pages/show/hello+world')
|
1704
|
+
assert_equal expected, default_route_set.recognize_path('/pages/show/hello%2Bworld')
|
1705
|
+
assert_equal '/pages/show/hello+world', url_for(default_route_set, expected)
|
1706
|
+
end
|
1707
|
+
|
1708
|
+
def test_build_empty_query_string
|
1709
|
+
assert_uri_equal '/foo', url_for(default_route_set, { :controller => 'foo' })
|
1710
|
+
end
|
1711
|
+
|
1712
|
+
def test_build_query_string_with_nil_value
|
1713
|
+
assert_uri_equal '/foo', url_for(default_route_set, { :controller => 'foo', :x => nil })
|
1714
|
+
end
|
1715
|
+
|
1716
|
+
def test_simple_build_query_string
|
1717
|
+
assert_uri_equal '/foo?x=1&y=2', url_for(default_route_set, { :controller => 'foo', :x => '1', :y => '2' })
|
1718
|
+
end
|
1719
|
+
|
1720
|
+
def test_convert_ints_build_query_string
|
1721
|
+
assert_uri_equal '/foo?x=1&y=2', url_for(default_route_set, { :controller => 'foo', :x => 1, :y => 2 })
|
1722
|
+
end
|
1723
|
+
|
1724
|
+
def test_escape_spaces_build_query_string
|
1725
|
+
assert_uri_equal '/foo?x=hello+world&y=goodbye+world', url_for(default_route_set, { :controller => 'foo', :x => 'hello world', :y => 'goodbye world' })
|
1726
|
+
end
|
1727
|
+
|
1728
|
+
def test_expand_array_build_query_string
|
1729
|
+
assert_uri_equal '/foo?x%5B%5D=1&x%5B%5D=2', url_for(default_route_set, { :controller => 'foo', :x => [1, 2] })
|
1730
|
+
end
|
1731
|
+
|
1732
|
+
def test_escape_spaces_build_query_string_selected_keys
|
1733
|
+
assert_uri_equal '/foo?x=hello+world', url_for(default_route_set, { :controller => 'foo', :x => 'hello world' })
|
1734
|
+
end
|
1735
|
+
|
1736
|
+
def test_generate_with_default_params
|
1737
|
+
set.draw do
|
1738
|
+
get 'dummy/page/:page' => 'dummy#show'
|
1739
|
+
get 'dummy/dots/page.:page' => 'dummy#dots'
|
1740
|
+
get 'ibocorp(/:page)' => 'ibocorp#show',
|
1741
|
+
:constraints => { :page => /\d+/ },
|
1742
|
+
:defaults => { :page => 1 }
|
1743
|
+
|
1744
|
+
get ':controller/:action/:id'
|
1745
|
+
end
|
1746
|
+
|
1747
|
+
assert_equal '/ibocorp', url_for(set, { :controller => 'ibocorp', :action => "show", :page => 1 })
|
1748
|
+
end
|
1749
|
+
|
1750
|
+
include ActionDispatch::RoutingVerbs
|
1751
|
+
|
1752
|
+
class TestSet < ROUTING::RouteSet
|
1753
|
+
def initialize(block)
|
1754
|
+
@block = block
|
1755
|
+
super()
|
1756
|
+
end
|
1757
|
+
|
1758
|
+
class Dispatcher < ROUTING::RouteSet::Dispatcher
|
1759
|
+
def initialize(defaults, set, block)
|
1760
|
+
super(defaults)
|
1761
|
+
@block = block
|
1762
|
+
@set = set
|
1763
|
+
end
|
1764
|
+
|
1765
|
+
def controller_reference(controller_param)
|
1766
|
+
block = @block
|
1767
|
+
set = @set
|
1768
|
+
Class.new(ActionController::Base) {
|
1769
|
+
include set.url_helpers
|
1770
|
+
define_method(:process) { |name| block.call(self) }
|
1771
|
+
def to_a; [200, {}, []]; end
|
1772
|
+
}
|
1773
|
+
end
|
1774
|
+
end
|
1775
|
+
|
1776
|
+
def dispatcher defaults
|
1777
|
+
TestSet::Dispatcher.new defaults, self, @block
|
1778
|
+
end
|
1779
|
+
end
|
1780
|
+
|
1781
|
+
alias :routes :set
|
1782
|
+
|
1783
|
+
def test_generate_with_optional_params_recalls_last_request
|
1784
|
+
controller = nil
|
1785
|
+
@set = TestSet.new ->(c) { controller = c }
|
1786
|
+
|
1787
|
+
set.draw do
|
1788
|
+
get "blog/", :controller => "blog", :action => "index"
|
1789
|
+
|
1790
|
+
get "blog(/:year(/:month(/:day)))",
|
1791
|
+
:controller => "blog",
|
1792
|
+
:action => "show_date",
|
1793
|
+
:constraints => { :year => /(19|20)\d\d/, :month => /[01]?\d/, :day => /[0-3]?\d/ },
|
1794
|
+
:day => nil, :month => nil
|
1795
|
+
|
1796
|
+
get "blog/show/:id", :controller => "blog", :action => "show", :id => /\d+/
|
1797
|
+
get "blog/:controller/:action(/:id)"
|
1798
|
+
get "*anything", :controller => "blog", :action => "unknown_request"
|
1799
|
+
end
|
1800
|
+
|
1801
|
+
recognize_path = ->(path) {
|
1802
|
+
get(URI("http://example.org" + path))
|
1803
|
+
controller.request.path_parameters
|
1804
|
+
}
|
1805
|
+
|
1806
|
+
assert_equal({:controller => "blog", :action => "index"}, recognize_path.("/blog"))
|
1807
|
+
assert_equal({:controller => "blog", :action => "show", :id => "123"}, recognize_path.("/blog/show/123"))
|
1808
|
+
assert_equal({:controller => "blog", :action => "show_date", :year => "2004", :day => nil, :month => nil }, recognize_path.("/blog/2004"))
|
1809
|
+
assert_equal({:controller => "blog", :action => "show_date", :year => "2004", :month => "12", :day => nil }, recognize_path.("/blog/2004/12"))
|
1810
|
+
assert_equal({:controller => "blog", :action => "show_date", :year => "2004", :month => "12", :day => "25"}, recognize_path.("/blog/2004/12/25"))
|
1811
|
+
assert_equal({:controller => "articles", :action => "edit", :id => "123"}, recognize_path.("/blog/articles/edit/123"))
|
1812
|
+
assert_equal({:controller => "articles", :action => "show_stats"}, recognize_path.("/blog/articles/show_stats"))
|
1813
|
+
assert_equal({:controller => "blog", :action => "unknown_request", :anything => "blog/wibble"}, recognize_path.("/blog/wibble"))
|
1814
|
+
assert_equal({:controller => "blog", :action => "unknown_request", :anything => "junk"}, recognize_path.("/junk"))
|
1815
|
+
|
1816
|
+
get URI('http://example.org/blog/2006/07/28')
|
1817
|
+
|
1818
|
+
assert_equal({:controller => "blog", :action => "show_date", :year => "2006", :month => "07", :day => "28"}, controller.request.path_parameters)
|
1819
|
+
assert_equal("/blog/2006/07/25", controller.url_for({ :day => 25, :only_path => true }))
|
1820
|
+
assert_equal("/blog/2005", controller.url_for({ :year => 2005, :only_path => true }))
|
1821
|
+
assert_equal("/blog/show/123", controller.url_for({ :action => "show" , :id => 123, :only_path => true }))
|
1822
|
+
assert_equal("/blog/2006", controller.url_for({ :year => 2006, :only_path => true }))
|
1823
|
+
assert_equal("/blog/2006", controller.url_for({ :year => 2006, :month => nil, :only_path => true }))
|
1824
|
+
end
|
1825
|
+
|
1826
|
+
private
|
1827
|
+
def assert_uri_equal(expected, actual)
|
1828
|
+
assert_equal(sort_query_string_params(expected), sort_query_string_params(actual))
|
1829
|
+
end
|
1830
|
+
|
1831
|
+
def sort_query_string_params(uri)
|
1832
|
+
path, qs = uri.split('?')
|
1833
|
+
qs = qs.split('&').sort.join('&') if qs
|
1834
|
+
qs ? "#{path}?#{qs}" : path
|
1835
|
+
end
|
1836
|
+
end
|
1837
|
+
|
1838
|
+
class RackMountIntegrationTests < ActiveSupport::TestCase
|
1839
|
+
include RoutingTestHelpers
|
1840
|
+
|
1841
|
+
Model = Struct.new(:to_param)
|
1842
|
+
|
1843
|
+
Mapping = lambda {
|
1844
|
+
namespace :admin do
|
1845
|
+
resources :users, :posts
|
1846
|
+
end
|
1847
|
+
|
1848
|
+
namespace 'api' do
|
1849
|
+
root :to => 'users#index'
|
1850
|
+
end
|
1851
|
+
|
1852
|
+
get '/blog(/:year(/:month(/:day)))' => 'posts#show_date',
|
1853
|
+
:constraints => {
|
1854
|
+
:year => /(19|20)\d\d/,
|
1855
|
+
:month => /[01]?\d/,
|
1856
|
+
:day => /[0-3]?\d/
|
1857
|
+
},
|
1858
|
+
:day => nil,
|
1859
|
+
:month => nil
|
1860
|
+
|
1861
|
+
get 'archive/:year', :controller => 'archive', :action => 'index',
|
1862
|
+
:defaults => { :year => nil },
|
1863
|
+
:constraints => { :year => /\d{4}/ },
|
1864
|
+
:as => "blog"
|
1865
|
+
|
1866
|
+
resources :people
|
1867
|
+
get 'legacy/people' => "people#index", :legacy => "true"
|
1868
|
+
|
1869
|
+
get 'symbols', :controller => :symbols, :action => :show, :name => :as_symbol
|
1870
|
+
get 'id_default(/:id)' => "foo#id_default", :id => 1
|
1871
|
+
match 'get_or_post' => "foo#get_or_post", :via => [:get, :post]
|
1872
|
+
get 'optional/:optional' => "posts#index"
|
1873
|
+
get 'projects/:project_id' => "project#index", :as => "project"
|
1874
|
+
get 'clients' => "projects#index"
|
1875
|
+
|
1876
|
+
get 'ignorecase/geocode/:postalcode' => 'geocode#show', :postalcode => /hx\d\d-\d[a-z]{2}/i
|
1877
|
+
get 'extended/geocode/:postalcode' => 'geocode#show',:constraints => {
|
1878
|
+
:postalcode => /# Postcode format
|
1879
|
+
\d{5} #Prefix
|
1880
|
+
(-\d{4})? #Suffix
|
1881
|
+
/x
|
1882
|
+
}, :as => "geocode"
|
1883
|
+
|
1884
|
+
get 'news(.:format)' => "news#index"
|
1885
|
+
|
1886
|
+
get 'comment/:id(/:action)' => "comments#show"
|
1887
|
+
get 'ws/:controller(/:action(/:id))', :ws => true
|
1888
|
+
get 'account(/:action)' => "account#subscription"
|
1889
|
+
get 'pages/:page_id/:controller(/:action(/:id))'
|
1890
|
+
get ':controller/ping', :action => 'ping'
|
1891
|
+
get 'こんにちは/世界', :controller => 'news', :action => 'index'
|
1892
|
+
match ':controller(/:action(/:id))(.:format)', :via => :all
|
1893
|
+
root :to => "news#index"
|
1894
|
+
}
|
1895
|
+
|
1896
|
+
attr_reader :routes
|
1897
|
+
attr_reader :controller
|
1898
|
+
|
1899
|
+
def setup
|
1900
|
+
@routes = ActionDispatch::Routing::RouteSet.new
|
1901
|
+
@routes.draw(&Mapping)
|
1902
|
+
end
|
1903
|
+
|
1904
|
+
def test_recognize_path
|
1905
|
+
assert_equal({:controller => 'admin/users', :action => 'index'}, @routes.recognize_path('/admin/users', :method => :get))
|
1906
|
+
assert_equal({:controller => 'admin/users', :action => 'create'}, @routes.recognize_path('/admin/users', :method => :post))
|
1907
|
+
assert_equal({:controller => 'admin/users', :action => 'new'}, @routes.recognize_path('/admin/users/new', :method => :get))
|
1908
|
+
assert_equal({:controller => 'admin/users', :action => 'show', :id => '1'}, @routes.recognize_path('/admin/users/1', :method => :get))
|
1909
|
+
assert_equal({:controller => 'admin/users', :action => 'update', :id => '1'}, @routes.recognize_path('/admin/users/1', :method => :put))
|
1910
|
+
assert_equal({:controller => 'admin/users', :action => 'destroy', :id => '1'}, @routes.recognize_path('/admin/users/1', :method => :delete))
|
1911
|
+
assert_equal({:controller => 'admin/users', :action => 'edit', :id => '1'}, @routes.recognize_path('/admin/users/1/edit', :method => :get))
|
1912
|
+
|
1913
|
+
assert_equal({:controller => 'admin/posts', :action => 'index'}, @routes.recognize_path('/admin/posts', :method => :get))
|
1914
|
+
assert_equal({:controller => 'admin/posts', :action => 'new'}, @routes.recognize_path('/admin/posts/new', :method => :get))
|
1915
|
+
|
1916
|
+
assert_equal({:controller => 'api/users', :action => 'index'}, @routes.recognize_path('/api', :method => :get))
|
1917
|
+
assert_equal({:controller => 'api/users', :action => 'index'}, @routes.recognize_path('/api/', :method => :get))
|
1918
|
+
|
1919
|
+
assert_equal({:controller => 'posts', :action => 'show_date', :year => '2009', :month => nil, :day => nil }, @routes.recognize_path('/blog/2009', :method => :get))
|
1920
|
+
assert_equal({:controller => 'posts', :action => 'show_date', :year => '2009', :month => '01', :day => nil }, @routes.recognize_path('/blog/2009/01', :method => :get))
|
1921
|
+
assert_equal({:controller => 'posts', :action => 'show_date', :year => '2009', :month => '01', :day => '01'}, @routes.recognize_path('/blog/2009/01/01', :method => :get))
|
1922
|
+
|
1923
|
+
assert_equal({:controller => 'archive', :action => 'index', :year => '2010'}, @routes.recognize_path('/archive/2010'))
|
1924
|
+
assert_equal({:controller => 'archive', :action => 'index'}, @routes.recognize_path('/archive'))
|
1925
|
+
|
1926
|
+
assert_equal({:controller => 'people', :action => 'index'}, @routes.recognize_path('/people', :method => :get))
|
1927
|
+
assert_equal({:controller => 'people', :action => 'index', :format => 'xml'}, @routes.recognize_path('/people.xml', :method => :get))
|
1928
|
+
assert_equal({:controller => 'people', :action => 'create'}, @routes.recognize_path('/people', :method => :post))
|
1929
|
+
assert_equal({:controller => 'people', :action => 'new'}, @routes.recognize_path('/people/new', :method => :get))
|
1930
|
+
assert_equal({:controller => 'people', :action => 'show', :id => '1'}, @routes.recognize_path('/people/1', :method => :get))
|
1931
|
+
assert_equal({:controller => 'people', :action => 'show', :id => '1', :format => 'xml'}, @routes.recognize_path('/people/1.xml', :method => :get))
|
1932
|
+
assert_equal({:controller => 'people', :action => 'update', :id => '1'}, @routes.recognize_path('/people/1', :method => :put))
|
1933
|
+
assert_equal({:controller => 'people', :action => 'destroy', :id => '1'}, @routes.recognize_path('/people/1', :method => :delete))
|
1934
|
+
assert_equal({:controller => 'people', :action => 'edit', :id => '1'}, @routes.recognize_path('/people/1/edit', :method => :get))
|
1935
|
+
assert_equal({:controller => 'people', :action => 'edit', :id => '1', :format => 'xml'}, @routes.recognize_path('/people/1/edit.xml', :method => :get))
|
1936
|
+
|
1937
|
+
assert_equal({:controller => 'symbols', :action => 'show', :name => :as_symbol}, @routes.recognize_path('/symbols'))
|
1938
|
+
assert_equal({:controller => 'foo', :action => 'id_default', :id => '1'}, @routes.recognize_path('/id_default/1'))
|
1939
|
+
assert_equal({:controller => 'foo', :action => 'id_default', :id => '2'}, @routes.recognize_path('/id_default/2'))
|
1940
|
+
assert_equal({:controller => 'foo', :action => 'id_default', :id => 1 }, @routes.recognize_path('/id_default'))
|
1941
|
+
assert_equal({:controller => 'foo', :action => 'get_or_post'}, @routes.recognize_path('/get_or_post', :method => :get))
|
1942
|
+
assert_equal({:controller => 'foo', :action => 'get_or_post'}, @routes.recognize_path('/get_or_post', :method => :post))
|
1943
|
+
assert_raise(ActionController::RoutingError) { @routes.recognize_path('/get_or_post', :method => :put) }
|
1944
|
+
assert_raise(ActionController::RoutingError) { @routes.recognize_path('/get_or_post', :method => :delete) }
|
1945
|
+
|
1946
|
+
assert_equal({:controller => 'posts', :action => 'index', :optional => 'bar'}, @routes.recognize_path('/optional/bar'))
|
1947
|
+
assert_raise(ActionController::RoutingError) { @routes.recognize_path('/optional') }
|
1948
|
+
|
1949
|
+
assert_equal({:controller => 'posts', :action => 'show', :id => '1', :ws => true}, @routes.recognize_path('/ws/posts/show/1', :method => :get))
|
1950
|
+
assert_equal({:controller => 'posts', :action => 'list', :ws => true}, @routes.recognize_path('/ws/posts/list', :method => :get))
|
1951
|
+
assert_equal({:controller => 'posts', :action => 'index', :ws => true}, @routes.recognize_path('/ws/posts', :method => :get))
|
1952
|
+
|
1953
|
+
assert_equal({:controller => 'account', :action => 'subscription'}, @routes.recognize_path('/account', :method => :get))
|
1954
|
+
assert_equal({:controller => 'account', :action => 'subscription'}, @routes.recognize_path('/account/subscription', :method => :get))
|
1955
|
+
assert_equal({:controller => 'account', :action => 'billing'}, @routes.recognize_path('/account/billing', :method => :get))
|
1956
|
+
|
1957
|
+
assert_equal({:page_id => '1', :controller => 'notes', :action => 'index'}, @routes.recognize_path('/pages/1/notes', :method => :get))
|
1958
|
+
assert_equal({:page_id => '1', :controller => 'notes', :action => 'list'}, @routes.recognize_path('/pages/1/notes/list', :method => :get))
|
1959
|
+
assert_equal({:page_id => '1', :controller => 'notes', :action => 'show', :id => '2'}, @routes.recognize_path('/pages/1/notes/show/2', :method => :get))
|
1960
|
+
|
1961
|
+
assert_equal({:controller => 'posts', :action => 'ping'}, @routes.recognize_path('/posts/ping', :method => :get))
|
1962
|
+
assert_equal({:controller => 'posts', :action => 'index'}, @routes.recognize_path('/posts', :method => :get))
|
1963
|
+
assert_equal({:controller => 'posts', :action => 'index'}, @routes.recognize_path('/posts/index', :method => :get))
|
1964
|
+
assert_equal({:controller => 'posts', :action => 'show'}, @routes.recognize_path('/posts/show', :method => :get))
|
1965
|
+
assert_equal({:controller => 'posts', :action => 'show', :id => '1'}, @routes.recognize_path('/posts/show/1', :method => :get))
|
1966
|
+
assert_equal({:controller => 'posts', :action => 'create'}, @routes.recognize_path('/posts/create', :method => :post))
|
1967
|
+
|
1968
|
+
assert_equal({:controller => 'geocode', :action => 'show', :postalcode => 'hx12-1az'}, @routes.recognize_path('/ignorecase/geocode/hx12-1az'))
|
1969
|
+
assert_equal({:controller => 'geocode', :action => 'show', :postalcode => 'hx12-1AZ'}, @routes.recognize_path('/ignorecase/geocode/hx12-1AZ'))
|
1970
|
+
assert_equal({:controller => 'geocode', :action => 'show', :postalcode => '12345-1234'}, @routes.recognize_path('/extended/geocode/12345-1234'))
|
1971
|
+
assert_equal({:controller => 'geocode', :action => 'show', :postalcode => '12345'}, @routes.recognize_path('/extended/geocode/12345'))
|
1972
|
+
|
1973
|
+
assert_equal({:controller => 'news', :action => 'index' }, @routes.recognize_path('/', :method => :get))
|
1974
|
+
assert_equal({:controller => 'news', :action => 'index', :format => 'rss'}, @routes.recognize_path('/news.rss', :method => :get))
|
1975
|
+
|
1976
|
+
assert_raise(ActionController::RoutingError) { @routes.recognize_path('/none', :method => :get) }
|
1977
|
+
end
|
1978
|
+
|
1979
|
+
def test_generate_extras
|
1980
|
+
assert_equal ['/people', []], @routes.generate_extras(:controller => 'people')
|
1981
|
+
assert_equal ['/people', [:foo]], @routes.generate_extras(:controller => 'people', :foo => 'bar')
|
1982
|
+
assert_equal ['/people', []], @routes.generate_extras(:controller => 'people', :action => 'index')
|
1983
|
+
assert_equal ['/people', [:foo]], @routes.generate_extras(:controller => 'people', :action => 'index', :foo => 'bar')
|
1984
|
+
assert_equal ['/people/new', []], @routes.generate_extras(:controller => 'people', :action => 'new')
|
1985
|
+
assert_equal ['/people/new', [:foo]], @routes.generate_extras(:controller => 'people', :action => 'new', :foo => 'bar')
|
1986
|
+
assert_equal ['/people/1', []], @routes.generate_extras(:controller => 'people', :action => 'show', :id => '1')
|
1987
|
+
assert_equal ['/people/1', [:bar, :foo]], sort_extras!(@routes.generate_extras(:controller => 'people', :action => 'show', :id => '1', :foo => '2', :bar => '3'))
|
1988
|
+
assert_equal ['/people', [:person]], @routes.generate_extras(:controller => 'people', :action => 'create', :person => { :first_name => 'Josh', :last_name => 'Peek' })
|
1989
|
+
assert_equal ['/people', [:people]], @routes.generate_extras(:controller => 'people', :action => 'create', :people => ['Josh', 'Dave'])
|
1990
|
+
|
1991
|
+
assert_equal ['/posts/show/1', []], @routes.generate_extras(:controller => 'posts', :action => 'show', :id => '1')
|
1992
|
+
assert_equal ['/posts/show/1', [:bar, :foo]], sort_extras!(@routes.generate_extras(:controller => 'posts', :action => 'show', :id => '1', :foo => '2', :bar => '3'))
|
1993
|
+
assert_equal ['/posts', []], @routes.generate_extras(:controller => 'posts', :action => 'index')
|
1994
|
+
assert_equal ['/posts', [:foo]], @routes.generate_extras(:controller => 'posts', :action => 'index', :foo => 'bar')
|
1995
|
+
end
|
1996
|
+
|
1997
|
+
def test_extras
|
1998
|
+
params = {:controller => 'people'}
|
1999
|
+
assert_equal [], @routes.extra_keys(params)
|
2000
|
+
assert_equal({:controller => 'people'}, params)
|
2001
|
+
|
2002
|
+
params = {:controller => 'people', :foo => 'bar'}
|
2003
|
+
assert_equal [:foo], @routes.extra_keys(params)
|
2004
|
+
assert_equal({:controller => 'people', :foo => 'bar'}, params)
|
2005
|
+
|
2006
|
+
params = {:controller => 'people', :action => 'create', :person => { :name => 'Josh'}}
|
2007
|
+
assert_equal [:person], @routes.extra_keys(params)
|
2008
|
+
assert_equal({:controller => 'people', :action => 'create', :person => { :name => 'Josh'}}, params)
|
2009
|
+
end
|
2010
|
+
|
2011
|
+
def test_unicode_path
|
2012
|
+
assert_equal({:controller => 'news', :action => 'index'}, @routes.recognize_path(URI.parser.escape('こんにちは/世界'), :method => :get))
|
2013
|
+
end
|
2014
|
+
|
2015
|
+
def test_downcased_unicode_path
|
2016
|
+
assert_equal({:controller => 'news', :action => 'index'}, @routes.recognize_path(URI.parser.escape('こんにちは/世界').downcase, :method => :get))
|
2017
|
+
end
|
2018
|
+
|
2019
|
+
private
|
2020
|
+
def sort_extras!(extras)
|
2021
|
+
if extras.length == 2
|
2022
|
+
extras[1].sort! { |a, b| a.to_s <=> b.to_s }
|
2023
|
+
end
|
2024
|
+
extras
|
2025
|
+
end
|
2026
|
+
end
|