aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml2
-rw-r--r--Gemfile1
-rw-r--r--Rakefile2
-rw-r--r--actionmailer/Rakefile2
-rw-r--r--actionpack/CHANGELOG.md8
-rw-r--r--actionpack/Rakefile21
-rw-r--r--actionpack/actionpack.gemspec4
-rw-r--r--actionpack/lib/action_controller/metal/responder.rb8
-rw-r--r--actionpack/lib/action_dispatch/journey/router.rb8
-rw-r--r--actionpack/test/controller/caching_test.rb1
-rw-r--r--actionpack/test/dispatch/mount_test.rb5
-rw-r--r--actionview/CHANGELOG.md42
-rw-r--r--actionview/MIT-LICENSE21
-rw-r--r--actionview/README.rdoc31
-rw-r--r--actionview/RUNNING_UNIT_TESTS27
-rw-r--r--actionview/Rakefile79
-rw-r--r--actionview/actionview.gemspec29
-rw-r--r--actionview/lib/action_view.rb (renamed from actionpack/lib/action_view.rb)1
-rw-r--r--actionview/lib/action_view/base.rb (renamed from actionpack/lib/action_view/base.rb)0
-rw-r--r--actionview/lib/action_view/buffers.rb (renamed from actionpack/lib/action_view/buffers.rb)0
-rw-r--r--actionview/lib/action_view/context.rb (renamed from actionpack/lib/action_view/context.rb)0
-rw-r--r--actionview/lib/action_view/dependency_tracker.rb (renamed from actionpack/lib/action_view/dependency_tracker.rb)0
-rw-r--r--actionview/lib/action_view/digestor.rb (renamed from actionpack/lib/action_view/digestor.rb)0
-rw-r--r--actionview/lib/action_view/flows.rb (renamed from actionpack/lib/action_view/flows.rb)0
-rw-r--r--actionview/lib/action_view/helpers.rb (renamed from actionpack/lib/action_view/helpers.rb)0
-rw-r--r--actionview/lib/action_view/helpers/active_model_helper.rb (renamed from actionpack/lib/action_view/helpers/active_model_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/asset_tag_helper.rb (renamed from actionpack/lib/action_view/helpers/asset_tag_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/asset_url_helper.rb (renamed from actionpack/lib/action_view/helpers/asset_url_helper.rb)2
-rw-r--r--actionview/lib/action_view/helpers/atom_feed_helper.rb (renamed from actionpack/lib/action_view/helpers/atom_feed_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/cache_helper.rb (renamed from actionpack/lib/action_view/helpers/cache_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/capture_helper.rb (renamed from actionpack/lib/action_view/helpers/capture_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/controller_helper.rb (renamed from actionpack/lib/action_view/helpers/controller_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/csrf_helper.rb (renamed from actionpack/lib/action_view/helpers/csrf_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/date_helper.rb (renamed from actionpack/lib/action_view/helpers/date_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/debug_helper.rb (renamed from actionpack/lib/action_view/helpers/debug_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/form_helper.rb (renamed from actionpack/lib/action_view/helpers/form_helper.rb)4
-rw-r--r--actionview/lib/action_view/helpers/form_options_helper.rb (renamed from actionpack/lib/action_view/helpers/form_options_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/form_tag_helper.rb (renamed from actionpack/lib/action_view/helpers/form_tag_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/javascript_helper.rb (renamed from actionpack/lib/action_view/helpers/javascript_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/number_helper.rb (renamed from actionpack/lib/action_view/helpers/number_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/output_safety_helper.rb (renamed from actionpack/lib/action_view/helpers/output_safety_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/record_tag_helper.rb (renamed from actionpack/lib/action_view/helpers/record_tag_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/rendering_helper.rb (renamed from actionpack/lib/action_view/helpers/rendering_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/sanitize_helper.rb (renamed from actionpack/lib/action_view/helpers/sanitize_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tag_helper.rb (renamed from actionpack/lib/action_view/helpers/tag_helper.rb)7
-rw-r--r--actionview/lib/action_view/helpers/tags.rb (renamed from actionpack/lib/action_view/helpers/tags.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/base.rb (renamed from actionpack/lib/action_view/helpers/tags/base.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/check_box.rb (renamed from actionpack/lib/action_view/helpers/tags/check_box.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/checkable.rb (renamed from actionpack/lib/action_view/helpers/tags/checkable.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/collection_check_boxes.rb (renamed from actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/collection_helpers.rb (renamed from actionpack/lib/action_view/helpers/tags/collection_helpers.rb)3
-rw-r--r--actionview/lib/action_view/helpers/tags/collection_radio_buttons.rb (renamed from actionpack/lib/action_view/helpers/tags/collection_radio_buttons.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/collection_select.rb (renamed from actionpack/lib/action_view/helpers/tags/collection_select.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/color_field.rb (renamed from actionpack/lib/action_view/helpers/tags/color_field.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/date_field.rb (renamed from actionpack/lib/action_view/helpers/tags/date_field.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/date_select.rb (renamed from actionpack/lib/action_view/helpers/tags/date_select.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/datetime_field.rb (renamed from actionpack/lib/action_view/helpers/tags/datetime_field.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/datetime_local_field.rb (renamed from actionpack/lib/action_view/helpers/tags/datetime_local_field.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/datetime_select.rb (renamed from actionpack/lib/action_view/helpers/tags/datetime_select.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/email_field.rb (renamed from actionpack/lib/action_view/helpers/tags/email_field.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/file_field.rb (renamed from actionpack/lib/action_view/helpers/tags/file_field.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/grouped_collection_select.rb (renamed from actionpack/lib/action_view/helpers/tags/grouped_collection_select.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/hidden_field.rb (renamed from actionpack/lib/action_view/helpers/tags/hidden_field.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/label.rb (renamed from actionpack/lib/action_view/helpers/tags/label.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/month_field.rb (renamed from actionpack/lib/action_view/helpers/tags/month_field.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/number_field.rb (renamed from actionpack/lib/action_view/helpers/tags/number_field.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/password_field.rb (renamed from actionpack/lib/action_view/helpers/tags/password_field.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/radio_button.rb (renamed from actionpack/lib/action_view/helpers/tags/radio_button.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/range_field.rb (renamed from actionpack/lib/action_view/helpers/tags/range_field.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/search_field.rb (renamed from actionpack/lib/action_view/helpers/tags/search_field.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/select.rb (renamed from actionpack/lib/action_view/helpers/tags/select.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/tel_field.rb (renamed from actionpack/lib/action_view/helpers/tags/tel_field.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/text_area.rb (renamed from actionpack/lib/action_view/helpers/tags/text_area.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/text_field.rb (renamed from actionpack/lib/action_view/helpers/tags/text_field.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/time_field.rb (renamed from actionpack/lib/action_view/helpers/tags/time_field.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/time_select.rb (renamed from actionpack/lib/action_view/helpers/tags/time_select.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/time_zone_select.rb (renamed from actionpack/lib/action_view/helpers/tags/time_zone_select.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/url_field.rb (renamed from actionpack/lib/action_view/helpers/tags/url_field.rb)0
-rw-r--r--actionview/lib/action_view/helpers/tags/week_field.rb (renamed from actionpack/lib/action_view/helpers/tags/week_field.rb)0
-rw-r--r--actionview/lib/action_view/helpers/text_helper.rb (renamed from actionpack/lib/action_view/helpers/text_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/translation_helper.rb (renamed from actionpack/lib/action_view/helpers/translation_helper.rb)0
-rw-r--r--actionview/lib/action_view/helpers/url_helper.rb (renamed from actionpack/lib/action_view/helpers/url_helper.rb)2
-rw-r--r--actionview/lib/action_view/locale/en.yml (renamed from actionpack/lib/action_view/locale/en.yml)0
-rw-r--r--actionview/lib/action_view/log_subscriber.rb (renamed from actionpack/lib/action_view/log_subscriber.rb)0
-rw-r--r--actionview/lib/action_view/lookup_context.rb (renamed from actionpack/lib/action_view/lookup_context.rb)0
-rw-r--r--actionview/lib/action_view/model_naming.rb (renamed from actionpack/lib/action_view/model_naming.rb)0
-rw-r--r--actionview/lib/action_view/path_set.rb (renamed from actionpack/lib/action_view/path_set.rb)0
-rw-r--r--actionview/lib/action_view/railtie.rb (renamed from actionpack/lib/action_view/railtie.rb)0
-rw-r--r--actionview/lib/action_view/record_identifier.rb (renamed from actionpack/lib/action_view/record_identifier.rb)0
-rw-r--r--actionview/lib/action_view/renderer/abstract_renderer.rb (renamed from actionpack/lib/action_view/renderer/abstract_renderer.rb)0
-rw-r--r--actionview/lib/action_view/renderer/partial_renderer.rb (renamed from actionpack/lib/action_view/renderer/partial_renderer.rb)0
-rw-r--r--actionview/lib/action_view/renderer/renderer.rb (renamed from actionpack/lib/action_view/renderer/renderer.rb)0
-rw-r--r--actionview/lib/action_view/renderer/streaming_template_renderer.rb (renamed from actionpack/lib/action_view/renderer/streaming_template_renderer.rb)0
-rw-r--r--actionview/lib/action_view/renderer/template_renderer.rb (renamed from actionpack/lib/action_view/renderer/template_renderer.rb)0
-rw-r--r--actionview/lib/action_view/routing_url_for.rb (renamed from actionpack/lib/action_view/routing_url_for.rb)0
-rw-r--r--actionview/lib/action_view/template.rb (renamed from actionpack/lib/action_view/template.rb)0
-rw-r--r--actionview/lib/action_view/template/error.rb (renamed from actionpack/lib/action_view/template/error.rb)0
-rw-r--r--actionview/lib/action_view/template/handlers.rb (renamed from actionpack/lib/action_view/template/handlers.rb)0
-rw-r--r--actionview/lib/action_view/template/handlers/builder.rb (renamed from actionpack/lib/action_view/template/handlers/builder.rb)0
-rw-r--r--actionview/lib/action_view/template/handlers/erb.rb (renamed from actionpack/lib/action_view/template/handlers/erb.rb)1
-rw-r--r--actionview/lib/action_view/template/handlers/raw.rb (renamed from actionpack/lib/action_view/template/handlers/raw.rb)0
-rw-r--r--actionview/lib/action_view/template/resolver.rb (renamed from actionpack/lib/action_view/template/resolver.rb)0
-rw-r--r--actionview/lib/action_view/template/text.rb (renamed from actionpack/lib/action_view/template/text.rb)0
-rw-r--r--actionview/lib/action_view/template/types.rb (renamed from actionpack/lib/action_view/template/types.rb)0
-rw-r--r--actionview/lib/action_view/test_case.rb (renamed from actionpack/lib/action_view/test_case.rb)0
-rw-r--r--actionview/lib/action_view/testing/resolvers.rb (renamed from actionpack/lib/action_view/testing/resolvers.rb)0
-rw-r--r--actionview/lib/action_view/vendor/html-scanner.rb (renamed from actionpack/lib/action_view/vendor/html-scanner.rb)0
-rw-r--r--actionview/lib/action_view/vendor/html-scanner/html/document.rb (renamed from actionpack/lib/action_view/vendor/html-scanner/html/document.rb)0
-rw-r--r--actionview/lib/action_view/vendor/html-scanner/html/node.rb (renamed from actionpack/lib/action_view/vendor/html-scanner/html/node.rb)0
-rw-r--r--actionview/lib/action_view/vendor/html-scanner/html/sanitizer.rb (renamed from actionpack/lib/action_view/vendor/html-scanner/html/sanitizer.rb)0
-rw-r--r--actionview/lib/action_view/vendor/html-scanner/html/selector.rb (renamed from actionpack/lib/action_view/vendor/html-scanner/html/selector.rb)0
-rw-r--r--actionview/lib/action_view/vendor/html-scanner/html/tokenizer.rb (renamed from actionpack/lib/action_view/vendor/html-scanner/html/tokenizer.rb)0
-rw-r--r--actionview/lib/action_view/vendor/html-scanner/html/version.rb (renamed from actionpack/lib/action_view/vendor/html-scanner/html/version.rb)0
-rw-r--r--actionview/lib/action_view/version.rb11
-rw-r--r--actionview/test/abstract_unit.rb382
-rw-r--r--actionview/test/active_record_unit.rb91
-rw-r--r--actionview/test/activerecord/controller_runtime_test.rb (renamed from actionpack/test/activerecord/controller_runtime_test.rb)0
-rw-r--r--actionview/test/activerecord/form_helper_activerecord_test.rb (renamed from actionpack/test/activerecord/form_helper_activerecord_test.rb)0
-rw-r--r--actionview/test/activerecord/polymorphic_routes_test.rb (renamed from actionpack/test/activerecord/polymorphic_routes_test.rb)0
-rw-r--r--actionview/test/activerecord/render_partial_with_record_identification_test.rb (renamed from actionpack/test/activerecord/render_partial_with_record_identification_test.rb)0
-rw-r--r--actionview/test/fixtures/_top_level_partial.html.erb (renamed from actionpack/test/fixtures/_top_level_partial.html.erb)0
-rw-r--r--actionview/test/fixtures/_top_level_partial_only.erb1
-rw-r--r--actionview/test/fixtures/blog_public/.gitignore (renamed from actionpack/test/fixtures/blog_public/.gitignore)0
-rw-r--r--actionview/test/fixtures/blog_public/blog.html (renamed from actionpack/test/fixtures/blog_public/blog.html)0
-rw-r--r--actionview/test/fixtures/blog_public/index.html (renamed from actionpack/test/fixtures/blog_public/index.html)0
-rw-r--r--actionview/test/fixtures/blog_public/subdir/index.html (renamed from actionpack/test/fixtures/blog_public/subdir/index.html)0
-rw-r--r--actionview/test/fixtures/comments/empty.de.html.erb (renamed from actionpack/test/fixtures/comments/empty.de.html.erb)0
-rw-r--r--actionview/test/fixtures/comments/empty.html.builder (renamed from actionpack/test/fixtures/comments/empty.html.builder)0
-rw-r--r--actionview/test/fixtures/comments/empty.html.erb (renamed from actionpack/test/fixtures/comments/empty.html.erb)0
-rw-r--r--actionview/test/fixtures/comments/empty.xml.erb (renamed from actionpack/test/fixtures/comments/empty.xml.erb)0
-rw-r--r--actionview/test/fixtures/companies.yml (renamed from actionpack/test/fixtures/companies.yml)0
-rw-r--r--actionview/test/fixtures/company.rb9
-rw-r--r--actionview/test/fixtures/custom_pattern/another.html.erb (renamed from actionpack/test/fixtures/custom_pattern/another.html.erb)0
-rw-r--r--actionview/test/fixtures/custom_pattern/html/another.erb (renamed from actionpack/test/fixtures/custom_pattern/html/another.erb)0
-rw-r--r--actionview/test/fixtures/custom_pattern/html/path.erb (renamed from actionpack/test/fixtures/custom_pattern/html/path.erb)0
-rw-r--r--actionview/test/fixtures/customers/_customer.html.erb1
-rw-r--r--actionview/test/fixtures/db_definitions/sqlite.sql (renamed from actionpack/test/fixtures/db_definitions/sqlite.sql)0
-rw-r--r--actionview/test/fixtures/developer.rb (renamed from actionpack/test/fixtures/developer.rb)0
-rw-r--r--actionview/test/fixtures/developers.yml (renamed from actionpack/test/fixtures/developers.yml)0
-rw-r--r--actionview/test/fixtures/developers/_developer.erb (renamed from actionpack/test/fixtures/developers/_developer.erb)0
-rw-r--r--actionview/test/fixtures/developers_projects.yml (renamed from actionpack/test/fixtures/developers_projects.yml)0
-rw-r--r--actionview/test/fixtures/digestor/comments/_comment.html.erb (renamed from actionpack/test/fixtures/digestor/comments/_comment.html.erb)0
-rw-r--r--actionview/test/fixtures/digestor/comments/_comments.html.erb (renamed from actionpack/test/fixtures/digestor/comments/_comments.html.erb)0
-rw-r--r--actionview/test/fixtures/digestor/events/_event.html.erb (renamed from actionpack/test/fixtures/digestor/events/_event.html.erb)0
-rw-r--r--actionview/test/fixtures/digestor/level/below/_header.html.erb (renamed from actionpack/test/fixtures/digestor/level/below/_header.html.erb)0
-rw-r--r--actionview/test/fixtures/digestor/level/below/index.html.erb (renamed from actionpack/test/fixtures/digestor/level/below/index.html.erb)0
-rw-r--r--actionview/test/fixtures/digestor/messages/_form.html.erb (renamed from actionpack/test/fixtures/digestor/messages/_form.html.erb)0
-rw-r--r--actionview/test/fixtures/digestor/messages/_header.html.erb (renamed from actionpack/test/fixtures/digestor/messages/_header.html.erb)0
-rw-r--r--actionview/test/fixtures/digestor/messages/_message.html.erb (renamed from actionpack/test/fixtures/digestor/messages/_message.html.erb)0
-rw-r--r--actionview/test/fixtures/digestor/messages/actions/_move.html.erb (renamed from actionpack/test/fixtures/digestor/messages/actions/_move.html.erb)0
-rw-r--r--actionview/test/fixtures/digestor/messages/edit.html.erb (renamed from actionpack/test/fixtures/digestor/messages/edit.html.erb)0
-rw-r--r--actionview/test/fixtures/digestor/messages/index.html.erb (renamed from actionpack/test/fixtures/digestor/messages/index.html.erb)0
-rw-r--r--actionview/test/fixtures/digestor/messages/show.html.erb (renamed from actionpack/test/fixtures/digestor/messages/show.html.erb)6
-rw-r--r--actionview/test/fixtures/fun/games/_game.erb (renamed from actionpack/test/fixtures/fun/games/_game.erb)0
-rw-r--r--actionview/test/fixtures/fun/games/hello_world.erb1
-rw-r--r--actionview/test/fixtures/fun/serious/games/_game.erb (renamed from actionpack/test/fixtures/fun/serious/games/_game.erb)0
-rw-r--r--actionview/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb3
-rw-r--r--actionview/test/fixtures/games/_game.erb (renamed from actionpack/test/fixtures/games/_game.erb)0
-rw-r--r--actionview/test/fixtures/good_customers/_good_customer.html.erb1
-rw-r--r--actionview/test/fixtures/happy_path/render_action/hello_world.erb (renamed from actionpack/test/fixtures/happy_path/render_action/hello_world.erb)0
-rw-r--r--actionview/test/fixtures/layout_tests/alt/hello.erb (renamed from actionpack/test/fixtures/layout_tests/alt/hello.erb)0
-rw-r--r--actionview/test/fixtures/layouts/_column.html.erb (renamed from actionpack/test/fixtures/layouts/_column.html.erb)0
-rw-r--r--actionview/test/fixtures/layouts/_customers.erb1
-rw-r--r--actionview/test/fixtures/layouts/_partial_and_yield.erb (renamed from actionpack/test/fixtures/layouts/_partial_and_yield.erb)0
-rw-r--r--actionview/test/fixtures/layouts/_yield_only.erb (renamed from actionpack/test/fixtures/layouts/_yield_only.erb)0
-rw-r--r--actionview/test/fixtures/layouts/_yield_with_params.erb (renamed from actionpack/test/fixtures/layouts/_yield_with_params.erb)0
-rw-r--r--actionview/test/fixtures/layouts/streaming.erb (renamed from actionpack/test/fixtures/layouts/streaming.erb)0
-rw-r--r--actionview/test/fixtures/layouts/yield.erb2
-rw-r--r--actionview/test/fixtures/layouts/yield_with_render_inline_inside.erb (renamed from actionpack/test/fixtures/layouts/yield_with_render_inline_inside.erb)0
-rw-r--r--actionview/test/fixtures/layouts/yield_with_render_partial_inside.erb (renamed from actionpack/test/fixtures/layouts/yield_with_render_partial_inside.erb)0
-rw-r--r--actionview/test/fixtures/mascot.rb (renamed from actionpack/test/fixtures/mascot.rb)0
-rw-r--r--actionview/test/fixtures/mascots.yml (renamed from actionpack/test/fixtures/mascots.yml)0
-rw-r--r--actionview/test/fixtures/mascots/_mascot.html.erb (renamed from actionpack/test/fixtures/mascots/_mascot.html.erb)0
-rw-r--r--actionview/test/fixtures/multipart/bracketed_utf8_param5
-rw-r--r--actionview/test/fixtures/multipart/single_utf8_param5
-rw-r--r--actionview/test/fixtures/plain_text.raw (renamed from actionpack/test/fixtures/plain_text.raw)0
-rw-r--r--actionview/test/fixtures/plain_text_with_characters.raw (renamed from actionpack/test/fixtures/plain_text_with_characters.raw)0
-rw-r--r--actionview/test/fixtures/project.rb (renamed from actionpack/test/fixtures/project.rb)0
-rw-r--r--actionview/test/fixtures/projects.yml (renamed from actionpack/test/fixtures/projects.yml)0
-rw-r--r--actionview/test/fixtures/projects/_project.erb (renamed from actionpack/test/fixtures/projects/_project.erb)0
-rw-r--r--actionview/test/fixtures/public/.gitignore (renamed from actionpack/test/fixtures/public/.gitignore)0
-rw-r--r--actionview/test/fixtures/public/elsewhere/cools.js (renamed from actionpack/test/fixtures/public/elsewhere/cools.js)0
-rw-r--r--actionview/test/fixtures/public/elsewhere/file.css (renamed from actionpack/test/fixtures/public/elsewhere/file.css)0
-rw-r--r--actionview/test/fixtures/public/foo/baz.css3
-rw-r--r--actionview/test/fixtures/public/javascripts/application.js (renamed from actionpack/test/fixtures/public/javascripts/application.js)0
-rw-r--r--actionview/test/fixtures/public/javascripts/bank.js (renamed from actionpack/test/fixtures/public/javascripts/bank.js)0
-rw-r--r--actionview/test/fixtures/public/javascripts/common.javascript (renamed from actionpack/test/fixtures/public/javascripts/common.javascript)0
-rw-r--r--actionview/test/fixtures/public/javascripts/controls.js (renamed from actionpack/test/fixtures/public/javascripts/controls.js)0
-rw-r--r--actionview/test/fixtures/public/javascripts/dragdrop.js (renamed from actionpack/test/fixtures/public/javascripts/dragdrop.js)0
-rw-r--r--actionview/test/fixtures/public/javascripts/effects.js (renamed from actionpack/test/fixtures/public/javascripts/effects.js)0
-rw-r--r--actionview/test/fixtures/public/javascripts/prototype.js (renamed from actionpack/test/fixtures/public/javascripts/prototype.js)0
-rw-r--r--actionview/test/fixtures/public/javascripts/robber.js (renamed from actionpack/test/fixtures/public/javascripts/robber.js)0
-rw-r--r--actionview/test/fixtures/public/javascripts/subdir/subdir.js (renamed from actionpack/test/fixtures/public/javascripts/subdir/subdir.js)0
-rw-r--r--actionview/test/fixtures/public/javascripts/version.1.0.js (renamed from actionpack/test/fixtures/public/javascripts/version.1.0.js)0
-rw-r--r--actionview/test/fixtures/public/stylesheets/bank.css (renamed from actionpack/test/fixtures/public/stylesheets/bank.css)0
-rw-r--r--actionview/test/fixtures/public/stylesheets/random.styles (renamed from actionpack/test/fixtures/public/stylesheets/random.styles)0
-rw-r--r--actionview/test/fixtures/public/stylesheets/robber.css (renamed from actionpack/test/fixtures/public/stylesheets/robber.css)0
-rw-r--r--actionview/test/fixtures/public/stylesheets/subdir/subdir.css (renamed from actionpack/test/fixtures/public/stylesheets/subdir/subdir.css)0
-rw-r--r--actionview/test/fixtures/public/stylesheets/version.1.0.css (renamed from actionpack/test/fixtures/public/stylesheets/version.1.0.css)0
-rw-r--r--actionview/test/fixtures/replies.yml (renamed from actionpack/test/fixtures/replies.yml)0
-rw-r--r--actionview/test/fixtures/replies/_reply.erb (renamed from actionpack/test/fixtures/replies/_reply.erb)0
-rw-r--r--actionview/test/fixtures/reply.rb (renamed from actionpack/test/fixtures/reply.rb)0
-rw-r--r--actionview/test/fixtures/respond_to/using_defaults_with_all.html.erb1
-rw-r--r--actionview/test/fixtures/ruby_template.ruby2
-rw-r--r--actionview/test/fixtures/scope/test/modgreet.erb (renamed from actionpack/test/fixtures/scope/test/modgreet.erb)0
-rw-r--r--actionview/test/fixtures/shared.html.erb1
-rw-r--r--actionview/test/fixtures/test/_200.html.erb (renamed from actionpack/test/fixtures/test/_200.html.erb)0
-rw-r--r--actionview/test/fixtures/test/_b_layout_for_partial.html.erb (renamed from actionpack/test/fixtures/test/_b_layout_for_partial.html.erb)0
-rw-r--r--actionview/test/fixtures/test/_b_layout_for_partial_with_object.html.erb (renamed from actionpack/test/fixtures/test/_b_layout_for_partial_with_object.html.erb)0
-rw-r--r--actionview/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb (renamed from actionpack/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb)0
-rw-r--r--actionview/test/fixtures/test/_changing_priority.html.erb1
-rw-r--r--actionview/test/fixtures/test/_changing_priority.json.erb1
-rw-r--r--actionview/test/fixtures/test/_content_tag_nested_in_content_tag.erb (renamed from actionpack/test/fixtures/test/_content_tag_nested_in_content_tag.erb)0
-rw-r--r--actionview/test/fixtures/test/_counter.html.erb1
-rw-r--r--actionview/test/fixtures/test/_customer.erb1
-rw-r--r--actionview/test/fixtures/test/_customer_greeting.erb1
-rw-r--r--actionview/test/fixtures/test/_customer_with_var.erb1
-rw-r--r--actionview/test/fixtures/test/_directory/_partial_with_locales.html.erb1
-rw-r--r--actionview/test/fixtures/test/_first_json_partial.json.erb1
-rw-r--r--actionview/test/fixtures/test/_from_helper.erb (renamed from actionpack/test/fixtures/test/_from_helper.erb)0
-rw-r--r--actionview/test/fixtures/test/_json_change_priority.json.erb0
-rw-r--r--actionview/test/fixtures/test/_label_with_block.erb (renamed from actionpack/test/fixtures/test/_label_with_block.erb)0
-rw-r--r--actionview/test/fixtures/test/_layout_for_block_with_args.html.erb (renamed from actionpack/test/fixtures/test/_layout_for_block_with_args.html.erb)0
-rw-r--r--actionview/test/fixtures/test/_layout_for_partial.html.erb3
-rw-r--r--actionview/test/fixtures/test/_layout_with_partial_and_yield.html.erb (renamed from actionpack/test/fixtures/test/_layout_with_partial_and_yield.html.erb)0
-rw-r--r--actionview/test/fixtures/test/_local_inspector.html.erb (renamed from actionpack/test/fixtures/test/_local_inspector.html.erb)0
-rw-r--r--actionview/test/fixtures/test/_object_inspector.erb (renamed from actionpack/test/fixtures/test/_object_inspector.erb)0
-rw-r--r--actionview/test/fixtures/test/_one.html.erb (renamed from actionpack/test/fixtures/test/_one.html.erb)0
-rw-r--r--actionview/test/fixtures/test/_partial.erb1
-rw-r--r--actionview/test/fixtures/test/_partial.html.erb1
-rw-r--r--actionview/test/fixtures/test/_partial.js.erb1
-rw-r--r--actionview/test/fixtures/test/_partial_for_use_in_layout.html.erb1
-rw-r--r--actionview/test/fixtures/test/_partial_name_local_variable.erb1
-rw-r--r--actionview/test/fixtures/test/_partial_only.erb1
-rw-r--r--actionview/test/fixtures/test/_partial_with_layout.erb (renamed from actionpack/test/fixtures/test/_partial_with_layout.erb)0
-rw-r--r--actionview/test/fixtures/test/_partial_with_layout_block_content.erb (renamed from actionpack/test/fixtures/test/_partial_with_layout_block_content.erb)0
-rw-r--r--actionview/test/fixtures/test/_partial_with_layout_block_partial.erb (renamed from actionpack/test/fixtures/test/_partial_with_layout_block_partial.erb)0
-rw-r--r--actionview/test/fixtures/test/_partial_with_only_html_version.html.erb (renamed from actionpack/test/fixtures/test/_partial_with_only_html_version.html.erb)0
-rw-r--r--actionview/test/fixtures/test/_partial_with_partial.erb2
-rw-r--r--actionview/test/fixtures/test/_raise.html.erb (renamed from actionpack/test/fixtures/test/_raise.html.erb)0
-rw-r--r--actionview/test/fixtures/test/_raise_indentation.html.erb13
-rw-r--r--actionview/test/fixtures/test/_second_json_partial.json.erb1
-rw-r--r--actionview/test/fixtures/test/_two.html.erb (renamed from actionpack/test/fixtures/test/_two.html.erb)0
-rw-r--r--actionview/test/fixtures/test/_utf8_partial.html.erb (renamed from actionpack/test/fixtures/test/_utf8_partial.html.erb)0
-rw-r--r--actionview/test/fixtures/test/_utf8_partial_magic.html.erb (renamed from actionpack/test/fixtures/test/_utf8_partial_magic.html.erb)0
-rw-r--r--actionview/test/fixtures/test/basic.html.erb (renamed from actionpack/test/fixtures/test/basic.html.erb)0
-rw-r--r--actionview/test/fixtures/test/calling_partial_with_layout.html.erb1
-rw-r--r--actionview/test/fixtures/test/change_priority.html.erb2
-rw-r--r--actionview/test/fixtures/test/dont_pick_me (renamed from actionpack/test/fixtures/test/dont_pick_me)0
-rw-r--r--actionview/test/fixtures/test/dot.directory/render_file_with_ivar.erb1
-rw-r--r--actionview/test/fixtures/test/greeting.xml.erb1
-rw-r--r--actionview/test/fixtures/test/hello.builder4
-rw-r--r--actionview/test/fixtures/test/hello/hello.erb1
-rw-r--r--actionview/test/fixtures/test/hello_world.da.html.erb (renamed from actionpack/test/fixtures/test/hello_world.da.html.erb)0
-rw-r--r--actionview/test/fixtures/test/hello_world.erb1
-rw-r--r--actionview/test/fixtures/test/hello_world.erb~ (renamed from actionpack/test/fixtures/test/hello_world.erb~)0
-rw-r--r--actionview/test/fixtures/test/hello_world.pt-BR.html.erb (renamed from actionpack/test/fixtures/test/hello_world.pt-BR.html.erb)0
-rw-r--r--actionview/test/fixtures/test/hello_world_with_partial.html.erb2
-rw-r--r--actionview/test/fixtures/test/html_template.html.erb1
-rw-r--r--actionview/test/fixtures/test/layout_render_file.erb (renamed from actionpack/test/fixtures/test/layout_render_file.erb)0
-rw-r--r--actionview/test/fixtures/test/layout_render_object.erb (renamed from actionpack/test/fixtures/test/layout_render_object.erb)0
-rw-r--r--actionview/test/fixtures/test/list.erb1
-rw-r--r--actionview/test/fixtures/test/malformed/malformed.en.html.erb~ (renamed from actionpack/test/fixtures/test/malformed/malformed.en.html.erb~)0
-rw-r--r--actionview/test/fixtures/test/malformed/malformed.erb~ (renamed from actionpack/test/fixtures/test/malformed/malformed.erb~)0
-rw-r--r--actionview/test/fixtures/test/malformed/malformed.html.erb~ (renamed from actionpack/test/fixtures/test/malformed/malformed.html.erb~)0
-rw-r--r--actionview/test/fixtures/test/malformed/malformed~1
-rw-r--r--actionview/test/fixtures/test/nested_layout.erb (renamed from actionpack/test/fixtures/test/nested_layout.erb)0
-rw-r--r--actionview/test/fixtures/test/nested_streaming.erb (renamed from actionpack/test/fixtures/test/nested_streaming.erb)0
-rw-r--r--actionview/test/fixtures/test/one.html.erb (renamed from actionpack/test/fixtures/test/one.html.erb)0
-rw-r--r--actionview/test/fixtures/test/render_file_with_ivar.erb1
-rw-r--r--actionview/test/fixtures/test/render_file_with_locals.erb1
-rw-r--r--actionview/test/fixtures/test/render_file_with_locals_and_default.erb1
-rw-r--r--actionview/test/fixtures/test/render_partial_inside_directory.html.erb1
-rw-r--r--actionview/test/fixtures/test/render_two_partials.html.erb2
-rw-r--r--actionview/test/fixtures/test/streaming.erb (renamed from actionpack/test/fixtures/test/streaming.erb)0
-rw-r--r--actionview/test/fixtures/test/streaming_buster.erb (renamed from actionpack/test/fixtures/test/streaming_buster.erb)0
-rw-r--r--actionview/test/fixtures/test/sub_template_raise.html.erb (renamed from actionpack/test/fixtures/test/sub_template_raise.html.erb)0
-rw-r--r--actionview/test/fixtures/test/template.erb (renamed from actionpack/test/fixtures/test/template.erb)0
-rw-r--r--actionview/test/fixtures/test/update_element_with_capture.erb (renamed from actionpack/test/fixtures/test/update_element_with_capture.erb)0
-rw-r--r--actionview/test/fixtures/test/utf8.html.erb (renamed from actionpack/test/fixtures/test/utf8.html.erb)0
-rw-r--r--actionview/test/fixtures/test/utf8_magic.html.erb (renamed from actionpack/test/fixtures/test/utf8_magic.html.erb)0
-rw-r--r--actionview/test/fixtures/test/utf8_magic_with_bare_partial.html.erb (renamed from actionpack/test/fixtures/test/utf8_magic_with_bare_partial.html.erb)0
-rw-r--r--actionview/test/fixtures/topic.rb (renamed from actionpack/test/fixtures/topic.rb)0
-rw-r--r--actionview/test/fixtures/topics.yml (renamed from actionpack/test/fixtures/topics.yml)0
-rw-r--r--actionview/test/fixtures/topics/_topic.html.erb (renamed from actionpack/test/fixtures/topics/_topic.html.erb)0
-rw-r--r--actionview/test/fixtures/translations/templates/array.erb (renamed from actionpack/test/fixtures/translations/templates/array.erb)0
-rw-r--r--actionview/test/fixtures/translations/templates/default.erb (renamed from actionpack/test/fixtures/translations/templates/default.erb)0
-rw-r--r--actionview/test/fixtures/translations/templates/found.erb (renamed from actionpack/test/fixtures/translations/templates/found.erb)0
-rw-r--r--actionview/test/fixtures/translations/templates/missing.erb (renamed from actionpack/test/fixtures/translations/templates/missing.erb)0
-rw-r--r--actionview/test/fixtures/with_format.json.erb (renamed from actionpack/test/fixtures/with_format.json.erb)0
-rw-r--r--actionview/test/lib/controller/fake_controllers.rb35
-rw-r--r--actionview/test/lib/controller/fake_models.rb185
-rw-r--r--actionview/test/template/active_model_helper_test.rb (renamed from actionpack/test/template/active_model_helper_test.rb)0
-rw-r--r--actionview/test/template/asset_tag_helper_test.rb (renamed from actionpack/test/template/asset_tag_helper_test.rb)7
-rw-r--r--actionview/test/template/atom_feed_helper_test.rb (renamed from actionpack/test/template/atom_feed_helper_test.rb)0
-rw-r--r--actionview/test/template/capture_helper_test.rb (renamed from actionpack/test/template/capture_helper_test.rb)0
-rw-r--r--actionview/test/template/compiled_templates_test.rb (renamed from actionpack/test/template/compiled_templates_test.rb)1
-rw-r--r--actionview/test/template/date_helper_i18n_test.rb (renamed from actionpack/test/template/date_helper_i18n_test.rb)0
-rw-r--r--actionview/test/template/date_helper_test.rb (renamed from actionpack/test/template/date_helper_test.rb)0
-rw-r--r--actionview/test/template/debug_helper_test.rb (renamed from actionpack/test/template/debug_helper_test.rb)0
-rw-r--r--actionview/test/template/dependency_tracker_test.rb (renamed from actionpack/test/template/dependency_tracker_test.rb)0
-rw-r--r--actionview/test/template/digestor_test.rb (renamed from actionpack/test/template/digestor_test.rb)0
-rw-r--r--actionview/test/template/erb/form_for_test.rb (renamed from actionpack/test/template/erb/form_for_test.rb)0
-rw-r--r--actionview/test/template/erb/helper.rb (renamed from actionpack/test/template/erb/helper.rb)0
-rw-r--r--actionview/test/template/erb/tag_helper_test.rb (renamed from actionpack/test/template/erb/tag_helper_test.rb)0
-rw-r--r--actionview/test/template/erb_util_test.rb (renamed from actionpack/test/template/erb_util_test.rb)0
-rw-r--r--actionview/test/template/form_collections_helper_test.rb (renamed from actionpack/test/template/form_collections_helper_test.rb)16
-rw-r--r--actionview/test/template/form_helper_test.rb (renamed from actionpack/test/template/form_helper_test.rb)0
-rw-r--r--actionview/test/template/form_options_helper_i18n_test.rb (renamed from actionpack/test/template/form_options_helper_i18n_test.rb)0
-rw-r--r--actionview/test/template/form_options_helper_test.rb (renamed from actionpack/test/template/form_options_helper_test.rb)0
-rw-r--r--actionview/test/template/form_tag_helper_test.rb (renamed from actionpack/test/template/form_tag_helper_test.rb)0
-rw-r--r--actionview/test/template/html-scanner/cdata_node_test.rb (renamed from actionpack/test/template/html-scanner/cdata_node_test.rb)0
-rw-r--r--actionview/test/template/html-scanner/document_test.rb (renamed from actionpack/test/template/html-scanner/document_test.rb)0
-rw-r--r--actionview/test/template/html-scanner/node_test.rb (renamed from actionpack/test/template/html-scanner/node_test.rb)0
-rw-r--r--actionview/test/template/html-scanner/sanitizer_test.rb (renamed from actionpack/test/template/html-scanner/sanitizer_test.rb)0
-rw-r--r--actionview/test/template/html-scanner/tag_node_test.rb (renamed from actionpack/test/template/html-scanner/tag_node_test.rb)0
-rw-r--r--actionview/test/template/html-scanner/text_node_test.rb (renamed from actionpack/test/template/html-scanner/text_node_test.rb)0
-rw-r--r--actionview/test/template/html-scanner/tokenizer_test.rb (renamed from actionpack/test/template/html-scanner/tokenizer_test.rb)0
-rw-r--r--actionview/test/template/javascript_helper_test.rb (renamed from actionpack/test/template/javascript_helper_test.rb)0
-rw-r--r--actionview/test/template/log_subscriber_test.rb (renamed from actionpack/test/template/log_subscriber_test.rb)0
-rw-r--r--actionview/test/template/lookup_context_test.rb (renamed from actionpack/test/template/lookup_context_test.rb)0
-rw-r--r--actionview/test/template/number_helper_test.rb (renamed from actionpack/test/template/number_helper_test.rb)0
-rw-r--r--actionview/test/template/output_buffer_test.rb (renamed from actionpack/test/template/output_buffer_test.rb)0
-rw-r--r--actionview/test/template/output_safety_helper_test.rb (renamed from actionpack/test/template/output_safety_helper_test.rb)0
-rw-r--r--actionview/test/template/record_identifier_test.rb (renamed from actionpack/test/template/record_identifier_test.rb)0
-rw-r--r--actionview/test/template/record_tag_helper_test.rb (renamed from actionpack/test/template/record_tag_helper_test.rb)0
-rw-r--r--actionview/test/template/render_test.rb (renamed from actionpack/test/template/render_test.rb)1
-rw-r--r--actionview/test/template/resolver_patterns_test.rb (renamed from actionpack/test/template/resolver_patterns_test.rb)0
-rw-r--r--actionview/test/template/sanitize_helper_test.rb (renamed from actionpack/test/template/sanitize_helper_test.rb)0
-rw-r--r--actionview/test/template/streaming_render_test.rb (renamed from actionpack/test/template/streaming_render_test.rb)1
-rw-r--r--actionview/test/template/tag_helper_test.rb (renamed from actionpack/test/template/tag_helper_test.rb)4
-rw-r--r--actionview/test/template/template_error_test.rb (renamed from actionpack/test/template/template_error_test.rb)0
-rw-r--r--actionview/test/template/template_test.rb (renamed from actionpack/test/template/template_test.rb)0
-rw-r--r--actionview/test/template/test_case_test.rb (renamed from actionpack/test/template/test_case_test.rb)1
-rw-r--r--actionview/test/template/test_test.rb (renamed from actionpack/test/template/test_test.rb)0
-rw-r--r--actionview/test/template/testing/fixture_resolver_test.rb (renamed from actionpack/test/template/testing/fixture_resolver_test.rb)0
-rw-r--r--actionview/test/template/testing/null_resolver_test.rb (renamed from actionpack/test/template/testing/null_resolver_test.rb)0
-rw-r--r--actionview/test/template/text_helper_test.rb (renamed from actionpack/test/template/text_helper_test.rb)0
-rw-r--r--actionview/test/template/translation_helper_test.rb (renamed from actionpack/test/template/translation_helper_test.rb)0
-rw-r--r--actionview/test/template/url_helper_test.rb (renamed from actionpack/test/template/url_helper_test.rb)6
-rw-r--r--activemodel/Rakefile2
-rw-r--r--activemodel/lib/active_model/model.rb2
-rw-r--r--activemodel/test/cases/model_test.rb47
-rw-r--r--activerecord/CHANGELOG.md121
-rw-r--r--activerecord/Rakefile2
-rw-r--r--activerecord/lib/active_record/associations/collection_association.rb2
-rw-r--r--activerecord/lib/active_record/associations/collection_proxy.rb2
-rw-r--r--activerecord/lib/active_record/attribute_methods/serialization.rb6
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb4
-rw-r--r--activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb8
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb2
-rw-r--r--activerecord/lib/active_record/core.rb2
-rw-r--r--activerecord/lib/active_record/fixtures.rb4
-rw-r--r--activerecord/lib/active_record/log_subscriber.rb2
-rw-r--r--activerecord/lib/active_record/railties/databases.rake2
-rw-r--r--activerecord/lib/active_record/relation/finder_methods.rb21
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb2
-rw-r--r--activerecord/test/cases/associations/eager_test.rb3
-rw-r--r--activerecord/test/cases/associations/has_many_associations_test.rb22
-rw-r--r--activerecord/test/cases/associations/inverse_associations_test.rb14
-rw-r--r--activerecord/test/cases/attribute_methods/serialization_test.rb29
-rw-r--r--activerecord/test/cases/connection_pool_test.rb2
-rw-r--r--activerecord/test/cases/defaults_test.rb25
-rw-r--r--activerecord/test/cases/disconnected_test.rb26
-rw-r--r--activerecord/test/cases/fixtures_test.rb16
-rw-r--r--activerecord/test/cases/invalid_connection_test.rb20
-rw-r--r--activerecord/test/cases/log_subscriber_test.rb7
-rw-r--r--activerecord/test/cases/relation_test.rb9
-rw-r--r--activesupport/CHANGELOG.md16
-rw-r--r--activesupport/Rakefile2
-rw-r--r--activesupport/lib/active_support/backtrace_cleaner.rb6
-rw-r--r--activesupport/lib/active_support/dependencies.rb4
-rw-r--r--activesupport/lib/active_support/hash_with_indifferent_access.rb4
-rw-r--r--activesupport/lib/active_support/inflector/methods.rb14
-rw-r--r--activesupport/lib/active_support/testing/declarative.rb9
-rw-r--r--activesupport/lib/active_support/testing/setup_and_teardown.rb19
-rw-r--r--activesupport/test/clean_backtrace_test.rb21
-rw-r--r--activesupport/test/constantize_test_cases.rb8
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb30
-rw-r--r--activesupport/test/xml_mini/jdom_engine_test.rb2
-rw-r--r--activesupport/test/xml_mini/libxml_engine_test.rb3
-rw-r--r--activesupport/test/xml_mini/libxmlsax_engine_test.rb3
-rw-r--r--activesupport/test/xml_mini/nokogiri_engine_test.rb3
-rw-r--r--activesupport/test/xml_mini/nokogirisax_engine_test.rb3
-rw-r--r--activesupport/test/xml_mini/rexml_engine_test.rb3
-rwxr-xr-xci/travis.rb3
-rw-r--r--guides/CHANGELOG.md4
-rw-r--r--guides/source/active_record_querying.md8
-rw-r--r--guides/source/configuring.md6
-rw-r--r--guides/source/getting_started.md7
-rw-r--r--guides/source/i18n.md6
-rw-r--r--guides/source/layout.html.erb10
-rw-r--r--guides/source/migrations.md4
-rw-r--r--rails.gemspec1
-rw-r--r--railties/CHANGELOG.md4
-rw-r--r--railties/Rakefile2
-rw-r--r--railties/lib/rails/application.rb134
-rw-r--r--railties/lib/rails/application/default_middleware_stack.rb101
-rw-r--r--railties/lib/rails/commands.rb2
-rw-r--r--railties/lib/rails/commands/runner.rb2
-rw-r--r--railties/lib/rails/generators/erb/scaffold/templates/index.html.erb4
-rw-r--r--railties/lib/rails/tasks/framework.rake2
-rw-r--r--railties/test/application/asset_debugging_test.rb2
-rw-r--r--railties/test/application/assets_test.rb29
-rw-r--r--railties/test/application/initializers/frameworks_test.rb6
-rw-r--r--railties/test/application/initializers/i18n_test.rb4
-rw-r--r--railties/test/application/initializers/load_path_test.rb6
-rw-r--r--railties/test/application/loading_test.rb2
-rw-r--r--railties/test/application/middleware/cache_test.rb2
-rw-r--r--railties/test/application/middleware_test.rb4
-rw-r--r--railties/test/application/rake_test.rb8
-rw-r--r--railties/test/application/rendering_test.rb2
-rw-r--r--railties/test/isolation/abstract_unit.rb2
-rw-r--r--railties/test/railties/engine_test.rb2
-rw-r--r--railties/test/railties/mounted_engine_test.rb2
415 files changed, 1755 insertions, 319 deletions
diff --git a/.travis.yml b/.travis.yml
index 5214b989af..012e795caa 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,7 +6,7 @@ rvm:
- 2.0.0
env:
- "GEM=railties"
- - "GEM=ap,am,amo,as"
+ - "GEM=ap,am,amo,as,av"
- "GEM=ar:mysql"
- "GEM=ar:mysql2"
- "GEM=ar:sqlite3"
diff --git a/Gemfile b/Gemfile
index b0f91c6dac..13bee8ee5e 100644
--- a/Gemfile
+++ b/Gemfile
@@ -61,7 +61,6 @@ platforms :ruby do
end
platforms :jruby do
- gem 'json'
gem 'activerecord-jdbcsqlite3-adapter', '>= 1.2.7'
group :db do
diff --git a/Rakefile b/Rakefile
index d26e1d3a85..9645788307 100644
--- a/Rakefile
+++ b/Rakefile
@@ -8,7 +8,7 @@ require 'railties/lib/rails/api/task'
desc "Build gem files for all projects"
task :build => "all:build"
-desc "Release all gems to gemcutter and create a tag"
+desc "Release all gems to rubygems and create a tag"
task :release => "all:release"
PROJECTS = %w(activesupport activemodel actionpack actionmailer activerecord railties)
diff --git a/actionmailer/Rakefile b/actionmailer/Rakefile
index d1134ba2b5..457f3b7838 100644
--- a/actionmailer/Rakefile
+++ b/actionmailer/Rakefile
@@ -27,7 +27,7 @@ Gem::PackageTask.new(spec) do |p|
p.gem_spec = spec
end
-desc "Release to gemcutter"
+desc "Release to rubygems"
task release: :package do
require 'rake/gemcutter'
Rake::Gemcutter::Tasks.new(spec).define
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md
index 6f5027dc23..0536d39e42 100644
--- a/actionpack/CHANGELOG.md
+++ b/actionpack/CHANGELOG.md
@@ -1,5 +1,9 @@
-* Fix an issue where partials with a number in the filename weren't being digested for cache dependencies.
+* ActionView extracted from ActionPack
- *Bryan Ricker*
+ *Piotr Sarnacki*, *Łukasz Strzałkowski*
+
+* Fix removing trailing slash for mounted apps #3215
+
+ *Piotr Sarnacki*
Please check [4-0-stable](https://github.com/rails/rails/blob/4-0-stable/actionpack/CHANGELOG.md) for previous changes.
diff --git a/actionpack/Rakefile b/actionpack/Rakefile
index 56fc92963a..f858d10ae8 100644
--- a/actionpack/Rakefile
+++ b/actionpack/Rakefile
@@ -7,14 +7,14 @@ task :default => :test
# Run the unit tests
desc "Run all unit tests"
-task :test => [:test_action_pack, :test_active_record_integration]
+task :test => [:test_action_pack]
Rake::TestTask.new(:test_action_pack) do |t|
t.libs << 'test'
# make sure we include the tests in alphabetical order as on some systems
# this will not happen automatically and the tests (as a whole) will error
- t.test_files = Dir.glob('test/{abstract,controller,dispatch,template,assertions,journey}/**/*_test.rb').sort
+ t.test_files = Dir.glob('test/{abstract,controller,dispatch,assertions,journey}/**/*_test.rb').sort
t.warning = true
t.verbose = true
@@ -23,32 +23,19 @@ end
namespace :test do
task :isolated do
ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
- Dir.glob("test/{abstract,controller,dispatch,template}/**/*_test.rb").all? do |file|
+ Dir.glob("test/{abstract,controller,dispatch}/**/*_test.rb").all? do |file|
sh(ruby, '-Ilib:test', file)
end or raise "Failures"
end
end
-namespace :test do
- Rake::TestTask.new(:template) do |t|
- t.libs << 'test'
- t.pattern = 'test/template/**/*.rb'
- end
-end
-
-desc 'ActiveRecord Integration Tests'
-Rake::TestTask.new(:test_active_record_integration) do |t|
- t.libs << 'test'
- t.test_files = Dir.glob("test/activerecord/*_test.rb")
-end
-
spec = eval(File.read('actionpack.gemspec'))
Gem::PackageTask.new(spec) do |p|
p.gem_spec = spec
end
-desc "Release to gemcutter"
+desc "Release to rubygems"
task :release => :package do
require 'rake/gemcutter'
Rake::Gemcutter::Tasks.new(spec).define
diff --git a/actionpack/actionpack.gemspec b/actionpack/actionpack.gemspec
index cc8351a489..e3aa84ba0f 100644
--- a/actionpack/actionpack.gemspec
+++ b/actionpack/actionpack.gemspec
@@ -20,10 +20,10 @@ Gem::Specification.new do |s|
s.requirements << 'none'
s.add_dependency 'activesupport', version
- s.add_dependency 'builder', '~> 3.1.0'
+ s.add_dependency 'actionview', version
+
s.add_dependency 'rack', '~> 1.5.2'
s.add_dependency 'rack-test', '~> 0.6.2'
- s.add_dependency 'erubis', '~> 2.7.0'
s.add_development_dependency 'activemodel', version
s.add_development_dependency 'tzinfo', '~> 0.3.37'
diff --git a/actionpack/lib/action_controller/metal/responder.rb b/actionpack/lib/action_controller/metal/responder.rb
index 891819968b..fd5b661209 100644
--- a/actionpack/lib/action_controller/metal/responder.rb
+++ b/actionpack/lib/action_controller/metal/responder.rb
@@ -97,8 +97,12 @@ module ActionController #:nodoc:
#
# This will return status 201 if the task was saved successfully. If not,
# it will simply ignore the given options and return status 422 and the
- # resource errors. To customize the failure scenario, you can pass a
- # a block to <code>respond_with</code>:
+ # resource errors. You can also override the location to redirect to:
+ #
+ # respond_with(@project, location: root_path)
+ #
+ # To customize the failure scenario, you can pass a block to
+ # <code>respond_with</code>:
#
# def create
# @project = Project.find(params[:project_id])
diff --git a/actionpack/lib/action_dispatch/journey/router.rb b/actionpack/lib/action_dispatch/journey/router.rb
index 419e665d12..da32f1bfe7 100644
--- a/actionpack/lib/action_dispatch/journey/router.rb
+++ b/actionpack/lib/action_dispatch/journey/router.rb
@@ -54,7 +54,7 @@ module ActionDispatch
end
def call(env)
- env['PATH_INFO'] = Utils.normalize_path(env['PATH_INFO'])
+ env['PATH_INFO'] = normalize_path(env['PATH_INFO'])
find_routes(env).each do |match, parameters, route|
script_name, path_info, set_params = env.values_at('SCRIPT_NAME',
@@ -103,6 +103,12 @@ module ActionDispatch
private
+ def normalize_path(path)
+ path = "/#{path}"
+ path.squeeze!('/')
+ path
+ end
+
def partitioned_routes
routes.partitioned_routes
end
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb
index ca86837a2c..e521c6ce96 100644
--- a/actionpack/test/controller/caching_test.rb
+++ b/actionpack/test/controller/caching_test.rb
@@ -1,6 +1,5 @@
require 'fileutils'
require 'abstract_unit'
-require 'active_record_unit'
CACHE_DIR = 'test_cache'
# Don't change '/../temp/' cavalierly or you might hose something you don't want hosed
diff --git a/actionpack/test/dispatch/mount_test.rb b/actionpack/test/dispatch/mount_test.rb
index e5e28c28be..30e95a0b75 100644
--- a/actionpack/test/dispatch/mount_test.rb
+++ b/actionpack/test/dispatch/mount_test.rb
@@ -33,6 +33,11 @@ class TestRoutingMount < ActionDispatch::IntegrationTest
Router
end
+ def test_trailing_slash_is_not_removed_from_path_info
+ get "/sprockets/omg/"
+ assert_equal "/sprockets -- /omg/", response.body
+ end
+
def test_mounting_sets_script_name
get "/sprockets/omg"
assert_equal "/sprockets -- /omg", response.body
diff --git a/actionview/CHANGELOG.md b/actionview/CHANGELOG.md
new file mode 100644
index 0000000000..135a96621d
--- /dev/null
+++ b/actionview/CHANGELOG.md
@@ -0,0 +1,42 @@
+* Use a case insensitive URI Regexp for #asset_path.
+
+ This fix a problem where the same asset path using different case are generating
+ different URIs.
+
+ Before:
+
+ image_tag("HTTP://google.com")
+ # => "<img alt=\"Google\" src=\"/assets/HTTP://google.com\" />"
+ image_tag("http://google.com")
+ # => "<img alt=\"Google\" src=\"http://google.com\" />"
+
+ After:
+
+ image_tag("HTTP://google.com")
+ # => "<img alt=\"Google\" src=\"HTTP://google.com\" />"
+ image_tag("http://google.com")
+ # => "<img alt=\"Google\" src=\"http://google.com\" />"
+
+ *David Celis*
+
+* Element of the `collection_check_boxes` and `collection_radio_buttons` can
+ optionally contain html attributes as the last element of the array.
+
+ *Vasiliy Ermolovich*
+
+* Update the HTML `BOOLEAN_ATTRIBUTES` in `ActionView::Helpers::TagHelper`
+ to conform to the latest HTML 5.1 spec. Add attributes `allowfullscreen`,
+ `default`, `inert`, `sortable`, `truespeed`, `typemustmatch`. Fix attribute
+ `seamless` (previously misspelled `seemless`).
+
+ *Alex Peattie*
+
+* Fix an issue where partials with a number in the filename weren't being digested for cache dependencies.
+
+ *Bryan Ricker*
+
+* First release, ActionView extracted from ActionPack
+
+ *Piotr Sarnacki*, *Łukasz Strzałkowski*
+
+Please check [4-0-stable (ActionPack's CHANGELOG)](https://github.com/rails/rails/blob/4-0-stable/actionpack/CHANGELOG.md) for previous changes. \ No newline at end of file
diff --git a/actionview/MIT-LICENSE b/actionview/MIT-LICENSE
new file mode 100644
index 0000000000..810daf856c
--- /dev/null
+++ b/actionview/MIT-LICENSE
@@ -0,0 +1,21 @@
+Copyright (c) 2004-2012 David Heinemeier Hansson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/actionview/README.rdoc b/actionview/README.rdoc
new file mode 100644
index 0000000000..09bbfdae0b
--- /dev/null
+++ b/actionview/README.rdoc
@@ -0,0 +1,31 @@
+= Action View
+
+
+
+== Download and installation
+
+The latest version of Action View can be installed with RubyGems:
+
+ % [sudo] gem install actionview
+
+Source code can be downloaded as part of the Rails project on GitHub
+
+* https://github.com/rails/rails/tree/master/actionview
+
+
+== License
+
+Action View is released under the MIT license:
+
+* http://www.opensource.org/licenses/MIT
+
+
+== Support
+
+API documentation is at
+
+* http://api.rubyonrails.org
+
+Bug reports and feature requests can be filed with the rest for the Ruby on Rails project here:
+
+* https://github.com/rails/rails/issues
diff --git a/actionview/RUNNING_UNIT_TESTS b/actionview/RUNNING_UNIT_TESTS
new file mode 100644
index 0000000000..a0c35e1810
--- /dev/null
+++ b/actionview/RUNNING_UNIT_TESTS
@@ -0,0 +1,27 @@
+== Running with Rake
+
+The easiest way to run the unit tests is through Rake. The default task runs
+the entire test suite for all classes. For more information, checkout the
+full array of rake tasks with "rake -T"
+
+Rake can be found at http://rake.rubyforge.org
+
+== Running by hand
+
+To run a single test suite
+
+ rake test TEST=path/to/test.rb
+
+which can be further narrowed down to one test:
+
+ rake test TEST=path/to/test.rb TESTOPTS="--name=test_something"
+
+== Dependency on Active Record and database setup
+
+Test cases in the test/active_record/ directory depend on having
+activerecord and sqlite installed. If Active Record is not in
+actionview/../activerecord directory, or the sqlite rubygem is not installed,
+these tests are skipped.
+
+Other tests are runnable from a fresh copy of actionview without any configuration.
+
diff --git a/actionview/Rakefile b/actionview/Rakefile
new file mode 100644
index 0000000000..7253c761d0
--- /dev/null
+++ b/actionview/Rakefile
@@ -0,0 +1,79 @@
+require 'rake/testtask'
+require 'rake/packagetask'
+require 'rubygems/package_task'
+
+desc "Default Task"
+task :default => :test
+
+# Run the unit tests
+
+desc "Run all unit tests"
+task :test => [:test_action_view, :test_active_record_integration]
+
+Rake::TestTask.new(:test_action_view) do |t|
+ t.libs << 'test'
+
+ # make sure we include the tests in alphabetical order as on some systems
+ # this will not happen automatically and the tests (as a whole) will error
+ t.test_files = Dir.glob('test/template/**/*_test.rb').sort
+
+ t.warning = true
+ t.verbose = true
+end
+
+namespace :test do
+ task :isolated do
+ ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
+ Dir.glob("test/{active_record,template}/**/*_test.rb").all? do |file|
+ sh(ruby, '-Ilib:test', file)
+ end or raise "Failures"
+ end
+
+ Rake::TestTask.new(:template) do |t|
+ t.libs << 'test'
+ t.pattern = 'test/template/**/*.rb'
+ end
+end
+
+desc 'ActiveRecord Integration Tests'
+Rake::TestTask.new(:test_active_record_integration) do |t|
+ t.libs << 'test'
+ t.test_files = Dir.glob("test/activerecord/*_test.rb")
+end
+
+spec = eval(File.read('actionview.gemspec'))
+
+Gem::PackageTask.new(spec) do |p|
+ p.gem_spec = spec
+end
+
+desc "Release to rubygems"
+task :release => :package do
+ require 'rake/gemcutter'
+ Rake::Gemcutter::Tasks.new(spec).define
+ Rake::Task['gem:push'].invoke
+end
+
+task :lines do
+ lines, codelines, total_lines, total_codelines = 0, 0, 0, 0
+
+ FileList["lib/**/*.rb"].each do |file_name|
+ next if file_name =~ /vendor/
+ File.open(file_name, 'r') do |f|
+ while line = f.gets
+ lines += 1
+ next if line =~ /^\s*$/
+ next if line =~ /^\s*#/
+ codelines += 1
+ end
+ end
+ puts "L: #{sprintf("%4d", lines)}, LOC #{sprintf("%4d", codelines)} | #{file_name}"
+
+ total_lines += lines
+ total_codelines += codelines
+
+ lines, codelines = 0, 0
+ end
+
+ puts "Total: Lines #{total_lines}, LOC #{total_codelines}"
+end
diff --git a/actionview/actionview.gemspec b/actionview/actionview.gemspec
new file mode 100644
index 0000000000..87cb568300
--- /dev/null
+++ b/actionview/actionview.gemspec
@@ -0,0 +1,29 @@
+version = File.read(File.expand_path("../../RAILS_VERSION", __FILE__)).strip
+
+Gem::Specification.new do |s|
+ s.platform = Gem::Platform::RUBY
+ s.name = 'actionview'
+ s.version = version
+ s.summary = 'Rendering framework putting the V in MVC (part of Rails).'
+ s.description = ''
+
+ s.required_ruby_version = '>= 1.9.3'
+
+ s.license = 'MIT'
+
+ s.author = 'David Heinemeier Hansson'
+ s.email = 'david@loudthinking.com'
+ s.homepage = 'http://www.rubyonrails.org'
+
+ s.files = Dir['CHANGELOG.md', 'README.rdoc', 'MIT-LICENSE', 'lib/**/*']
+ s.require_path = 'lib'
+ s.requirements << 'none'
+
+ s.add_dependency 'activesupport', version
+ s.add_dependency 'activemodel', version
+
+ s.add_dependency 'builder', '~> 3.1.0'
+ s.add_dependency 'erubis', '~> 2.7.0'
+
+ s.add_development_dependency 'actionpack', version
+end
diff --git a/actionpack/lib/action_view.rb b/actionview/lib/action_view.rb
index 4aafbcb655..8def4ba7c5 100644
--- a/actionpack/lib/action_view.rb
+++ b/actionview/lib/action_view.rb
@@ -23,7 +23,6 @@
require 'active_support'
require 'active_support/rails'
-require 'action_pack'
module ActionView
extend ActiveSupport::Autoload
diff --git a/actionpack/lib/action_view/base.rb b/actionview/lib/action_view/base.rb
index 08253de3f4..08253de3f4 100644
--- a/actionpack/lib/action_view/base.rb
+++ b/actionview/lib/action_view/base.rb
diff --git a/actionpack/lib/action_view/buffers.rb b/actionview/lib/action_view/buffers.rb
index 361a0dccbe..361a0dccbe 100644
--- a/actionpack/lib/action_view/buffers.rb
+++ b/actionview/lib/action_view/buffers.rb
diff --git a/actionpack/lib/action_view/context.rb b/actionview/lib/action_view/context.rb
index ee263df484..ee263df484 100644
--- a/actionpack/lib/action_view/context.rb
+++ b/actionview/lib/action_view/context.rb
diff --git a/actionpack/lib/action_view/dependency_tracker.rb b/actionview/lib/action_view/dependency_tracker.rb
index b2e8334077..b2e8334077 100644
--- a/actionpack/lib/action_view/dependency_tracker.rb
+++ b/actionview/lib/action_view/dependency_tracker.rb
diff --git a/actionpack/lib/action_view/digestor.rb b/actionview/lib/action_view/digestor.rb
index 9324a1ac50..9324a1ac50 100644
--- a/actionpack/lib/action_view/digestor.rb
+++ b/actionview/lib/action_view/digestor.rb
diff --git a/actionpack/lib/action_view/flows.rb b/actionview/lib/action_view/flows.rb
index c0e458cd41..c0e458cd41 100644
--- a/actionpack/lib/action_view/flows.rb
+++ b/actionview/lib/action_view/flows.rb
diff --git a/actionpack/lib/action_view/helpers.rb b/actionview/lib/action_view/helpers.rb
index 8a78685ae1..8a78685ae1 100644
--- a/actionpack/lib/action_view/helpers.rb
+++ b/actionview/lib/action_view/helpers.rb
diff --git a/actionpack/lib/action_view/helpers/active_model_helper.rb b/actionview/lib/action_view/helpers/active_model_helper.rb
index 901f433c70..901f433c70 100644
--- a/actionpack/lib/action_view/helpers/active_model_helper.rb
+++ b/actionview/lib/action_view/helpers/active_model_helper.rb
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionview/lib/action_view/helpers/asset_tag_helper.rb
index 2b3a3c6a29..2b3a3c6a29 100644
--- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb
+++ b/actionview/lib/action_view/helpers/asset_tag_helper.rb
diff --git a/actionpack/lib/action_view/helpers/asset_url_helper.rb b/actionview/lib/action_view/helpers/asset_url_helper.rb
index b5f2df76ab..0b957adb91 100644
--- a/actionpack/lib/action_view/helpers/asset_url_helper.rb
+++ b/actionview/lib/action_view/helpers/asset_url_helper.rb
@@ -105,7 +105,7 @@ module ActionView
# )
#
module AssetUrlHelper
- URI_REGEXP = %r{^[-a-z]+://|^(?:cid|data):|^//}
+ URI_REGEXP = %r{^[-a-z]+://|^(?:cid|data):|^//}i
# Computes the path to asset in public directory. If :type
# options is set, a file extension will be appended and scoped
diff --git a/actionpack/lib/action_view/helpers/atom_feed_helper.rb b/actionview/lib/action_view/helpers/atom_feed_helper.rb
index 42b1dd8933..42b1dd8933 100644
--- a/actionpack/lib/action_view/helpers/atom_feed_helper.rb
+++ b/actionview/lib/action_view/helpers/atom_feed_helper.rb
diff --git a/actionpack/lib/action_view/helpers/cache_helper.rb b/actionview/lib/action_view/helpers/cache_helper.rb
index 8fc78ea7fb..8fc78ea7fb 100644
--- a/actionpack/lib/action_view/helpers/cache_helper.rb
+++ b/actionview/lib/action_view/helpers/cache_helper.rb
diff --git a/actionpack/lib/action_view/helpers/capture_helper.rb b/actionview/lib/action_view/helpers/capture_helper.rb
index 5afe435459..5afe435459 100644
--- a/actionpack/lib/action_view/helpers/capture_helper.rb
+++ b/actionview/lib/action_view/helpers/capture_helper.rb
diff --git a/actionpack/lib/action_view/helpers/controller_helper.rb b/actionview/lib/action_view/helpers/controller_helper.rb
index 74ef25f7c1..74ef25f7c1 100644
--- a/actionpack/lib/action_view/helpers/controller_helper.rb
+++ b/actionview/lib/action_view/helpers/controller_helper.rb
diff --git a/actionpack/lib/action_view/helpers/csrf_helper.rb b/actionview/lib/action_view/helpers/csrf_helper.rb
index eeb0ed94b9..eeb0ed94b9 100644
--- a/actionpack/lib/action_view/helpers/csrf_helper.rb
+++ b/actionview/lib/action_view/helpers/csrf_helper.rb
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionview/lib/action_view/helpers/date_helper.rb
index 8fb5eb1548..8fb5eb1548 100644
--- a/actionpack/lib/action_view/helpers/date_helper.rb
+++ b/actionview/lib/action_view/helpers/date_helper.rb
diff --git a/actionpack/lib/action_view/helpers/debug_helper.rb b/actionview/lib/action_view/helpers/debug_helper.rb
index c29c1b1eea..c29c1b1eea 100644
--- a/actionpack/lib/action_view/helpers/debug_helper.rb
+++ b/actionview/lib/action_view/helpers/debug_helper.rb
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb
index 36dedf0676..f64c0ca30b 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionview/lib/action_view/helpers/form_helper.rb
@@ -692,7 +692,7 @@ module ActionView
#
# Note that fields_for will automatically generate a hidden field
# to store the ID of the record. There are circumstances where this
- # hidden field is not needed and you can pass <tt>hidden_field_id: false</tt>
+ # hidden field is not needed and you can pass <tt>include_id: false</tt>
# to prevent fields_for from rendering it automatically.
def fields_for(record_name, record_object = nil, options = {}, &block)
builder = instantiate_builder(record_name, record_object, options)
@@ -1507,7 +1507,7 @@ module ActionView
#
# Note that fields_for will automatically generate a hidden field
# to store the ID of the record. There are circumstances where this
- # hidden field is not needed and you can pass <tt>hidden_field_id: false</tt>
+ # hidden field is not needed and you can pass <tt>include_id: false</tt>
# to prevent fields_for from rendering it automatically.
def fields_for(record_name, record_object = nil, fields_options = {}, &block)
fields_options, record_object = record_object, nil if record_object.is_a?(Hash) && record_object.extractable_options?
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionview/lib/action_view/helpers/form_options_helper.rb
index ad26505086..ad26505086 100644
--- a/actionpack/lib/action_view/helpers/form_options_helper.rb
+++ b/actionview/lib/action_view/helpers/form_options_helper.rb
diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb
index 3fa7696b83..3fa7696b83 100644
--- a/actionpack/lib/action_view/helpers/form_tag_helper.rb
+++ b/actionview/lib/action_view/helpers/form_tag_helper.rb
diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionview/lib/action_view/helpers/javascript_helper.rb
index e475d5b018..e475d5b018 100644
--- a/actionpack/lib/action_view/helpers/javascript_helper.rb
+++ b/actionview/lib/action_view/helpers/javascript_helper.rb
diff --git a/actionpack/lib/action_view/helpers/number_helper.rb b/actionview/lib/action_view/helpers/number_helper.rb
index fda7038a5d..fda7038a5d 100644
--- a/actionpack/lib/action_view/helpers/number_helper.rb
+++ b/actionview/lib/action_view/helpers/number_helper.rb
diff --git a/actionpack/lib/action_view/helpers/output_safety_helper.rb b/actionview/lib/action_view/helpers/output_safety_helper.rb
index 60a4478c26..60a4478c26 100644
--- a/actionpack/lib/action_view/helpers/output_safety_helper.rb
+++ b/actionview/lib/action_view/helpers/output_safety_helper.rb
diff --git a/actionpack/lib/action_view/helpers/record_tag_helper.rb b/actionview/lib/action_view/helpers/record_tag_helper.rb
index f767957fa9..f767957fa9 100644
--- a/actionpack/lib/action_view/helpers/record_tag_helper.rb
+++ b/actionview/lib/action_view/helpers/record_tag_helper.rb
diff --git a/actionpack/lib/action_view/helpers/rendering_helper.rb b/actionview/lib/action_view/helpers/rendering_helper.rb
index 458086de96..458086de96 100644
--- a/actionpack/lib/action_view/helpers/rendering_helper.rb
+++ b/actionview/lib/action_view/helpers/rendering_helper.rb
diff --git a/actionpack/lib/action_view/helpers/sanitize_helper.rb b/actionview/lib/action_view/helpers/sanitize_helper.rb
index e5cb843670..e5cb843670 100644
--- a/actionpack/lib/action_view/helpers/sanitize_helper.rb
+++ b/actionview/lib/action_view/helpers/sanitize_helper.rb
diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionview/lib/action_view/helpers/tag_helper.rb
index 3939e4737b..732f35643a 100644
--- a/actionpack/lib/action_view/helpers/tag_helper.rb
+++ b/actionview/lib/action_view/helpers/tag_helper.rb
@@ -12,8 +12,11 @@ module ActionView
BOOLEAN_ATTRIBUTES = %w(disabled readonly multiple checked autobuffer
autoplay controls loop selected hidden scoped async
- defer reversed ismap seemless muted required
- autofocus novalidate formnovalidate open pubdate itemscope).to_set
+ defer reversed ismap seamless muted required
+ autofocus novalidate formnovalidate open pubdate
+ itemscope allowfullscreen default inert sortable
+ truespeed typemustmatch).to_set
+
BOOLEAN_ATTRIBUTES.merge(BOOLEAN_ATTRIBUTES.map {|attribute| attribute.to_sym })
PRE_CONTENT_STRINGS = {
diff --git a/actionpack/lib/action_view/helpers/tags.rb b/actionview/lib/action_view/helpers/tags.rb
index a05e16979a..a05e16979a 100644
--- a/actionpack/lib/action_view/helpers/tags.rb
+++ b/actionview/lib/action_view/helpers/tags.rb
diff --git a/actionpack/lib/action_view/helpers/tags/base.rb b/actionview/lib/action_view/helpers/tags/base.rb
index 3fe3f4e9df..3fe3f4e9df 100644
--- a/actionpack/lib/action_view/helpers/tags/base.rb
+++ b/actionview/lib/action_view/helpers/tags/base.rb
diff --git a/actionpack/lib/action_view/helpers/tags/check_box.rb b/actionview/lib/action_view/helpers/tags/check_box.rb
index 6d51f2629a..6d51f2629a 100644
--- a/actionpack/lib/action_view/helpers/tags/check_box.rb
+++ b/actionview/lib/action_view/helpers/tags/check_box.rb
diff --git a/actionpack/lib/action_view/helpers/tags/checkable.rb b/actionview/lib/action_view/helpers/tags/checkable.rb
index 052e9df662..052e9df662 100644
--- a/actionpack/lib/action_view/helpers/tags/checkable.rb
+++ b/actionview/lib/action_view/helpers/tags/checkable.rb
diff --git a/actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb b/actionview/lib/action_view/helpers/tags/collection_check_boxes.rb
index 52006d856b..52006d856b 100644
--- a/actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb
+++ b/actionview/lib/action_view/helpers/tags/collection_check_boxes.rb
diff --git a/actionpack/lib/action_view/helpers/tags/collection_helpers.rb b/actionview/lib/action_view/helpers/tags/collection_helpers.rb
index cd12ddaf65..388dcf1f13 100644
--- a/actionpack/lib/action_view/helpers/tags/collection_helpers.rb
+++ b/actionview/lib/action_view/helpers/tags/collection_helpers.rb
@@ -73,8 +73,9 @@ module ActionView
value = value_for_collection(item, @value_method)
text = value_for_collection(item, @text_method)
default_html_options = default_html_options_for_collection(item, value)
+ additional_html_options = option_html_attributes(item)
- yield item, value, text, default_html_options
+ yield item, value, text, default_html_options.merge(additional_html_options)
end.join.html_safe
end
end
diff --git a/actionpack/lib/action_view/helpers/tags/collection_radio_buttons.rb b/actionview/lib/action_view/helpers/tags/collection_radio_buttons.rb
index 20be34c1f2..20be34c1f2 100644
--- a/actionpack/lib/action_view/helpers/tags/collection_radio_buttons.rb
+++ b/actionview/lib/action_view/helpers/tags/collection_radio_buttons.rb
diff --git a/actionpack/lib/action_view/helpers/tags/collection_select.rb b/actionview/lib/action_view/helpers/tags/collection_select.rb
index 6cb2b2e0d3..6cb2b2e0d3 100644
--- a/actionpack/lib/action_view/helpers/tags/collection_select.rb
+++ b/actionview/lib/action_view/helpers/tags/collection_select.rb
diff --git a/actionpack/lib/action_view/helpers/tags/color_field.rb b/actionview/lib/action_view/helpers/tags/color_field.rb
index d8fc797035..d8fc797035 100644
--- a/actionpack/lib/action_view/helpers/tags/color_field.rb
+++ b/actionview/lib/action_view/helpers/tags/color_field.rb
diff --git a/actionpack/lib/action_view/helpers/tags/date_field.rb b/actionview/lib/action_view/helpers/tags/date_field.rb
index c22be0db29..c22be0db29 100644
--- a/actionpack/lib/action_view/helpers/tags/date_field.rb
+++ b/actionview/lib/action_view/helpers/tags/date_field.rb
diff --git a/actionpack/lib/action_view/helpers/tags/date_select.rb b/actionview/lib/action_view/helpers/tags/date_select.rb
index 0c4ac40070..0c4ac40070 100644
--- a/actionpack/lib/action_view/helpers/tags/date_select.rb
+++ b/actionview/lib/action_view/helpers/tags/date_select.rb
diff --git a/actionpack/lib/action_view/helpers/tags/datetime_field.rb b/actionview/lib/action_view/helpers/tags/datetime_field.rb
index 9a2279c611..9a2279c611 100644
--- a/actionpack/lib/action_view/helpers/tags/datetime_field.rb
+++ b/actionview/lib/action_view/helpers/tags/datetime_field.rb
diff --git a/actionpack/lib/action_view/helpers/tags/datetime_local_field.rb b/actionview/lib/action_view/helpers/tags/datetime_local_field.rb
index b4a74185d1..b4a74185d1 100644
--- a/actionpack/lib/action_view/helpers/tags/datetime_local_field.rb
+++ b/actionview/lib/action_view/helpers/tags/datetime_local_field.rb
diff --git a/actionpack/lib/action_view/helpers/tags/datetime_select.rb b/actionview/lib/action_view/helpers/tags/datetime_select.rb
index 563de1840e..563de1840e 100644
--- a/actionpack/lib/action_view/helpers/tags/datetime_select.rb
+++ b/actionview/lib/action_view/helpers/tags/datetime_select.rb
diff --git a/actionpack/lib/action_view/helpers/tags/email_field.rb b/actionview/lib/action_view/helpers/tags/email_field.rb
index 7ce3ccb9bf..7ce3ccb9bf 100644
--- a/actionpack/lib/action_view/helpers/tags/email_field.rb
+++ b/actionview/lib/action_view/helpers/tags/email_field.rb
diff --git a/actionpack/lib/action_view/helpers/tags/file_field.rb b/actionview/lib/action_view/helpers/tags/file_field.rb
index 476b820d84..476b820d84 100644
--- a/actionpack/lib/action_view/helpers/tags/file_field.rb
+++ b/actionview/lib/action_view/helpers/tags/file_field.rb
diff --git a/actionpack/lib/action_view/helpers/tags/grouped_collection_select.rb b/actionview/lib/action_view/helpers/tags/grouped_collection_select.rb
index 2ed4712dac..2ed4712dac 100644
--- a/actionpack/lib/action_view/helpers/tags/grouped_collection_select.rb
+++ b/actionview/lib/action_view/helpers/tags/grouped_collection_select.rb
diff --git a/actionpack/lib/action_view/helpers/tags/hidden_field.rb b/actionview/lib/action_view/helpers/tags/hidden_field.rb
index c3757c2461..c3757c2461 100644
--- a/actionpack/lib/action_view/helpers/tags/hidden_field.rb
+++ b/actionview/lib/action_view/helpers/tags/hidden_field.rb
diff --git a/actionpack/lib/action_view/helpers/tags/label.rb b/actionview/lib/action_view/helpers/tags/label.rb
index 35d3ba8434..35d3ba8434 100644
--- a/actionpack/lib/action_view/helpers/tags/label.rb
+++ b/actionview/lib/action_view/helpers/tags/label.rb
diff --git a/actionpack/lib/action_view/helpers/tags/month_field.rb b/actionview/lib/action_view/helpers/tags/month_field.rb
index 4c0fb846ee..4c0fb846ee 100644
--- a/actionpack/lib/action_view/helpers/tags/month_field.rb
+++ b/actionview/lib/action_view/helpers/tags/month_field.rb
diff --git a/actionpack/lib/action_view/helpers/tags/number_field.rb b/actionview/lib/action_view/helpers/tags/number_field.rb
index 4f95b1b4de..4f95b1b4de 100644
--- a/actionpack/lib/action_view/helpers/tags/number_field.rb
+++ b/actionview/lib/action_view/helpers/tags/number_field.rb
diff --git a/actionpack/lib/action_view/helpers/tags/password_field.rb b/actionview/lib/action_view/helpers/tags/password_field.rb
index 6099fa6f19..6099fa6f19 100644
--- a/actionpack/lib/action_view/helpers/tags/password_field.rb
+++ b/actionview/lib/action_view/helpers/tags/password_field.rb
diff --git a/actionpack/lib/action_view/helpers/tags/radio_button.rb b/actionview/lib/action_view/helpers/tags/radio_button.rb
index 4849c537a5..4849c537a5 100644
--- a/actionpack/lib/action_view/helpers/tags/radio_button.rb
+++ b/actionview/lib/action_view/helpers/tags/radio_button.rb
diff --git a/actionpack/lib/action_view/helpers/tags/range_field.rb b/actionview/lib/action_view/helpers/tags/range_field.rb
index f98ae88043..f98ae88043 100644
--- a/actionpack/lib/action_view/helpers/tags/range_field.rb
+++ b/actionview/lib/action_view/helpers/tags/range_field.rb
diff --git a/actionpack/lib/action_view/helpers/tags/search_field.rb b/actionview/lib/action_view/helpers/tags/search_field.rb
index c09e2f1be7..c09e2f1be7 100644
--- a/actionpack/lib/action_view/helpers/tags/search_field.rb
+++ b/actionview/lib/action_view/helpers/tags/search_field.rb
diff --git a/actionpack/lib/action_view/helpers/tags/select.rb b/actionview/lib/action_view/helpers/tags/select.rb
index d64e2f68ef..d64e2f68ef 100644
--- a/actionpack/lib/action_view/helpers/tags/select.rb
+++ b/actionview/lib/action_view/helpers/tags/select.rb
diff --git a/actionpack/lib/action_view/helpers/tags/tel_field.rb b/actionview/lib/action_view/helpers/tags/tel_field.rb
index 987bb9e67a..987bb9e67a 100644
--- a/actionpack/lib/action_view/helpers/tags/tel_field.rb
+++ b/actionview/lib/action_view/helpers/tags/tel_field.rb
diff --git a/actionpack/lib/action_view/helpers/tags/text_area.rb b/actionview/lib/action_view/helpers/tags/text_area.rb
index c81156c0c8..c81156c0c8 100644
--- a/actionpack/lib/action_view/helpers/tags/text_area.rb
+++ b/actionview/lib/action_view/helpers/tags/text_area.rb
diff --git a/actionpack/lib/action_view/helpers/tags/text_field.rb b/actionview/lib/action_view/helpers/tags/text_field.rb
index baa5ff768e..baa5ff768e 100644
--- a/actionpack/lib/action_view/helpers/tags/text_field.rb
+++ b/actionview/lib/action_view/helpers/tags/text_field.rb
diff --git a/actionpack/lib/action_view/helpers/tags/time_field.rb b/actionview/lib/action_view/helpers/tags/time_field.rb
index 0e90a3aed7..0e90a3aed7 100644
--- a/actionpack/lib/action_view/helpers/tags/time_field.rb
+++ b/actionview/lib/action_view/helpers/tags/time_field.rb
diff --git a/actionpack/lib/action_view/helpers/tags/time_select.rb b/actionview/lib/action_view/helpers/tags/time_select.rb
index 0b06311d25..0b06311d25 100644
--- a/actionpack/lib/action_view/helpers/tags/time_select.rb
+++ b/actionview/lib/action_view/helpers/tags/time_select.rb
diff --git a/actionpack/lib/action_view/helpers/tags/time_zone_select.rb b/actionview/lib/action_view/helpers/tags/time_zone_select.rb
index 80d165ec7e..80d165ec7e 100644
--- a/actionpack/lib/action_view/helpers/tags/time_zone_select.rb
+++ b/actionview/lib/action_view/helpers/tags/time_zone_select.rb
diff --git a/actionpack/lib/action_view/helpers/tags/url_field.rb b/actionview/lib/action_view/helpers/tags/url_field.rb
index d76340178d..d76340178d 100644
--- a/actionpack/lib/action_view/helpers/tags/url_field.rb
+++ b/actionview/lib/action_view/helpers/tags/url_field.rb
diff --git a/actionpack/lib/action_view/helpers/tags/week_field.rb b/actionview/lib/action_view/helpers/tags/week_field.rb
index 5b3d0494e9..5b3d0494e9 100644
--- a/actionpack/lib/action_view/helpers/tags/week_field.rb
+++ b/actionview/lib/action_view/helpers/tags/week_field.rb
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionview/lib/action_view/helpers/text_helper.rb
index 147f9fd8ed..147f9fd8ed 100644
--- a/actionpack/lib/action_view/helpers/text_helper.rb
+++ b/actionview/lib/action_view/helpers/text_helper.rb
diff --git a/actionpack/lib/action_view/helpers/translation_helper.rb b/actionview/lib/action_view/helpers/translation_helper.rb
index ad8eb47f1f..ad8eb47f1f 100644
--- a/actionpack/lib/action_view/helpers/translation_helper.rb
+++ b/actionview/lib/action_view/helpers/translation_helper.rb
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionview/lib/action_view/helpers/url_helper.rb
index 8a83f6f356..19e5941971 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionview/lib/action_view/helpers/url_helper.rb
@@ -380,7 +380,7 @@ module ActionView
if block_given?
block.arity <= 1 ? capture(name, &block) : capture(name, options, html_options, &block)
else
- name
+ ERB::Util.html_escape(name)
end
else
link_to(name, options, html_options)
diff --git a/actionpack/lib/action_view/locale/en.yml b/actionview/lib/action_view/locale/en.yml
index 8a56f147b8..8a56f147b8 100644
--- a/actionpack/lib/action_view/locale/en.yml
+++ b/actionview/lib/action_view/locale/en.yml
diff --git a/actionpack/lib/action_view/log_subscriber.rb b/actionview/lib/action_view/log_subscriber.rb
index fd9a543e0a..fd9a543e0a 100644
--- a/actionpack/lib/action_view/log_subscriber.rb
+++ b/actionview/lib/action_view/log_subscriber.rb
diff --git a/actionpack/lib/action_view/lookup_context.rb b/actionview/lib/action_view/lookup_context.rb
index f9d5b97fe3..f9d5b97fe3 100644
--- a/actionpack/lib/action_view/lookup_context.rb
+++ b/actionview/lib/action_view/lookup_context.rb
diff --git a/actionpack/lib/action_view/model_naming.rb b/actionview/lib/action_view/model_naming.rb
index e09ebd60df..e09ebd60df 100644
--- a/actionpack/lib/action_view/model_naming.rb
+++ b/actionview/lib/action_view/model_naming.rb
diff --git a/actionpack/lib/action_view/path_set.rb b/actionview/lib/action_view/path_set.rb
index 91ee2ea8f5..91ee2ea8f5 100644
--- a/actionpack/lib/action_view/path_set.rb
+++ b/actionview/lib/action_view/path_set.rb
diff --git a/actionpack/lib/action_view/railtie.rb b/actionview/lib/action_view/railtie.rb
index e80e0ed9b0..e80e0ed9b0 100644
--- a/actionpack/lib/action_view/railtie.rb
+++ b/actionview/lib/action_view/railtie.rb
diff --git a/actionpack/lib/action_view/record_identifier.rb b/actionview/lib/action_view/record_identifier.rb
index 63f645431a..63f645431a 100644
--- a/actionpack/lib/action_view/record_identifier.rb
+++ b/actionview/lib/action_view/record_identifier.rb
diff --git a/actionpack/lib/action_view/renderer/abstract_renderer.rb b/actionview/lib/action_view/renderer/abstract_renderer.rb
index 73c19a0ae2..73c19a0ae2 100644
--- a/actionpack/lib/action_view/renderer/abstract_renderer.rb
+++ b/actionview/lib/action_view/renderer/abstract_renderer.rb
diff --git a/actionpack/lib/action_view/renderer/partial_renderer.rb b/actionview/lib/action_view/renderer/partial_renderer.rb
index 821026268a..821026268a 100644
--- a/actionpack/lib/action_view/renderer/partial_renderer.rb
+++ b/actionview/lib/action_view/renderer/partial_renderer.rb
diff --git a/actionpack/lib/action_view/renderer/renderer.rb b/actionview/lib/action_view/renderer/renderer.rb
index 964b18337e..964b18337e 100644
--- a/actionpack/lib/action_view/renderer/renderer.rb
+++ b/actionview/lib/action_view/renderer/renderer.rb
diff --git a/actionpack/lib/action_view/renderer/streaming_template_renderer.rb b/actionview/lib/action_view/renderer/streaming_template_renderer.rb
index 9cf6eb0c65..9cf6eb0c65 100644
--- a/actionpack/lib/action_view/renderer/streaming_template_renderer.rb
+++ b/actionview/lib/action_view/renderer/streaming_template_renderer.rb
diff --git a/actionpack/lib/action_view/renderer/template_renderer.rb b/actionview/lib/action_view/renderer/template_renderer.rb
index 4d5c5db80c..4d5c5db80c 100644
--- a/actionpack/lib/action_view/renderer/template_renderer.rb
+++ b/actionview/lib/action_view/renderer/template_renderer.rb
diff --git a/actionpack/lib/action_view/routing_url_for.rb b/actionview/lib/action_view/routing_url_for.rb
index f10e7e88ba..f10e7e88ba 100644
--- a/actionpack/lib/action_view/routing_url_for.rb
+++ b/actionview/lib/action_view/routing_url_for.rb
diff --git a/actionpack/lib/action_view/template.rb b/actionview/lib/action_view/template.rb
index e2c50fec47..e2c50fec47 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionview/lib/action_view/template.rb
diff --git a/actionpack/lib/action_view/template/error.rb b/actionview/lib/action_view/template/error.rb
index a89d51221e..a89d51221e 100644
--- a/actionpack/lib/action_view/template/error.rb
+++ b/actionview/lib/action_view/template/error.rb
diff --git a/actionpack/lib/action_view/template/handlers.rb b/actionview/lib/action_view/template/handlers.rb
index d9cddc0040..d9cddc0040 100644
--- a/actionpack/lib/action_view/template/handlers.rb
+++ b/actionview/lib/action_view/template/handlers.rb
diff --git a/actionpack/lib/action_view/template/handlers/builder.rb b/actionview/lib/action_view/template/handlers/builder.rb
index d90b0c6378..d90b0c6378 100644
--- a/actionpack/lib/action_view/template/handlers/builder.rb
+++ b/actionview/lib/action_view/template/handlers/builder.rb
diff --git a/actionpack/lib/action_view/template/handlers/erb.rb b/actionview/lib/action_view/template/handlers/erb.rb
index 7d7a7af51d..c8a0059596 100644
--- a/actionpack/lib/action_view/template/handlers/erb.rb
+++ b/actionview/lib/action_view/template/handlers/erb.rb
@@ -1,4 +1,3 @@
-require 'action_dispatch/http/mime_type'
require 'erubis'
module ActionView
diff --git a/actionpack/lib/action_view/template/handlers/raw.rb b/actionview/lib/action_view/template/handlers/raw.rb
index 0c0d1fffcb..0c0d1fffcb 100644
--- a/actionpack/lib/action_view/template/handlers/raw.rb
+++ b/actionview/lib/action_view/template/handlers/raw.rb
diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionview/lib/action_view/template/resolver.rb
index 3304605c1a..3304605c1a 100644
--- a/actionpack/lib/action_view/template/resolver.rb
+++ b/actionview/lib/action_view/template/resolver.rb
diff --git a/actionpack/lib/action_view/template/text.rb b/actionview/lib/action_view/template/text.rb
index 859c7bc3ce..859c7bc3ce 100644
--- a/actionpack/lib/action_view/template/text.rb
+++ b/actionview/lib/action_view/template/text.rb
diff --git a/actionpack/lib/action_view/template/types.rb b/actionview/lib/action_view/template/types.rb
index db77cb5d19..db77cb5d19 100644
--- a/actionpack/lib/action_view/template/types.rb
+++ b/actionview/lib/action_view/template/types.rb
diff --git a/actionpack/lib/action_view/test_case.rb b/actionview/lib/action_view/test_case.rb
index 3145446114..3145446114 100644
--- a/actionpack/lib/action_view/test_case.rb
+++ b/actionview/lib/action_view/test_case.rb
diff --git a/actionpack/lib/action_view/testing/resolvers.rb b/actionview/lib/action_view/testing/resolvers.rb
index 7afa2fa613..7afa2fa613 100644
--- a/actionpack/lib/action_view/testing/resolvers.rb
+++ b/actionview/lib/action_view/testing/resolvers.rb
diff --git a/actionpack/lib/action_view/vendor/html-scanner.rb b/actionview/lib/action_view/vendor/html-scanner.rb
index 775b827529..775b827529 100644
--- a/actionpack/lib/action_view/vendor/html-scanner.rb
+++ b/actionview/lib/action_view/vendor/html-scanner.rb
diff --git a/actionpack/lib/action_view/vendor/html-scanner/html/document.rb b/actionview/lib/action_view/vendor/html-scanner/html/document.rb
index 386820300a..386820300a 100644
--- a/actionpack/lib/action_view/vendor/html-scanner/html/document.rb
+++ b/actionview/lib/action_view/vendor/html-scanner/html/document.rb
diff --git a/actionpack/lib/action_view/vendor/html-scanner/html/node.rb b/actionview/lib/action_view/vendor/html-scanner/html/node.rb
index 7e7cd4f7b6..7e7cd4f7b6 100644
--- a/actionpack/lib/action_view/vendor/html-scanner/html/node.rb
+++ b/actionview/lib/action_view/vendor/html-scanner/html/node.rb
diff --git a/actionpack/lib/action_view/vendor/html-scanner/html/sanitizer.rb b/actionview/lib/action_view/vendor/html-scanner/html/sanitizer.rb
index 30b6b8b141..30b6b8b141 100644
--- a/actionpack/lib/action_view/vendor/html-scanner/html/sanitizer.rb
+++ b/actionview/lib/action_view/vendor/html-scanner/html/sanitizer.rb
diff --git a/actionpack/lib/action_view/vendor/html-scanner/html/selector.rb b/actionview/lib/action_view/vendor/html-scanner/html/selector.rb
index 7f8609c408..7f8609c408 100644
--- a/actionpack/lib/action_view/vendor/html-scanner/html/selector.rb
+++ b/actionview/lib/action_view/vendor/html-scanner/html/selector.rb
diff --git a/actionpack/lib/action_view/vendor/html-scanner/html/tokenizer.rb b/actionview/lib/action_view/vendor/html-scanner/html/tokenizer.rb
index 8ac8d34430..8ac8d34430 100644
--- a/actionpack/lib/action_view/vendor/html-scanner/html/tokenizer.rb
+++ b/actionview/lib/action_view/vendor/html-scanner/html/tokenizer.rb
diff --git a/actionpack/lib/action_view/vendor/html-scanner/html/version.rb b/actionview/lib/action_view/vendor/html-scanner/html/version.rb
index 6d645c3e14..6d645c3e14 100644
--- a/actionpack/lib/action_view/vendor/html-scanner/html/version.rb
+++ b/actionview/lib/action_view/vendor/html-scanner/html/version.rb
diff --git a/actionview/lib/action_view/version.rb b/actionview/lib/action_view/version.rb
new file mode 100644
index 0000000000..094dd474df
--- /dev/null
+++ b/actionview/lib/action_view/version.rb
@@ -0,0 +1,11 @@
+module ActionView
+ # Returns the version of the currently loaded ActionView as a Gem::Version
+ def self.version
+ Gem::Version.new "4.1.0.beta"
+ end
+
+ module VERSION #:nodoc:
+ MAJOR, MINOR, TINY, PRE = ActionView.version.segments
+ STRING = ActionView.version.to_s
+ end
+end
diff --git a/actionview/test/abstract_unit.rb b/actionview/test/abstract_unit.rb
new file mode 100644
index 0000000000..8213997f4e
--- /dev/null
+++ b/actionview/test/abstract_unit.rb
@@ -0,0 +1,382 @@
+require File.expand_path('../../../load_paths', __FILE__)
+
+$:.unshift(File.dirname(__FILE__) + '/lib')
+$:.unshift(File.dirname(__FILE__) + '/fixtures/helpers')
+$:.unshift(File.dirname(__FILE__) + '/fixtures/alternate_helpers')
+
+ENV['TMPDIR'] = File.join(File.dirname(__FILE__), 'tmp')
+
+require 'active_support/core_ext/kernel/reporting'
+
+# These are the normal settings that will be set up by Railties
+# TODO: Have these tests support other combinations of these values
+silence_warnings do
+ Encoding.default_internal = "UTF-8"
+ Encoding.default_external = "UTF-8"
+end
+
+require 'active_support/testing/autorun'
+require 'abstract_controller'
+require 'action_controller'
+require 'action_view'
+require 'action_view/testing/resolvers'
+require 'action_dispatch'
+require 'active_support/dependencies'
+require 'active_model'
+require 'active_record'
+require 'action_controller/caching'
+
+require 'pp' # require 'pp' early to prevent hidden_methods from not picking up the pretty-print methods until too late
+
+module Rails
+ class << self
+ def env
+ @_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "test")
+ end
+ end
+end
+
+ActiveSupport::Dependencies.hook!
+
+Thread.abort_on_exception = true
+
+# Show backtraces for deprecated behavior for quicker cleanup.
+ActiveSupport::Deprecation.debug = true
+
+# Register danish language for testing
+I18n.backend.store_translations 'da', {}
+I18n.backend.store_translations 'pt-BR', {}
+ORIGINAL_LOCALES = I18n.available_locales.map {|locale| locale.to_s }.sort
+
+FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures')
+FIXTURES = Pathname.new(FIXTURE_LOAD_PATH)
+
+module RackTestUtils
+ def body_to_string(body)
+ if body.respond_to?(:each)
+ str = ""
+ body.each {|s| str << s }
+ str
+ else
+ body
+ end
+ end
+ extend self
+end
+
+module RenderERBUtils
+ def view
+ @view ||= begin
+ path = ActionView::FileSystemResolver.new(FIXTURE_LOAD_PATH)
+ view_paths = ActionView::PathSet.new([path])
+ ActionView::Base.new(view_paths)
+ end
+ end
+
+ def render_erb(string)
+ @virtual_path = nil
+
+ template = ActionView::Template.new(
+ string.strip,
+ "test template",
+ ActionView::Template::Handlers::ERB,
+ {})
+
+ template.render(self, {}).strip
+ end
+end
+
+SharedTestRoutes = ActionDispatch::Routing::RouteSet.new
+
+module ActionDispatch
+ module SharedRoutes
+ def before_setup
+ @routes = SharedTestRoutes
+ super
+ end
+ end
+
+ # Hold off drawing routes until all the possible controller classes
+ # have been loaded.
+ module DrawOnce
+ class << self
+ attr_accessor :drew
+ end
+ self.drew = false
+
+ def before_setup
+ super
+ return if DrawOnce.drew
+
+ SharedTestRoutes.draw do
+ get ':controller(/:action)'
+ end
+
+ ActionDispatch::IntegrationTest.app.routes.draw do
+ get ':controller(/:action)'
+ end
+
+ DrawOnce.drew = true
+ end
+ end
+end
+
+module ActiveSupport
+ class TestCase
+ include ActionDispatch::DrawOnce
+ end
+end
+
+class RoutedRackApp
+ attr_reader :routes
+
+ def initialize(routes, &blk)
+ @routes = routes
+ @stack = ActionDispatch::MiddlewareStack.new(&blk).build(@routes)
+ end
+
+ def call(env)
+ @stack.call(env)
+ end
+end
+
+class BasicController
+ attr_accessor :request
+
+ def config
+ @config ||= ActiveSupport::InheritableOptions.new(ActionController::Base.config).tap do |config|
+ # VIEW TODO: View tests should not require a controller
+ public_dir = File.expand_path("../fixtures/public", __FILE__)
+ config.assets_dir = public_dir
+ config.javascripts_dir = "#{public_dir}/javascripts"
+ config.stylesheets_dir = "#{public_dir}/stylesheets"
+ config.assets = ActiveSupport::InheritableOptions.new({ :prefix => "assets" })
+ config
+ end
+ end
+end
+
+class ActionDispatch::IntegrationTest < ActiveSupport::TestCase
+ include ActionDispatch::SharedRoutes
+
+ def self.build_app(routes = nil)
+ RoutedRackApp.new(routes || ActionDispatch::Routing::RouteSet.new) do |middleware|
+ middleware.use "ActionDispatch::ShowExceptions", ActionDispatch::PublicExceptions.new("#{FIXTURE_LOAD_PATH}/public")
+ middleware.use "ActionDispatch::DebugExceptions"
+ middleware.use "ActionDispatch::Callbacks"
+ middleware.use "ActionDispatch::ParamsParser"
+ middleware.use "ActionDispatch::Cookies"
+ middleware.use "ActionDispatch::Flash"
+ middleware.use "Rack::Head"
+ yield(middleware) if block_given?
+ end
+ end
+
+ self.app = build_app
+
+ # Stub Rails dispatcher so it does not get controller references and
+ # simply return the controller#action as Rack::Body.
+ class StubDispatcher < ::ActionDispatch::Routing::RouteSet::Dispatcher
+ protected
+ def controller_reference(controller_param)
+ controller_param
+ end
+
+ def dispatch(controller, action, env)
+ [200, {'Content-Type' => 'text/html'}, ["#{controller}##{action}"]]
+ end
+ end
+
+ def self.stub_controllers
+ old_dispatcher = ActionDispatch::Routing::RouteSet::Dispatcher
+ ActionDispatch::Routing::RouteSet.module_eval { remove_const :Dispatcher }
+ ActionDispatch::Routing::RouteSet.module_eval { const_set :Dispatcher, StubDispatcher }
+ yield ActionDispatch::Routing::RouteSet.new
+ ensure
+ ActionDispatch::Routing::RouteSet.module_eval { remove_const :Dispatcher }
+ ActionDispatch::Routing::RouteSet.module_eval { const_set :Dispatcher, old_dispatcher }
+ end
+
+ def with_routing(&block)
+ temporary_routes = ActionDispatch::Routing::RouteSet.new
+ old_app, self.class.app = self.class.app, self.class.build_app(temporary_routes)
+ old_routes = SharedTestRoutes
+ silence_warnings { Object.const_set(:SharedTestRoutes, temporary_routes) }
+
+ yield temporary_routes
+ ensure
+ self.class.app = old_app
+ silence_warnings { Object.const_set(:SharedTestRoutes, old_routes) }
+ end
+
+ def with_autoload_path(path)
+ path = File.join(File.dirname(__FILE__), "fixtures", path)
+ if ActiveSupport::Dependencies.autoload_paths.include?(path)
+ yield
+ else
+ begin
+ ActiveSupport::Dependencies.autoload_paths << path
+ yield
+ ensure
+ ActiveSupport::Dependencies.autoload_paths.reject! {|p| p == path}
+ ActiveSupport::Dependencies.clear
+ end
+ end
+ end
+end
+
+# Temporary base class
+class Rack::TestCase < ActionDispatch::IntegrationTest
+ def self.testing(klass = nil)
+ if klass
+ @testing = "/#{klass.name.underscore}".sub!(/_controller$/, '')
+ else
+ @testing
+ end
+ end
+
+ def get(thing, *args)
+ if thing.is_a?(Symbol)
+ super("#{self.class.testing}/#{thing}", *args)
+ else
+ super
+ end
+ end
+
+ def assert_body(body)
+ assert_equal body, Array(response.body).join
+ end
+
+ def assert_status(code)
+ assert_equal code, response.status
+ end
+
+ def assert_response(body, status = 200, headers = {})
+ assert_body body
+ assert_status status
+ headers.each do |header, value|
+ assert_header header, value
+ end
+ end
+
+ def assert_content_type(type)
+ assert_equal type, response.headers["Content-Type"]
+ end
+
+ def assert_header(name, value)
+ assert_equal value, response.headers[name]
+ end
+end
+
+module ActionController
+ class Base
+ include ActionController::Testing
+ # This stub emulates the Railtie including the URL helpers from a Rails application
+ include SharedTestRoutes.url_helpers
+ include SharedTestRoutes.mounted_helpers
+
+ self.view_paths = FIXTURE_LOAD_PATH
+
+ def self.test_routes(&block)
+ routes = ActionDispatch::Routing::RouteSet.new
+ routes.draw(&block)
+ include routes.url_helpers
+ end
+ end
+
+ class TestCase
+ include ActionDispatch::TestProcess
+ include ActionDispatch::SharedRoutes
+ end
+end
+
+class ::ApplicationController < ActionController::Base
+end
+
+module ActionView
+ class TestCase
+ # Must repeat the setup because AV::TestCase is a duplication
+ # of AC::TestCase
+ include ActionDispatch::SharedRoutes
+ end
+end
+
+class Workshop
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+ attr_accessor :id
+
+ def initialize(id)
+ @id = id
+ end
+
+ def persisted?
+ id.present?
+ end
+
+ def to_s
+ id.to_s
+ end
+end
+
+module ActionDispatch
+ class DebugExceptions
+ private
+ remove_method :stderr_logger
+ # Silence logger
+ def stderr_logger
+ nil
+ end
+ end
+end
+
+module ActionDispatch
+ module RoutingVerbs
+ def get(uri_or_host, path = nil)
+ host = uri_or_host.host unless path
+ path ||= uri_or_host.path
+
+ params = {'PATH_INFO' => path,
+ 'REQUEST_METHOD' => 'GET',
+ 'HTTP_HOST' => host}
+
+ routes.call(params)[2].join
+ end
+ end
+end
+
+module RoutingTestHelpers
+ def url_for(set, options, recall = nil)
+ set.send(:url_for, options.merge(:only_path => true, :_recall => recall))
+ end
+end
+
+class ResourcesController < ActionController::Base
+ def index() render :nothing => true end
+ alias_method :show, :index
+end
+
+class ThreadsController < ResourcesController; end
+class MessagesController < ResourcesController; end
+class CommentsController < ResourcesController; end
+class ReviewsController < ResourcesController; end
+class AuthorsController < ResourcesController; end
+class LogosController < ResourcesController; end
+
+class AccountsController < ResourcesController; end
+class AdminController < ResourcesController; end
+class ProductsController < ResourcesController; end
+class ImagesController < ResourcesController; end
+class PreferencesController < ResourcesController; end
+
+module Backoffice
+ class ProductsController < ResourcesController; end
+ class TagsController < ResourcesController; end
+ class ManufacturersController < ResourcesController; end
+ class ImagesController < ResourcesController; end
+
+ module Admin
+ class ProductsController < ResourcesController; end
+ class ImagesController < ResourcesController; end
+ end
+end
diff --git a/actionview/test/active_record_unit.rb b/actionview/test/active_record_unit.rb
new file mode 100644
index 0000000000..95fbb112c0
--- /dev/null
+++ b/actionview/test/active_record_unit.rb
@@ -0,0 +1,91 @@
+require 'abstract_unit'
+
+# Define the essentials
+class ActiveRecordTestConnector
+ cattr_accessor :able_to_connect
+ cattr_accessor :connected
+
+ # Set our defaults
+ self.connected = false
+ self.able_to_connect = true
+end
+
+# Try to grab AR
+unless defined?(ActiveRecord) && defined?(FixtureSet)
+ begin
+ PATH_TO_AR = "#{File.dirname(__FILE__)}/../../activerecord/lib"
+ raise LoadError, "#{PATH_TO_AR} doesn't exist" unless File.directory?(PATH_TO_AR)
+ $LOAD_PATH.unshift PATH_TO_AR
+ require 'active_record'
+ rescue LoadError => e
+ $stderr.print "Failed to load Active Record. Skipping Active Record assertion tests: #{e}"
+ ActiveRecordTestConnector.able_to_connect = false
+ end
+end
+$stderr.flush
+
+
+# Define the rest of the connector
+class ActiveRecordTestConnector
+ class << self
+ def setup
+ unless self.connected || !self.able_to_connect
+ setup_connection
+ load_schema
+ require_fixture_models
+ self.connected = true
+ end
+ rescue Exception => e # errors from ActiveRecord setup
+ $stderr.puts "\nSkipping ActiveRecord assertion tests: #{e}"
+ #$stderr.puts " #{e.backtrace.join("\n ")}\n"
+ self.able_to_connect = false
+ end
+
+ private
+ def setup_connection
+ if Object.const_defined?(:ActiveRecord)
+ defaults = { :database => ':memory:' }
+ adapter = defined?(JRUBY_VERSION) ? 'jdbcsqlite3' : 'sqlite3'
+ options = defaults.merge :adapter => adapter, :timeout => 500
+ ActiveRecord::Base.establish_connection(options)
+ ActiveRecord::Base.configurations = { 'sqlite3_ar_integration' => options }
+ ActiveRecord::Base.connection
+
+ Object.send(:const_set, :QUOTED_TYPE, ActiveRecord::Base.connection.quote_column_name('type')) unless Object.const_defined?(:QUOTED_TYPE)
+ else
+ raise "Can't setup connection since ActiveRecord isn't loaded."
+ end
+ end
+
+ # Load actionpack sqlite tables
+ def load_schema
+ File.read(File.dirname(__FILE__) + "/fixtures/db_definitions/sqlite.sql").split(';').each do |sql|
+ ActiveRecord::Base.connection.execute(sql) unless sql.blank?
+ end
+ end
+
+ def require_fixture_models
+ Dir.glob(File.dirname(__FILE__) + "/fixtures/*.rb").each {|f| require f}
+ end
+ end
+end
+
+class ActiveRecordTestCase < ActionController::TestCase
+ include ActiveRecord::TestFixtures
+
+ # Set our fixture path
+ if ActiveRecordTestConnector.able_to_connect
+ self.fixture_path = [FIXTURE_LOAD_PATH]
+ self.use_transactional_fixtures = false
+ end
+
+ def self.fixtures(*args)
+ super if ActiveRecordTestConnector.connected
+ end
+
+ def run(*args)
+ super if ActiveRecordTestConnector.connected
+ end
+end
+
+ActiveRecordTestConnector.setup
diff --git a/actionpack/test/activerecord/controller_runtime_test.rb b/actionview/test/activerecord/controller_runtime_test.rb
index 368bec1c70..368bec1c70 100644
--- a/actionpack/test/activerecord/controller_runtime_test.rb
+++ b/actionview/test/activerecord/controller_runtime_test.rb
diff --git a/actionpack/test/activerecord/form_helper_activerecord_test.rb b/actionview/test/activerecord/form_helper_activerecord_test.rb
index 2e302c65a7..2e302c65a7 100644
--- a/actionpack/test/activerecord/form_helper_activerecord_test.rb
+++ b/actionview/test/activerecord/form_helper_activerecord_test.rb
diff --git a/actionpack/test/activerecord/polymorphic_routes_test.rb b/actionview/test/activerecord/polymorphic_routes_test.rb
index afb714484b..afb714484b 100644
--- a/actionpack/test/activerecord/polymorphic_routes_test.rb
+++ b/actionview/test/activerecord/polymorphic_routes_test.rb
diff --git a/actionpack/test/activerecord/render_partial_with_record_identification_test.rb b/actionview/test/activerecord/render_partial_with_record_identification_test.rb
index 409370104d..409370104d 100644
--- a/actionpack/test/activerecord/render_partial_with_record_identification_test.rb
+++ b/actionview/test/activerecord/render_partial_with_record_identification_test.rb
diff --git a/actionpack/test/fixtures/_top_level_partial.html.erb b/actionview/test/fixtures/_top_level_partial.html.erb
index 0b1c2e46e0..0b1c2e46e0 100644
--- a/actionpack/test/fixtures/_top_level_partial.html.erb
+++ b/actionview/test/fixtures/_top_level_partial.html.erb
diff --git a/actionview/test/fixtures/_top_level_partial_only.erb b/actionview/test/fixtures/_top_level_partial_only.erb
new file mode 100644
index 0000000000..44f25b61d0
--- /dev/null
+++ b/actionview/test/fixtures/_top_level_partial_only.erb
@@ -0,0 +1 @@
+top level partial \ No newline at end of file
diff --git a/actionpack/test/fixtures/blog_public/.gitignore b/actionview/test/fixtures/blog_public/.gitignore
index 312e635ee6..312e635ee6 100644
--- a/actionpack/test/fixtures/blog_public/.gitignore
+++ b/actionview/test/fixtures/blog_public/.gitignore
diff --git a/actionpack/test/fixtures/blog_public/blog.html b/actionview/test/fixtures/blog_public/blog.html
index 79ad44c010..79ad44c010 100644
--- a/actionpack/test/fixtures/blog_public/blog.html
+++ b/actionview/test/fixtures/blog_public/blog.html
diff --git a/actionpack/test/fixtures/blog_public/index.html b/actionview/test/fixtures/blog_public/index.html
index 2de3825481..2de3825481 100644
--- a/actionpack/test/fixtures/blog_public/index.html
+++ b/actionview/test/fixtures/blog_public/index.html
diff --git a/actionpack/test/fixtures/blog_public/subdir/index.html b/actionview/test/fixtures/blog_public/subdir/index.html
index 517bded335..517bded335 100644
--- a/actionpack/test/fixtures/blog_public/subdir/index.html
+++ b/actionview/test/fixtures/blog_public/subdir/index.html
diff --git a/actionpack/test/fixtures/comments/empty.de.html.erb b/actionview/test/fixtures/comments/empty.de.html.erb
index cffd90dd26..cffd90dd26 100644
--- a/actionpack/test/fixtures/comments/empty.de.html.erb
+++ b/actionview/test/fixtures/comments/empty.de.html.erb
diff --git a/actionpack/test/fixtures/comments/empty.html.builder b/actionview/test/fixtures/comments/empty.html.builder
index 2b0c7207a3..2b0c7207a3 100644
--- a/actionpack/test/fixtures/comments/empty.html.builder
+++ b/actionview/test/fixtures/comments/empty.html.builder
diff --git a/actionpack/test/fixtures/comments/empty.html.erb b/actionview/test/fixtures/comments/empty.html.erb
index 827f3861de..827f3861de 100644
--- a/actionpack/test/fixtures/comments/empty.html.erb
+++ b/actionview/test/fixtures/comments/empty.html.erb
diff --git a/actionpack/test/fixtures/comments/empty.xml.erb b/actionview/test/fixtures/comments/empty.xml.erb
index db1027cd7d..db1027cd7d 100644
--- a/actionpack/test/fixtures/comments/empty.xml.erb
+++ b/actionview/test/fixtures/comments/empty.xml.erb
diff --git a/actionpack/test/fixtures/companies.yml b/actionview/test/fixtures/companies.yml
index ed2992e0b1..ed2992e0b1 100644
--- a/actionpack/test/fixtures/companies.yml
+++ b/actionview/test/fixtures/companies.yml
diff --git a/actionview/test/fixtures/company.rb b/actionview/test/fixtures/company.rb
new file mode 100644
index 0000000000..f3ac3642fa
--- /dev/null
+++ b/actionview/test/fixtures/company.rb
@@ -0,0 +1,9 @@
+class Company < ActiveRecord::Base
+ has_one :mascot
+ self.sequence_name = :companies_nonstd_seq
+
+ validates_presence_of :name
+ def validate
+ errors.add('rating', 'rating should not be 2') if rating == 2
+ end
+end
diff --git a/actionpack/test/fixtures/custom_pattern/another.html.erb b/actionview/test/fixtures/custom_pattern/another.html.erb
index 6d7f3bafbb..6d7f3bafbb 100644
--- a/actionpack/test/fixtures/custom_pattern/another.html.erb
+++ b/actionview/test/fixtures/custom_pattern/another.html.erb
diff --git a/actionpack/test/fixtures/custom_pattern/html/another.erb b/actionview/test/fixtures/custom_pattern/html/another.erb
index dbd7e96ab6..dbd7e96ab6 100644
--- a/actionpack/test/fixtures/custom_pattern/html/another.erb
+++ b/actionview/test/fixtures/custom_pattern/html/another.erb
diff --git a/actionpack/test/fixtures/custom_pattern/html/path.erb b/actionview/test/fixtures/custom_pattern/html/path.erb
index 6d7f3bafbb..6d7f3bafbb 100644
--- a/actionpack/test/fixtures/custom_pattern/html/path.erb
+++ b/actionview/test/fixtures/custom_pattern/html/path.erb
diff --git a/actionview/test/fixtures/customers/_customer.html.erb b/actionview/test/fixtures/customers/_customer.html.erb
new file mode 100644
index 0000000000..483571e22a
--- /dev/null
+++ b/actionview/test/fixtures/customers/_customer.html.erb
@@ -0,0 +1 @@
+<%= greeting %>: <%= customer.name %> \ No newline at end of file
diff --git a/actionpack/test/fixtures/db_definitions/sqlite.sql b/actionview/test/fixtures/db_definitions/sqlite.sql
index 99df4b3e61..99df4b3e61 100644
--- a/actionpack/test/fixtures/db_definitions/sqlite.sql
+++ b/actionview/test/fixtures/db_definitions/sqlite.sql
diff --git a/actionpack/test/fixtures/developer.rb b/actionview/test/fixtures/developer.rb
index 4941463015..4941463015 100644
--- a/actionpack/test/fixtures/developer.rb
+++ b/actionview/test/fixtures/developer.rb
diff --git a/actionpack/test/fixtures/developers.yml b/actionview/test/fixtures/developers.yml
index 3656564f63..3656564f63 100644
--- a/actionpack/test/fixtures/developers.yml
+++ b/actionview/test/fixtures/developers.yml
diff --git a/actionpack/test/fixtures/developers/_developer.erb b/actionview/test/fixtures/developers/_developer.erb
index 904a3137e7..904a3137e7 100644
--- a/actionpack/test/fixtures/developers/_developer.erb
+++ b/actionview/test/fixtures/developers/_developer.erb
diff --git a/actionpack/test/fixtures/developers_projects.yml b/actionview/test/fixtures/developers_projects.yml
index cee359c7cf..cee359c7cf 100644
--- a/actionpack/test/fixtures/developers_projects.yml
+++ b/actionview/test/fixtures/developers_projects.yml
diff --git a/actionpack/test/fixtures/digestor/comments/_comment.html.erb b/actionview/test/fixtures/digestor/comments/_comment.html.erb
index f172e749da..f172e749da 100644
--- a/actionpack/test/fixtures/digestor/comments/_comment.html.erb
+++ b/actionview/test/fixtures/digestor/comments/_comment.html.erb
diff --git a/actionpack/test/fixtures/digestor/comments/_comments.html.erb b/actionview/test/fixtures/digestor/comments/_comments.html.erb
index c28646a283..c28646a283 100644
--- a/actionpack/test/fixtures/digestor/comments/_comments.html.erb
+++ b/actionview/test/fixtures/digestor/comments/_comments.html.erb
diff --git a/actionpack/test/fixtures/digestor/events/_event.html.erb b/actionview/test/fixtures/digestor/events/_event.html.erb
index e69de29bb2..e69de29bb2 100644
--- a/actionpack/test/fixtures/digestor/events/_event.html.erb
+++ b/actionview/test/fixtures/digestor/events/_event.html.erb
diff --git a/actionpack/test/fixtures/digestor/level/below/_header.html.erb b/actionview/test/fixtures/digestor/level/below/_header.html.erb
index e69de29bb2..e69de29bb2 100644
--- a/actionpack/test/fixtures/digestor/level/below/_header.html.erb
+++ b/actionview/test/fixtures/digestor/level/below/_header.html.erb
diff --git a/actionpack/test/fixtures/digestor/level/below/index.html.erb b/actionview/test/fixtures/digestor/level/below/index.html.erb
index b92f49a8f8..b92f49a8f8 100644
--- a/actionpack/test/fixtures/digestor/level/below/index.html.erb
+++ b/actionview/test/fixtures/digestor/level/below/index.html.erb
diff --git a/actionpack/test/fixtures/digestor/messages/_form.html.erb b/actionview/test/fixtures/digestor/messages/_form.html.erb
index e69de29bb2..e69de29bb2 100644
--- a/actionpack/test/fixtures/digestor/messages/_form.html.erb
+++ b/actionview/test/fixtures/digestor/messages/_form.html.erb
diff --git a/actionpack/test/fixtures/digestor/messages/_header.html.erb b/actionview/test/fixtures/digestor/messages/_header.html.erb
index e69de29bb2..e69de29bb2 100644
--- a/actionpack/test/fixtures/digestor/messages/_header.html.erb
+++ b/actionview/test/fixtures/digestor/messages/_header.html.erb
diff --git a/actionpack/test/fixtures/digestor/messages/_message.html.erb b/actionview/test/fixtures/digestor/messages/_message.html.erb
index 406a0fb848..406a0fb848 100644
--- a/actionpack/test/fixtures/digestor/messages/_message.html.erb
+++ b/actionview/test/fixtures/digestor/messages/_message.html.erb
diff --git a/actionpack/test/fixtures/digestor/messages/actions/_move.html.erb b/actionview/test/fixtures/digestor/messages/actions/_move.html.erb
index e69de29bb2..e69de29bb2 100644
--- a/actionpack/test/fixtures/digestor/messages/actions/_move.html.erb
+++ b/actionview/test/fixtures/digestor/messages/actions/_move.html.erb
diff --git a/actionpack/test/fixtures/digestor/messages/edit.html.erb b/actionview/test/fixtures/digestor/messages/edit.html.erb
index a9e0a88e32..a9e0a88e32 100644
--- a/actionpack/test/fixtures/digestor/messages/edit.html.erb
+++ b/actionview/test/fixtures/digestor/messages/edit.html.erb
diff --git a/actionpack/test/fixtures/digestor/messages/index.html.erb b/actionview/test/fixtures/digestor/messages/index.html.erb
index 1937b652e4..1937b652e4 100644
--- a/actionpack/test/fixtures/digestor/messages/index.html.erb
+++ b/actionview/test/fixtures/digestor/messages/index.html.erb
diff --git a/actionpack/test/fixtures/digestor/messages/show.html.erb b/actionview/test/fixtures/digestor/messages/show.html.erb
index 130e67109e..42aa2363dd 100644
--- a/actionpack/test/fixtures/digestor/messages/show.html.erb
+++ b/actionview/test/fixtures/digestor/messages/show.html.erb
@@ -6,9 +6,9 @@
<%= render @message.history.events %>
-<%# render "something_missing" %>
-<%# render "something_missing_1" %>
+<%# render "something_missing" %>
+<%# render "something_missing_1" %>
<%
# Template Dependency: messages/form
-%>
+%> \ No newline at end of file
diff --git a/actionpack/test/fixtures/fun/games/_game.erb b/actionview/test/fixtures/fun/games/_game.erb
index f0f542ff92..f0f542ff92 100644
--- a/actionpack/test/fixtures/fun/games/_game.erb
+++ b/actionview/test/fixtures/fun/games/_game.erb
diff --git a/actionview/test/fixtures/fun/games/hello_world.erb b/actionview/test/fixtures/fun/games/hello_world.erb
new file mode 100644
index 0000000000..1ebfbe2539
--- /dev/null
+++ b/actionview/test/fixtures/fun/games/hello_world.erb
@@ -0,0 +1 @@
+Living in a nested world \ No newline at end of file
diff --git a/actionpack/test/fixtures/fun/serious/games/_game.erb b/actionview/test/fixtures/fun/serious/games/_game.erb
index 523bc55bd7..523bc55bd7 100644
--- a/actionpack/test/fixtures/fun/serious/games/_game.erb
+++ b/actionview/test/fixtures/fun/serious/games/_game.erb
diff --git a/actionview/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb b/actionview/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb
new file mode 100644
index 0000000000..3125583a28
--- /dev/null
+++ b/actionview/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb
@@ -0,0 +1,3 @@
+<body>
+<%= cache 'nodigest', skip_digest: true do %><p>ERB</p><% end %>
+</body>
diff --git a/actionpack/test/fixtures/games/_game.erb b/actionview/test/fixtures/games/_game.erb
index 1aeb81fcba..1aeb81fcba 100644
--- a/actionpack/test/fixtures/games/_game.erb
+++ b/actionview/test/fixtures/games/_game.erb
diff --git a/actionview/test/fixtures/good_customers/_good_customer.html.erb b/actionview/test/fixtures/good_customers/_good_customer.html.erb
new file mode 100644
index 0000000000..a2d97ebc6d
--- /dev/null
+++ b/actionview/test/fixtures/good_customers/_good_customer.html.erb
@@ -0,0 +1 @@
+<%= greeting %> good customer: <%= good_customer.name %><%= good_customer_counter %> \ No newline at end of file
diff --git a/actionpack/test/fixtures/happy_path/render_action/hello_world.erb b/actionview/test/fixtures/happy_path/render_action/hello_world.erb
index 6769dd60bd..6769dd60bd 100644
--- a/actionpack/test/fixtures/happy_path/render_action/hello_world.erb
+++ b/actionview/test/fixtures/happy_path/render_action/hello_world.erb
diff --git a/actionpack/test/fixtures/layout_tests/alt/hello.erb b/actionview/test/fixtures/layout_tests/alt/hello.erb
index 1055c36659..1055c36659 100644
--- a/actionpack/test/fixtures/layout_tests/alt/hello.erb
+++ b/actionview/test/fixtures/layout_tests/alt/hello.erb
diff --git a/actionpack/test/fixtures/layouts/_column.html.erb b/actionview/test/fixtures/layouts/_column.html.erb
index 96db002b8a..96db002b8a 100644
--- a/actionpack/test/fixtures/layouts/_column.html.erb
+++ b/actionview/test/fixtures/layouts/_column.html.erb
diff --git a/actionview/test/fixtures/layouts/_customers.erb b/actionview/test/fixtures/layouts/_customers.erb
new file mode 100644
index 0000000000..ae63f13cd3
--- /dev/null
+++ b/actionview/test/fixtures/layouts/_customers.erb
@@ -0,0 +1 @@
+<title><%= yield Struct.new(:name).new("David") %></title> \ No newline at end of file
diff --git a/actionpack/test/fixtures/layouts/_partial_and_yield.erb b/actionview/test/fixtures/layouts/_partial_and_yield.erb
index 74cc428ffa..74cc428ffa 100644
--- a/actionpack/test/fixtures/layouts/_partial_and_yield.erb
+++ b/actionview/test/fixtures/layouts/_partial_and_yield.erb
diff --git a/actionpack/test/fixtures/layouts/_yield_only.erb b/actionview/test/fixtures/layouts/_yield_only.erb
index 37f0bddbd7..37f0bddbd7 100644
--- a/actionpack/test/fixtures/layouts/_yield_only.erb
+++ b/actionview/test/fixtures/layouts/_yield_only.erb
diff --git a/actionpack/test/fixtures/layouts/_yield_with_params.erb b/actionview/test/fixtures/layouts/_yield_with_params.erb
index 68e6557fb8..68e6557fb8 100644
--- a/actionpack/test/fixtures/layouts/_yield_with_params.erb
+++ b/actionview/test/fixtures/layouts/_yield_with_params.erb
diff --git a/actionpack/test/fixtures/layouts/streaming.erb b/actionview/test/fixtures/layouts/streaming.erb
index d3f896a6ca..d3f896a6ca 100644
--- a/actionpack/test/fixtures/layouts/streaming.erb
+++ b/actionview/test/fixtures/layouts/streaming.erb
diff --git a/actionview/test/fixtures/layouts/yield.erb b/actionview/test/fixtures/layouts/yield.erb
new file mode 100644
index 0000000000..482dc9022e
--- /dev/null
+++ b/actionview/test/fixtures/layouts/yield.erb
@@ -0,0 +1,2 @@
+<title><%= yield :title %></title>
+<%= yield %>
diff --git a/actionpack/test/fixtures/layouts/yield_with_render_inline_inside.erb b/actionview/test/fixtures/layouts/yield_with_render_inline_inside.erb
index 7298d79690..7298d79690 100644
--- a/actionpack/test/fixtures/layouts/yield_with_render_inline_inside.erb
+++ b/actionview/test/fixtures/layouts/yield_with_render_inline_inside.erb
diff --git a/actionpack/test/fixtures/layouts/yield_with_render_partial_inside.erb b/actionview/test/fixtures/layouts/yield_with_render_partial_inside.erb
index 74cc428ffa..74cc428ffa 100644
--- a/actionpack/test/fixtures/layouts/yield_with_render_partial_inside.erb
+++ b/actionview/test/fixtures/layouts/yield_with_render_partial_inside.erb
diff --git a/actionpack/test/fixtures/mascot.rb b/actionview/test/fixtures/mascot.rb
index f9f1448b8f..f9f1448b8f 100644
--- a/actionpack/test/fixtures/mascot.rb
+++ b/actionview/test/fixtures/mascot.rb
diff --git a/actionpack/test/fixtures/mascots.yml b/actionview/test/fixtures/mascots.yml
index 17b7dff454..17b7dff454 100644
--- a/actionpack/test/fixtures/mascots.yml
+++ b/actionview/test/fixtures/mascots.yml
diff --git a/actionpack/test/fixtures/mascots/_mascot.html.erb b/actionview/test/fixtures/mascots/_mascot.html.erb
index 432773a1da..432773a1da 100644
--- a/actionpack/test/fixtures/mascots/_mascot.html.erb
+++ b/actionview/test/fixtures/mascots/_mascot.html.erb
diff --git a/actionview/test/fixtures/multipart/bracketed_utf8_param b/actionview/test/fixtures/multipart/bracketed_utf8_param
new file mode 100644
index 0000000000..df9cecea08
--- /dev/null
+++ b/actionview/test/fixtures/multipart/bracketed_utf8_param
@@ -0,0 +1,5 @@
+--AaB03x
+Content-Disposition: form-data; name="Iñtërnâtiônàlizætiøn_name[Iñtërnâtiônàlizætiøn_nested_name]"
+
+Iñtërnâtiônàlizætiøn_value
+--AaB03x--
diff --git a/actionview/test/fixtures/multipart/single_utf8_param b/actionview/test/fixtures/multipart/single_utf8_param
new file mode 100644
index 0000000000..1d9fae7b17
--- /dev/null
+++ b/actionview/test/fixtures/multipart/single_utf8_param
@@ -0,0 +1,5 @@
+--AaB03x
+Content-Disposition: form-data; name="Iñtërnâtiônàlizætiøn_name"
+
+Iñtërnâtiônàlizætiøn_value
+--AaB03x--
diff --git a/actionpack/test/fixtures/plain_text.raw b/actionview/test/fixtures/plain_text.raw
index b13985337f..b13985337f 100644
--- a/actionpack/test/fixtures/plain_text.raw
+++ b/actionview/test/fixtures/plain_text.raw
diff --git a/actionpack/test/fixtures/plain_text_with_characters.raw b/actionview/test/fixtures/plain_text_with_characters.raw
index 1e86e44fb4..1e86e44fb4 100644
--- a/actionpack/test/fixtures/plain_text_with_characters.raw
+++ b/actionview/test/fixtures/plain_text_with_characters.raw
diff --git a/actionpack/test/fixtures/project.rb b/actionview/test/fixtures/project.rb
index c124a9e605..c124a9e605 100644
--- a/actionpack/test/fixtures/project.rb
+++ b/actionview/test/fixtures/project.rb
diff --git a/actionpack/test/fixtures/projects.yml b/actionview/test/fixtures/projects.yml
index 02800c7824..02800c7824 100644
--- a/actionpack/test/fixtures/projects.yml
+++ b/actionview/test/fixtures/projects.yml
diff --git a/actionpack/test/fixtures/projects/_project.erb b/actionview/test/fixtures/projects/_project.erb
index 480c4c2af3..480c4c2af3 100644
--- a/actionpack/test/fixtures/projects/_project.erb
+++ b/actionview/test/fixtures/projects/_project.erb
diff --git a/actionpack/test/fixtures/public/.gitignore b/actionview/test/fixtures/public/.gitignore
index 312e635ee6..312e635ee6 100644
--- a/actionpack/test/fixtures/public/.gitignore
+++ b/actionview/test/fixtures/public/.gitignore
diff --git a/actionpack/test/fixtures/public/elsewhere/cools.js b/actionview/test/fixtures/public/elsewhere/cools.js
index 6e12fe29c4..6e12fe29c4 100644
--- a/actionpack/test/fixtures/public/elsewhere/cools.js
+++ b/actionview/test/fixtures/public/elsewhere/cools.js
diff --git a/actionpack/test/fixtures/public/elsewhere/file.css b/actionview/test/fixtures/public/elsewhere/file.css
index 6aea0733b1..6aea0733b1 100644
--- a/actionpack/test/fixtures/public/elsewhere/file.css
+++ b/actionview/test/fixtures/public/elsewhere/file.css
diff --git a/actionview/test/fixtures/public/foo/baz.css b/actionview/test/fixtures/public/foo/baz.css
new file mode 100644
index 0000000000..b5173fbef2
--- /dev/null
+++ b/actionview/test/fixtures/public/foo/baz.css
@@ -0,0 +1,3 @@
+body {
+background: #000;
+}
diff --git a/actionpack/test/fixtures/public/javascripts/application.js b/actionview/test/fixtures/public/javascripts/application.js
index 9702692980..9702692980 100644
--- a/actionpack/test/fixtures/public/javascripts/application.js
+++ b/actionview/test/fixtures/public/javascripts/application.js
diff --git a/actionpack/test/fixtures/public/javascripts/bank.js b/actionview/test/fixtures/public/javascripts/bank.js
index 4a1bee7182..4a1bee7182 100644
--- a/actionpack/test/fixtures/public/javascripts/bank.js
+++ b/actionview/test/fixtures/public/javascripts/bank.js
diff --git a/actionpack/test/fixtures/public/javascripts/common.javascript b/actionview/test/fixtures/public/javascripts/common.javascript
index 2ae1929056..2ae1929056 100644
--- a/actionpack/test/fixtures/public/javascripts/common.javascript
+++ b/actionview/test/fixtures/public/javascripts/common.javascript
diff --git a/actionpack/test/fixtures/public/javascripts/controls.js b/actionview/test/fixtures/public/javascripts/controls.js
index 88168d9f13..88168d9f13 100644
--- a/actionpack/test/fixtures/public/javascripts/controls.js
+++ b/actionview/test/fixtures/public/javascripts/controls.js
diff --git a/actionpack/test/fixtures/public/javascripts/dragdrop.js b/actionview/test/fixtures/public/javascripts/dragdrop.js
index c07061ac0c..c07061ac0c 100644
--- a/actionpack/test/fixtures/public/javascripts/dragdrop.js
+++ b/actionview/test/fixtures/public/javascripts/dragdrop.js
diff --git a/actionpack/test/fixtures/public/javascripts/effects.js b/actionview/test/fixtures/public/javascripts/effects.js
index b555d63034..b555d63034 100644
--- a/actionpack/test/fixtures/public/javascripts/effects.js
+++ b/actionview/test/fixtures/public/javascripts/effects.js
diff --git a/actionpack/test/fixtures/public/javascripts/prototype.js b/actionview/test/fixtures/public/javascripts/prototype.js
index 9780064a0e..9780064a0e 100644
--- a/actionpack/test/fixtures/public/javascripts/prototype.js
+++ b/actionview/test/fixtures/public/javascripts/prototype.js
diff --git a/actionpack/test/fixtures/public/javascripts/robber.js b/actionview/test/fixtures/public/javascripts/robber.js
index eb82fcbdf4..eb82fcbdf4 100644
--- a/actionpack/test/fixtures/public/javascripts/robber.js
+++ b/actionview/test/fixtures/public/javascripts/robber.js
diff --git a/actionpack/test/fixtures/public/javascripts/subdir/subdir.js b/actionview/test/fixtures/public/javascripts/subdir/subdir.js
index 9d23a67aa1..9d23a67aa1 100644
--- a/actionpack/test/fixtures/public/javascripts/subdir/subdir.js
+++ b/actionview/test/fixtures/public/javascripts/subdir/subdir.js
diff --git a/actionpack/test/fixtures/public/javascripts/version.1.0.js b/actionview/test/fixtures/public/javascripts/version.1.0.js
index cfd5fce70e..cfd5fce70e 100644
--- a/actionpack/test/fixtures/public/javascripts/version.1.0.js
+++ b/actionview/test/fixtures/public/javascripts/version.1.0.js
diff --git a/actionpack/test/fixtures/public/stylesheets/bank.css b/actionview/test/fixtures/public/stylesheets/bank.css
index ea161b12b2..ea161b12b2 100644
--- a/actionpack/test/fixtures/public/stylesheets/bank.css
+++ b/actionview/test/fixtures/public/stylesheets/bank.css
diff --git a/actionpack/test/fixtures/public/stylesheets/random.styles b/actionview/test/fixtures/public/stylesheets/random.styles
index d4eeead95c..d4eeead95c 100644
--- a/actionpack/test/fixtures/public/stylesheets/random.styles
+++ b/actionview/test/fixtures/public/stylesheets/random.styles
diff --git a/actionpack/test/fixtures/public/stylesheets/robber.css b/actionview/test/fixtures/public/stylesheets/robber.css
index 0fdd00a6a5..0fdd00a6a5 100644
--- a/actionpack/test/fixtures/public/stylesheets/robber.css
+++ b/actionview/test/fixtures/public/stylesheets/robber.css
diff --git a/actionpack/test/fixtures/public/stylesheets/subdir/subdir.css b/actionview/test/fixtures/public/stylesheets/subdir/subdir.css
index 241152a905..241152a905 100644
--- a/actionpack/test/fixtures/public/stylesheets/subdir/subdir.css
+++ b/actionview/test/fixtures/public/stylesheets/subdir/subdir.css
diff --git a/actionpack/test/fixtures/public/stylesheets/version.1.0.css b/actionview/test/fixtures/public/stylesheets/version.1.0.css
index 30f5f9ba6e..30f5f9ba6e 100644
--- a/actionpack/test/fixtures/public/stylesheets/version.1.0.css
+++ b/actionview/test/fixtures/public/stylesheets/version.1.0.css
diff --git a/actionpack/test/fixtures/replies.yml b/actionview/test/fixtures/replies.yml
index 2a3454b8bf..2a3454b8bf 100644
--- a/actionpack/test/fixtures/replies.yml
+++ b/actionview/test/fixtures/replies.yml
diff --git a/actionpack/test/fixtures/replies/_reply.erb b/actionview/test/fixtures/replies/_reply.erb
index 68baf548d8..68baf548d8 100644
--- a/actionpack/test/fixtures/replies/_reply.erb
+++ b/actionview/test/fixtures/replies/_reply.erb
diff --git a/actionpack/test/fixtures/reply.rb b/actionview/test/fixtures/reply.rb
index 047522c55b..047522c55b 100644
--- a/actionpack/test/fixtures/reply.rb
+++ b/actionview/test/fixtures/reply.rb
diff --git a/actionview/test/fixtures/respond_to/using_defaults_with_all.html.erb b/actionview/test/fixtures/respond_to/using_defaults_with_all.html.erb
new file mode 100644
index 0000000000..9f1f855269
--- /dev/null
+++ b/actionview/test/fixtures/respond_to/using_defaults_with_all.html.erb
@@ -0,0 +1 @@
+HTML!
diff --git a/actionview/test/fixtures/ruby_template.ruby b/actionview/test/fixtures/ruby_template.ruby
new file mode 100644
index 0000000000..5097bce47c
--- /dev/null
+++ b/actionview/test/fixtures/ruby_template.ruby
@@ -0,0 +1,2 @@
+body = ""
+body << ["Hello", "from", "Ruby", "code"].join(" ")
diff --git a/actionpack/test/fixtures/scope/test/modgreet.erb b/actionview/test/fixtures/scope/test/modgreet.erb
index 8947726e89..8947726e89 100644
--- a/actionpack/test/fixtures/scope/test/modgreet.erb
+++ b/actionview/test/fixtures/scope/test/modgreet.erb
diff --git a/actionview/test/fixtures/shared.html.erb b/actionview/test/fixtures/shared.html.erb
new file mode 100644
index 0000000000..af262fc9f8
--- /dev/null
+++ b/actionview/test/fixtures/shared.html.erb
@@ -0,0 +1 @@
+Elastica \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/_200.html.erb b/actionview/test/fixtures/test/_200.html.erb
index c9f45675dc..c9f45675dc 100644
--- a/actionpack/test/fixtures/test/_200.html.erb
+++ b/actionview/test/fixtures/test/_200.html.erb
diff --git a/actionpack/test/fixtures/test/_b_layout_for_partial.html.erb b/actionview/test/fixtures/test/_b_layout_for_partial.html.erb
index e918ba8f83..e918ba8f83 100644
--- a/actionpack/test/fixtures/test/_b_layout_for_partial.html.erb
+++ b/actionview/test/fixtures/test/_b_layout_for_partial.html.erb
diff --git a/actionpack/test/fixtures/test/_b_layout_for_partial_with_object.html.erb b/actionview/test/fixtures/test/_b_layout_for_partial_with_object.html.erb
index bdd53014cd..bdd53014cd 100644
--- a/actionpack/test/fixtures/test/_b_layout_for_partial_with_object.html.erb
+++ b/actionview/test/fixtures/test/_b_layout_for_partial_with_object.html.erb
diff --git a/actionpack/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb b/actionview/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb
index 44d6121297..44d6121297 100644
--- a/actionpack/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb
+++ b/actionview/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb
diff --git a/actionview/test/fixtures/test/_changing_priority.html.erb b/actionview/test/fixtures/test/_changing_priority.html.erb
new file mode 100644
index 0000000000..3225efc49a
--- /dev/null
+++ b/actionview/test/fixtures/test/_changing_priority.html.erb
@@ -0,0 +1 @@
+HTML \ No newline at end of file
diff --git a/actionview/test/fixtures/test/_changing_priority.json.erb b/actionview/test/fixtures/test/_changing_priority.json.erb
new file mode 100644
index 0000000000..7fa41dce66
--- /dev/null
+++ b/actionview/test/fixtures/test/_changing_priority.json.erb
@@ -0,0 +1 @@
+JSON \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/_content_tag_nested_in_content_tag.erb b/actionview/test/fixtures/test/_content_tag_nested_in_content_tag.erb
index 2f21a75dd9..2f21a75dd9 100644
--- a/actionpack/test/fixtures/test/_content_tag_nested_in_content_tag.erb
+++ b/actionview/test/fixtures/test/_content_tag_nested_in_content_tag.erb
diff --git a/actionview/test/fixtures/test/_counter.html.erb b/actionview/test/fixtures/test/_counter.html.erb
new file mode 100644
index 0000000000..fd245bfc70
--- /dev/null
+++ b/actionview/test/fixtures/test/_counter.html.erb
@@ -0,0 +1 @@
+<%= counter_counter %> \ No newline at end of file
diff --git a/actionview/test/fixtures/test/_customer.erb b/actionview/test/fixtures/test/_customer.erb
new file mode 100644
index 0000000000..d8220afeda
--- /dev/null
+++ b/actionview/test/fixtures/test/_customer.erb
@@ -0,0 +1 @@
+Hello: <%= customer.name rescue "Anonymous" %> \ No newline at end of file
diff --git a/actionview/test/fixtures/test/_customer_greeting.erb b/actionview/test/fixtures/test/_customer_greeting.erb
new file mode 100644
index 0000000000..6acbcb20c4
--- /dev/null
+++ b/actionview/test/fixtures/test/_customer_greeting.erb
@@ -0,0 +1 @@
+<%= greeting %>: <%= customer_greeting.name %> \ No newline at end of file
diff --git a/actionview/test/fixtures/test/_customer_with_var.erb b/actionview/test/fixtures/test/_customer_with_var.erb
new file mode 100644
index 0000000000..00047dd20e
--- /dev/null
+++ b/actionview/test/fixtures/test/_customer_with_var.erb
@@ -0,0 +1 @@
+<%= customer.name %> <%= customer.name %> <%= customer.name %> \ No newline at end of file
diff --git a/actionview/test/fixtures/test/_directory/_partial_with_locales.html.erb b/actionview/test/fixtures/test/_directory/_partial_with_locales.html.erb
new file mode 100644
index 0000000000..1cc8d41475
--- /dev/null
+++ b/actionview/test/fixtures/test/_directory/_partial_with_locales.html.erb
@@ -0,0 +1 @@
+Hello <%= name %>
diff --git a/actionview/test/fixtures/test/_first_json_partial.json.erb b/actionview/test/fixtures/test/_first_json_partial.json.erb
new file mode 100644
index 0000000000..790ee896db
--- /dev/null
+++ b/actionview/test/fixtures/test/_first_json_partial.json.erb
@@ -0,0 +1 @@
+<%= render :partial => "test/second_json_partial" %> \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/_from_helper.erb b/actionview/test/fixtures/test/_from_helper.erb
index 16de7c0f8a..16de7c0f8a 100644
--- a/actionpack/test/fixtures/test/_from_helper.erb
+++ b/actionview/test/fixtures/test/_from_helper.erb
diff --git a/actionview/test/fixtures/test/_json_change_priority.json.erb b/actionview/test/fixtures/test/_json_change_priority.json.erb
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/actionview/test/fixtures/test/_json_change_priority.json.erb
diff --git a/actionpack/test/fixtures/test/_label_with_block.erb b/actionview/test/fixtures/test/_label_with_block.erb
index 40117e594e..40117e594e 100644
--- a/actionpack/test/fixtures/test/_label_with_block.erb
+++ b/actionview/test/fixtures/test/_label_with_block.erb
diff --git a/actionpack/test/fixtures/test/_layout_for_block_with_args.html.erb b/actionview/test/fixtures/test/_layout_for_block_with_args.html.erb
index 307533208d..307533208d 100644
--- a/actionpack/test/fixtures/test/_layout_for_block_with_args.html.erb
+++ b/actionview/test/fixtures/test/_layout_for_block_with_args.html.erb
diff --git a/actionview/test/fixtures/test/_layout_for_partial.html.erb b/actionview/test/fixtures/test/_layout_for_partial.html.erb
new file mode 100644
index 0000000000..666efadbb6
--- /dev/null
+++ b/actionview/test/fixtures/test/_layout_for_partial.html.erb
@@ -0,0 +1,3 @@
+Before (<%= name %>)
+<%= yield %>
+After \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/_layout_with_partial_and_yield.html.erb b/actionview/test/fixtures/test/_layout_with_partial_and_yield.html.erb
index 820e7db789..820e7db789 100644
--- a/actionpack/test/fixtures/test/_layout_with_partial_and_yield.html.erb
+++ b/actionview/test/fixtures/test/_layout_with_partial_and_yield.html.erb
diff --git a/actionpack/test/fixtures/test/_local_inspector.html.erb b/actionview/test/fixtures/test/_local_inspector.html.erb
index e6765c0882..e6765c0882 100644
--- a/actionpack/test/fixtures/test/_local_inspector.html.erb
+++ b/actionview/test/fixtures/test/_local_inspector.html.erb
diff --git a/actionpack/test/fixtures/test/_object_inspector.erb b/actionview/test/fixtures/test/_object_inspector.erb
index 53af593821..53af593821 100644
--- a/actionpack/test/fixtures/test/_object_inspector.erb
+++ b/actionview/test/fixtures/test/_object_inspector.erb
diff --git a/actionpack/test/fixtures/test/_one.html.erb b/actionview/test/fixtures/test/_one.html.erb
index f796291cb4..f796291cb4 100644
--- a/actionpack/test/fixtures/test/_one.html.erb
+++ b/actionview/test/fixtures/test/_one.html.erb
diff --git a/actionview/test/fixtures/test/_partial.erb b/actionview/test/fixtures/test/_partial.erb
new file mode 100644
index 0000000000..e466dcbd8e
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial.erb
@@ -0,0 +1 @@
+invalid \ No newline at end of file
diff --git a/actionview/test/fixtures/test/_partial.html.erb b/actionview/test/fixtures/test/_partial.html.erb
new file mode 100644
index 0000000000..e39f6c9827
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial.html.erb
@@ -0,0 +1 @@
+partial html \ No newline at end of file
diff --git a/actionview/test/fixtures/test/_partial.js.erb b/actionview/test/fixtures/test/_partial.js.erb
new file mode 100644
index 0000000000..b350cdd7ef
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial.js.erb
@@ -0,0 +1 @@
+partial js \ No newline at end of file
diff --git a/actionview/test/fixtures/test/_partial_for_use_in_layout.html.erb b/actionview/test/fixtures/test/_partial_for_use_in_layout.html.erb
new file mode 100644
index 0000000000..3a03a64e31
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial_for_use_in_layout.html.erb
@@ -0,0 +1 @@
+Inside from partial (<%= name %>) \ No newline at end of file
diff --git a/actionview/test/fixtures/test/_partial_name_local_variable.erb b/actionview/test/fixtures/test/_partial_name_local_variable.erb
new file mode 100644
index 0000000000..cc3a91c89f
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial_name_local_variable.erb
@@ -0,0 +1 @@
+<%= partial_name_local_variable %>
diff --git a/actionview/test/fixtures/test/_partial_only.erb b/actionview/test/fixtures/test/_partial_only.erb
new file mode 100644
index 0000000000..a44b3eed40
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial_only.erb
@@ -0,0 +1 @@
+only partial \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/_partial_with_layout.erb b/actionview/test/fixtures/test/_partial_with_layout.erb
index 2a50c834fe..2a50c834fe 100644
--- a/actionpack/test/fixtures/test/_partial_with_layout.erb
+++ b/actionview/test/fixtures/test/_partial_with_layout.erb
diff --git a/actionpack/test/fixtures/test/_partial_with_layout_block_content.erb b/actionview/test/fixtures/test/_partial_with_layout_block_content.erb
index 65dafd93a8..65dafd93a8 100644
--- a/actionpack/test/fixtures/test/_partial_with_layout_block_content.erb
+++ b/actionview/test/fixtures/test/_partial_with_layout_block_content.erb
diff --git a/actionpack/test/fixtures/test/_partial_with_layout_block_partial.erb b/actionview/test/fixtures/test/_partial_with_layout_block_partial.erb
index 444197a7d0..444197a7d0 100644
--- a/actionpack/test/fixtures/test/_partial_with_layout_block_partial.erb
+++ b/actionview/test/fixtures/test/_partial_with_layout_block_partial.erb
diff --git a/actionpack/test/fixtures/test/_partial_with_only_html_version.html.erb b/actionview/test/fixtures/test/_partial_with_only_html_version.html.erb
index 00e6b6d6da..00e6b6d6da 100644
--- a/actionpack/test/fixtures/test/_partial_with_only_html_version.html.erb
+++ b/actionview/test/fixtures/test/_partial_with_only_html_version.html.erb
diff --git a/actionview/test/fixtures/test/_partial_with_partial.erb b/actionview/test/fixtures/test/_partial_with_partial.erb
new file mode 100644
index 0000000000..ee0d5037b6
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial_with_partial.erb
@@ -0,0 +1,2 @@
+<%= render 'test/partial' %>
+partial with partial
diff --git a/actionpack/test/fixtures/test/_raise.html.erb b/actionview/test/fixtures/test/_raise.html.erb
index 68b08181d3..68b08181d3 100644
--- a/actionpack/test/fixtures/test/_raise.html.erb
+++ b/actionview/test/fixtures/test/_raise.html.erb
diff --git a/actionview/test/fixtures/test/_raise_indentation.html.erb b/actionview/test/fixtures/test/_raise_indentation.html.erb
new file mode 100644
index 0000000000..f9a93728fe
--- /dev/null
+++ b/actionview/test/fixtures/test/_raise_indentation.html.erb
@@ -0,0 +1,13 @@
+<p>First paragraph</p>
+<p>Second paragraph</p>
+<p>Third paragraph</p>
+<p>Fourth paragraph</p>
+<p>Fifth paragraph</p>
+<p>Sixth paragraph</p>
+<p>Seventh paragraph</p>
+<p>Eight paragraph</p>
+<p>Ninth paragraph</p>
+<p>Tenth paragraph</p>
+<%= raise "error here!" %>
+<p>Eleventh paragraph</p>
+<p>Twelfth paragraph</p> \ No newline at end of file
diff --git a/actionview/test/fixtures/test/_second_json_partial.json.erb b/actionview/test/fixtures/test/_second_json_partial.json.erb
new file mode 100644
index 0000000000..5ebb7f1afd
--- /dev/null
+++ b/actionview/test/fixtures/test/_second_json_partial.json.erb
@@ -0,0 +1 @@
+Third level \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/_two.html.erb b/actionview/test/fixtures/test/_two.html.erb
index 5ab2f8a432..5ab2f8a432 100644
--- a/actionpack/test/fixtures/test/_two.html.erb
+++ b/actionview/test/fixtures/test/_two.html.erb
diff --git a/actionpack/test/fixtures/test/_utf8_partial.html.erb b/actionview/test/fixtures/test/_utf8_partial.html.erb
index 8d717fd427..8d717fd427 100644
--- a/actionpack/test/fixtures/test/_utf8_partial.html.erb
+++ b/actionview/test/fixtures/test/_utf8_partial.html.erb
diff --git a/actionpack/test/fixtures/test/_utf8_partial_magic.html.erb b/actionview/test/fixtures/test/_utf8_partial_magic.html.erb
index 4e2224610a..4e2224610a 100644
--- a/actionpack/test/fixtures/test/_utf8_partial_magic.html.erb
+++ b/actionview/test/fixtures/test/_utf8_partial_magic.html.erb
diff --git a/actionpack/test/fixtures/test/basic.html.erb b/actionview/test/fixtures/test/basic.html.erb
index ea696d7e01..ea696d7e01 100644
--- a/actionpack/test/fixtures/test/basic.html.erb
+++ b/actionview/test/fixtures/test/basic.html.erb
diff --git a/actionview/test/fixtures/test/calling_partial_with_layout.html.erb b/actionview/test/fixtures/test/calling_partial_with_layout.html.erb
new file mode 100644
index 0000000000..ac44bc0d81
--- /dev/null
+++ b/actionview/test/fixtures/test/calling_partial_with_layout.html.erb
@@ -0,0 +1 @@
+<%= render(:layout => "layout_for_partial", :partial => "partial_for_use_in_layout", :locals => { :name => "David" }) %> \ No newline at end of file
diff --git a/actionview/test/fixtures/test/change_priority.html.erb b/actionview/test/fixtures/test/change_priority.html.erb
new file mode 100644
index 0000000000..5618977d05
--- /dev/null
+++ b/actionview/test/fixtures/test/change_priority.html.erb
@@ -0,0 +1,2 @@
+<%= render :partial => "test/json_change_priority", formats: :json %>
+HTML Template, but <%= render :partial => "test/changing_priority" %> partial \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/dont_pick_me b/actionview/test/fixtures/test/dont_pick_me
index 0157c9e503..0157c9e503 100644
--- a/actionpack/test/fixtures/test/dont_pick_me
+++ b/actionview/test/fixtures/test/dont_pick_me
diff --git a/actionview/test/fixtures/test/dot.directory/render_file_with_ivar.erb b/actionview/test/fixtures/test/dot.directory/render_file_with_ivar.erb
new file mode 100644
index 0000000000..8b8a449236
--- /dev/null
+++ b/actionview/test/fixtures/test/dot.directory/render_file_with_ivar.erb
@@ -0,0 +1 @@
+The secret is <%= @secret %>
diff --git a/actionview/test/fixtures/test/greeting.xml.erb b/actionview/test/fixtures/test/greeting.xml.erb
new file mode 100644
index 0000000000..62fb0293f0
--- /dev/null
+++ b/actionview/test/fixtures/test/greeting.xml.erb
@@ -0,0 +1 @@
+<p>This is grand!</p>
diff --git a/actionview/test/fixtures/test/hello.builder b/actionview/test/fixtures/test/hello.builder
new file mode 100644
index 0000000000..a471553941
--- /dev/null
+++ b/actionview/test/fixtures/test/hello.builder
@@ -0,0 +1,4 @@
+xml.html do
+ xml.p "Hello #{@name}"
+ xml << render(:file => "test/greeting")
+end \ No newline at end of file
diff --git a/actionview/test/fixtures/test/hello/hello.erb b/actionview/test/fixtures/test/hello/hello.erb
new file mode 100644
index 0000000000..6769dd60bd
--- /dev/null
+++ b/actionview/test/fixtures/test/hello/hello.erb
@@ -0,0 +1 @@
+Hello world! \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/hello_world.da.html.erb b/actionview/test/fixtures/test/hello_world.da.html.erb
index 10ec443291..10ec443291 100644
--- a/actionpack/test/fixtures/test/hello_world.da.html.erb
+++ b/actionview/test/fixtures/test/hello_world.da.html.erb
diff --git a/actionview/test/fixtures/test/hello_world.erb b/actionview/test/fixtures/test/hello_world.erb
new file mode 100644
index 0000000000..6769dd60bd
--- /dev/null
+++ b/actionview/test/fixtures/test/hello_world.erb
@@ -0,0 +1 @@
+Hello world! \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/hello_world.erb~ b/actionview/test/fixtures/test/hello_world.erb~
index 21934a1c95..21934a1c95 100644
--- a/actionpack/test/fixtures/test/hello_world.erb~
+++ b/actionview/test/fixtures/test/hello_world.erb~
diff --git a/actionpack/test/fixtures/test/hello_world.pt-BR.html.erb b/actionview/test/fixtures/test/hello_world.pt-BR.html.erb
index 773b3c8c6e..773b3c8c6e 100644
--- a/actionpack/test/fixtures/test/hello_world.pt-BR.html.erb
+++ b/actionview/test/fixtures/test/hello_world.pt-BR.html.erb
diff --git a/actionview/test/fixtures/test/hello_world_with_partial.html.erb b/actionview/test/fixtures/test/hello_world_with_partial.html.erb
new file mode 100644
index 0000000000..ec31545356
--- /dev/null
+++ b/actionview/test/fixtures/test/hello_world_with_partial.html.erb
@@ -0,0 +1,2 @@
+Hello world!
+<%= render '/test/partial' %>
diff --git a/actionview/test/fixtures/test/html_template.html.erb b/actionview/test/fixtures/test/html_template.html.erb
new file mode 100644
index 0000000000..1bbc2b7f09
--- /dev/null
+++ b/actionview/test/fixtures/test/html_template.html.erb
@@ -0,0 +1 @@
+<%= render :partial => "test/first_json_partial", formats: :json %> \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/layout_render_file.erb b/actionview/test/fixtures/test/layout_render_file.erb
index 2f8e921c5f..2f8e921c5f 100644
--- a/actionpack/test/fixtures/test/layout_render_file.erb
+++ b/actionview/test/fixtures/test/layout_render_file.erb
diff --git a/actionpack/test/fixtures/test/layout_render_object.erb b/actionview/test/fixtures/test/layout_render_object.erb
index acc4453c08..acc4453c08 100644
--- a/actionpack/test/fixtures/test/layout_render_object.erb
+++ b/actionview/test/fixtures/test/layout_render_object.erb
diff --git a/actionview/test/fixtures/test/list.erb b/actionview/test/fixtures/test/list.erb
new file mode 100644
index 0000000000..0a4bda58ee
--- /dev/null
+++ b/actionview/test/fixtures/test/list.erb
@@ -0,0 +1 @@
+<%= @test_unchanged = 'goodbye' %><%= render :partial => 'customer', :collection => @customers %><%= @test_unchanged %>
diff --git a/actionpack/test/fixtures/test/malformed/malformed.en.html.erb~ b/actionview/test/fixtures/test/malformed/malformed.en.html.erb~
index d009950384..d009950384 100644
--- a/actionpack/test/fixtures/test/malformed/malformed.en.html.erb~
+++ b/actionview/test/fixtures/test/malformed/malformed.en.html.erb~
diff --git a/actionpack/test/fixtures/test/malformed/malformed.erb~ b/actionview/test/fixtures/test/malformed/malformed.erb~
index d009950384..d009950384 100644
--- a/actionpack/test/fixtures/test/malformed/malformed.erb~
+++ b/actionview/test/fixtures/test/malformed/malformed.erb~
diff --git a/actionpack/test/fixtures/test/malformed/malformed.html.erb~ b/actionview/test/fixtures/test/malformed/malformed.html.erb~
index d009950384..d009950384 100644
--- a/actionpack/test/fixtures/test/malformed/malformed.html.erb~
+++ b/actionview/test/fixtures/test/malformed/malformed.html.erb~
diff --git a/actionview/test/fixtures/test/malformed/malformed~ b/actionview/test/fixtures/test/malformed/malformed~
new file mode 100644
index 0000000000..d009950384
--- /dev/null
+++ b/actionview/test/fixtures/test/malformed/malformed~
@@ -0,0 +1 @@
+Don't render me! \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/nested_layout.erb b/actionview/test/fixtures/test/nested_layout.erb
index 6078f74b4c..6078f74b4c 100644
--- a/actionpack/test/fixtures/test/nested_layout.erb
+++ b/actionview/test/fixtures/test/nested_layout.erb
diff --git a/actionpack/test/fixtures/test/nested_streaming.erb b/actionview/test/fixtures/test/nested_streaming.erb
index 55525e0c92..55525e0c92 100644
--- a/actionpack/test/fixtures/test/nested_streaming.erb
+++ b/actionview/test/fixtures/test/nested_streaming.erb
diff --git a/actionpack/test/fixtures/test/one.html.erb b/actionview/test/fixtures/test/one.html.erb
index 0151874809..0151874809 100644
--- a/actionpack/test/fixtures/test/one.html.erb
+++ b/actionview/test/fixtures/test/one.html.erb
diff --git a/actionview/test/fixtures/test/render_file_with_ivar.erb b/actionview/test/fixtures/test/render_file_with_ivar.erb
new file mode 100644
index 0000000000..8b8a449236
--- /dev/null
+++ b/actionview/test/fixtures/test/render_file_with_ivar.erb
@@ -0,0 +1 @@
+The secret is <%= @secret %>
diff --git a/actionview/test/fixtures/test/render_file_with_locals.erb b/actionview/test/fixtures/test/render_file_with_locals.erb
new file mode 100644
index 0000000000..ebe09faee6
--- /dev/null
+++ b/actionview/test/fixtures/test/render_file_with_locals.erb
@@ -0,0 +1 @@
+The secret is <%= secret %>
diff --git a/actionview/test/fixtures/test/render_file_with_locals_and_default.erb b/actionview/test/fixtures/test/render_file_with_locals_and_default.erb
new file mode 100644
index 0000000000..9b4900acc5
--- /dev/null
+++ b/actionview/test/fixtures/test/render_file_with_locals_and_default.erb
@@ -0,0 +1 @@
+<%= secret ||= 'one' %> \ No newline at end of file
diff --git a/actionview/test/fixtures/test/render_partial_inside_directory.html.erb b/actionview/test/fixtures/test/render_partial_inside_directory.html.erb
new file mode 100644
index 0000000000..1461b95186
--- /dev/null
+++ b/actionview/test/fixtures/test/render_partial_inside_directory.html.erb
@@ -0,0 +1 @@
+<%= render partial: 'test/_directory/partial_with_locales', locals: {'name' => 'Jane'} %>
diff --git a/actionview/test/fixtures/test/render_two_partials.html.erb b/actionview/test/fixtures/test/render_two_partials.html.erb
new file mode 100644
index 0000000000..3db6025860
--- /dev/null
+++ b/actionview/test/fixtures/test/render_two_partials.html.erb
@@ -0,0 +1,2 @@
+<%= render :partial => 'partial', :locals => {'first' => '1'} %>
+<%= render :partial => 'partial', :locals => {'second' => '2'} %>
diff --git a/actionpack/test/fixtures/test/streaming.erb b/actionview/test/fixtures/test/streaming.erb
index fb9b8b1ade..fb9b8b1ade 100644
--- a/actionpack/test/fixtures/test/streaming.erb
+++ b/actionview/test/fixtures/test/streaming.erb
diff --git a/actionpack/test/fixtures/test/streaming_buster.erb b/actionview/test/fixtures/test/streaming_buster.erb
index 4221d56dcc..4221d56dcc 100644
--- a/actionpack/test/fixtures/test/streaming_buster.erb
+++ b/actionview/test/fixtures/test/streaming_buster.erb
diff --git a/actionpack/test/fixtures/test/sub_template_raise.html.erb b/actionview/test/fixtures/test/sub_template_raise.html.erb
index f38c0bda90..f38c0bda90 100644
--- a/actionpack/test/fixtures/test/sub_template_raise.html.erb
+++ b/actionview/test/fixtures/test/sub_template_raise.html.erb
diff --git a/actionpack/test/fixtures/test/template.erb b/actionview/test/fixtures/test/template.erb
index 785afa8f6a..785afa8f6a 100644
--- a/actionpack/test/fixtures/test/template.erb
+++ b/actionview/test/fixtures/test/template.erb
diff --git a/actionpack/test/fixtures/test/update_element_with_capture.erb b/actionview/test/fixtures/test/update_element_with_capture.erb
index fa3ef200f9..fa3ef200f9 100644
--- a/actionpack/test/fixtures/test/update_element_with_capture.erb
+++ b/actionview/test/fixtures/test/update_element_with_capture.erb
diff --git a/actionpack/test/fixtures/test/utf8.html.erb b/actionview/test/fixtures/test/utf8.html.erb
index ac98c2f012..ac98c2f012 100644
--- a/actionpack/test/fixtures/test/utf8.html.erb
+++ b/actionview/test/fixtures/test/utf8.html.erb
diff --git a/actionpack/test/fixtures/test/utf8_magic.html.erb b/actionview/test/fixtures/test/utf8_magic.html.erb
index 257279c29f..257279c29f 100644
--- a/actionpack/test/fixtures/test/utf8_magic.html.erb
+++ b/actionview/test/fixtures/test/utf8_magic.html.erb
diff --git a/actionpack/test/fixtures/test/utf8_magic_with_bare_partial.html.erb b/actionview/test/fixtures/test/utf8_magic_with_bare_partial.html.erb
index cb22692f9a..cb22692f9a 100644
--- a/actionpack/test/fixtures/test/utf8_magic_with_bare_partial.html.erb
+++ b/actionview/test/fixtures/test/utf8_magic_with_bare_partial.html.erb
diff --git a/actionpack/test/fixtures/topic.rb b/actionview/test/fixtures/topic.rb
index 9fa9746535..9fa9746535 100644
--- a/actionpack/test/fixtures/topic.rb
+++ b/actionview/test/fixtures/topic.rb
diff --git a/actionpack/test/fixtures/topics.yml b/actionview/test/fixtures/topics.yml
index 7fdd49d54e..7fdd49d54e 100644
--- a/actionpack/test/fixtures/topics.yml
+++ b/actionview/test/fixtures/topics.yml
diff --git a/actionpack/test/fixtures/topics/_topic.html.erb b/actionview/test/fixtures/topics/_topic.html.erb
index 98659ca098..98659ca098 100644
--- a/actionpack/test/fixtures/topics/_topic.html.erb
+++ b/actionview/test/fixtures/topics/_topic.html.erb
diff --git a/actionpack/test/fixtures/translations/templates/array.erb b/actionview/test/fixtures/translations/templates/array.erb
index d86045a172..d86045a172 100644
--- a/actionpack/test/fixtures/translations/templates/array.erb
+++ b/actionview/test/fixtures/translations/templates/array.erb
diff --git a/actionpack/test/fixtures/translations/templates/default.erb b/actionview/test/fixtures/translations/templates/default.erb
index 8b70031071..8b70031071 100644
--- a/actionpack/test/fixtures/translations/templates/default.erb
+++ b/actionview/test/fixtures/translations/templates/default.erb
diff --git a/actionpack/test/fixtures/translations/templates/found.erb b/actionview/test/fixtures/translations/templates/found.erb
index 080c9c0aee..080c9c0aee 100644
--- a/actionpack/test/fixtures/translations/templates/found.erb
+++ b/actionview/test/fixtures/translations/templates/found.erb
diff --git a/actionpack/test/fixtures/translations/templates/missing.erb b/actionview/test/fixtures/translations/templates/missing.erb
index 0f3f17f8ef..0f3f17f8ef 100644
--- a/actionpack/test/fixtures/translations/templates/missing.erb
+++ b/actionview/test/fixtures/translations/templates/missing.erb
diff --git a/actionpack/test/fixtures/with_format.json.erb b/actionview/test/fixtures/with_format.json.erb
index a7f480ab1d..a7f480ab1d 100644
--- a/actionpack/test/fixtures/with_format.json.erb
+++ b/actionview/test/fixtures/with_format.json.erb
diff --git a/actionview/test/lib/controller/fake_controllers.rb b/actionview/test/lib/controller/fake_controllers.rb
new file mode 100644
index 0000000000..1a2863b689
--- /dev/null
+++ b/actionview/test/lib/controller/fake_controllers.rb
@@ -0,0 +1,35 @@
+class ContentController < ActionController::Base; end
+
+module Admin
+ class AccountsController < ActionController::Base; end
+ class PostsController < ActionController::Base; end
+ class StuffController < ActionController::Base; end
+ class UserController < ActionController::Base; end
+ class UsersController < ActionController::Base; end
+end
+
+module Api
+ class UsersController < ActionController::Base; end
+ class ProductsController < ActionController::Base; end
+end
+
+class AccountController < ActionController::Base; end
+class ArchiveController < ActionController::Base; end
+class ArticlesController < ActionController::Base; end
+class BarController < ActionController::Base; end
+class BlogController < ActionController::Base; end
+class BooksController < ActionController::Base; end
+class CarsController < ActionController::Base; end
+class CcController < ActionController::Base; end
+class CController < ActionController::Base; end
+class FooController < ActionController::Base; end
+class GeocodeController < ActionController::Base; end
+class NewsController < ActionController::Base; end
+class NotesController < ActionController::Base; end
+class PagesController < ActionController::Base; end
+class PeopleController < ActionController::Base; end
+class PostsController < ActionController::Base; end
+class SubpathBooksController < ActionController::Base; end
+class SymbolsController < ActionController::Base; end
+class UserController < ActionController::Base; end
+class UsersController < ActionController::Base; end
diff --git a/actionview/test/lib/controller/fake_models.rb b/actionview/test/lib/controller/fake_models.rb
new file mode 100644
index 0000000000..a463a08bb6
--- /dev/null
+++ b/actionview/test/lib/controller/fake_models.rb
@@ -0,0 +1,185 @@
+require "active_model"
+
+class Customer < Struct.new(:name, :id)
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+
+ undef_method :to_json
+
+ def to_xml(options={})
+ if options[:builder]
+ options[:builder].name name
+ else
+ "<name>#{name}</name>"
+ end
+ end
+
+ def to_js(options={})
+ "name: #{name.inspect}"
+ end
+ alias :to_text :to_js
+
+ def errors
+ []
+ end
+
+ def persisted?
+ id.present?
+ end
+end
+
+class GoodCustomer < Customer
+end
+
+class Post < Struct.new(:title, :author_name, :body, :secret, :persisted, :written_on, :cost)
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+ extend ActiveModel::Translation
+
+ alias_method :secret?, :secret
+ alias_method :persisted?, :persisted
+
+ def initialize(*args)
+ super
+ @persisted = false
+ end
+
+ attr_accessor :author
+ def author_attributes=(attributes); end
+
+ attr_accessor :comments, :comment_ids
+ def comments_attributes=(attributes); end
+
+ attr_accessor :tags
+ def tags_attributes=(attributes); end
+end
+
+class Comment
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+
+ attr_reader :id
+ attr_reader :post_id
+ def initialize(id = nil, post_id = nil); @id, @post_id = id, post_id end
+ def to_key; id ? [id] : nil end
+ def save; @id = 1; @post_id = 1 end
+ def persisted?; @id.present? end
+ def to_param; @id.to_s; end
+ def name
+ @id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}"
+ end
+
+ attr_accessor :relevances
+ def relevances_attributes=(attributes); end
+
+ attr_accessor :body
+end
+
+class Tag
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+
+ attr_reader :id
+ attr_reader :post_id
+ def initialize(id = nil, post_id = nil); @id, @post_id = id, post_id end
+ def to_key; id ? [id] : nil end
+ def save; @id = 1; @post_id = 1 end
+ def persisted?; @id.present? end
+ def to_param; @id; end
+ def value
+ @id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}"
+ end
+
+ attr_accessor :relevances
+ def relevances_attributes=(attributes); end
+
+end
+
+class CommentRelevance
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+
+ attr_reader :id
+ attr_reader :comment_id
+ def initialize(id = nil, comment_id = nil); @id, @comment_id = id, comment_id end
+ def to_key; id ? [id] : nil end
+ def save; @id = 1; @comment_id = 1 end
+ def persisted?; @id.present? end
+ def to_param; @id; end
+ def value
+ @id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}"
+ end
+end
+
+class Sheep
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+
+ attr_reader :id
+ def to_key; id ? [id] : nil end
+ def save; @id = 1 end
+ def new_record?; @id.nil? end
+ def name
+ @id.nil? ? 'new sheep' : "sheep ##{@id}"
+ end
+end
+
+class TagRelevance
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+
+ attr_reader :id
+ attr_reader :tag_id
+ def initialize(id = nil, tag_id = nil); @id, @tag_id = id, tag_id end
+ def to_key; id ? [id] : nil end
+ def save; @id = 1; @tag_id = 1 end
+ def persisted?; @id.present? end
+ def to_param; @id; end
+ def value
+ @id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}"
+ end
+end
+
+class Author < Comment
+ attr_accessor :post
+ def post_attributes=(attributes); end
+end
+
+class HashBackedAuthor < Hash
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+
+ def persisted?; false; end
+
+ def name
+ "hash backed author"
+ end
+end
+
+module Blog
+ def self.use_relative_model_naming?
+ true
+ end
+
+ class Post < Struct.new(:title, :id)
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+
+ def persisted?
+ id.present?
+ end
+ end
+end
+
+class ArelLike
+ def to_ary
+ true
+ end
+ def each
+ a = Array.new(2) { |id| Comment.new(id + 1) }
+ a.each { |i| yield i }
+ end
+end
+
+class Car < Struct.new(:color)
+end
diff --git a/actionpack/test/template/active_model_helper_test.rb b/actionview/test/template/active_model_helper_test.rb
index 86bccdfade..86bccdfade 100644
--- a/actionpack/test/template/active_model_helper_test.rb
+++ b/actionview/test/template/active_model_helper_test.rb
diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionview/test/template/asset_tag_helper_test.rb
index 8d0ab7fd81..214a13654e 100644
--- a/actionpack/test/template/asset_tag_helper_test.rb
+++ b/actionview/test/template/asset_tag_helper_test.rb
@@ -48,6 +48,9 @@ class AssetTagHelperTest < ActionView::TestCase
%(asset_path("style.min")) => %(/style.min),
%(asset_path("style.min.css")) => %(/style.min.css),
+ %(asset_path("http://www.outside.com/image.jpg")) => %(http://www.outside.com/image.jpg),
+ %(asset_path("HTTP://www.outside.com/image.jpg")) => %(HTTP://www.outside.com/image.jpg),
+
%(asset_path("style", type: :stylesheet)) => %(/stylesheets/style.css),
%(asset_path("xmlhr", type: :javascript)) => %(/javascripts/xmlhr.js),
%(asset_path("xml.png", type: :image)) => %(/images/xml.png)
@@ -445,8 +448,8 @@ class AssetTagHelperTest < ActionView::TestCase
[nil, '/', '/foo/bar/', 'foo/bar/'].each do |prefix|
assert_equal 'Rails', image_alt("#{prefix}rails.png")
assert_equal 'Rails', image_alt("#{prefix}rails-9c0a079bdd7701d7e729bd956823d153.png")
- assert_equal 'Long file name with hyphens', image_alt("#{prefix}long-file-name-with-hyphens.png")
- assert_equal 'Long file name with underscores', image_alt("#{prefix}long_file_name_with_underscores.png")
+ assert_equal 'Long file name with hyphens', image_alt("#{prefix}long-file-name-with-hyphens.png")
+ assert_equal 'Long file name with underscores', image_alt("#{prefix}long_file_name_with_underscores.png")
end
end
diff --git a/actionpack/test/template/atom_feed_helper_test.rb b/actionview/test/template/atom_feed_helper_test.rb
index 63b5ac0fab..63b5ac0fab 100644
--- a/actionpack/test/template/atom_feed_helper_test.rb
+++ b/actionview/test/template/atom_feed_helper_test.rb
diff --git a/actionpack/test/template/capture_helper_test.rb b/actionview/test/template/capture_helper_test.rb
index 938f1c3e54..938f1c3e54 100644
--- a/actionpack/test/template/capture_helper_test.rb
+++ b/actionview/test/template/capture_helper_test.rb
diff --git a/actionpack/test/template/compiled_templates_test.rb b/actionview/test/template/compiled_templates_test.rb
index f5dc2fbb33..2336321f3e 100644
--- a/actionpack/test/template/compiled_templates_test.rb
+++ b/actionview/test/template/compiled_templates_test.rb
@@ -1,5 +1,4 @@
require 'abstract_unit'
-require 'controller/fake_models'
class CompiledTemplatesTest < ActiveSupport::TestCase
def setup
diff --git a/actionpack/test/template/date_helper_i18n_test.rb b/actionview/test/template/date_helper_i18n_test.rb
index 21fca35185..21fca35185 100644
--- a/actionpack/test/template/date_helper_i18n_test.rb
+++ b/actionview/test/template/date_helper_i18n_test.rb
diff --git a/actionpack/test/template/date_helper_test.rb b/actionview/test/template/date_helper_test.rb
index 242b56a1fd..242b56a1fd 100644
--- a/actionpack/test/template/date_helper_test.rb
+++ b/actionview/test/template/date_helper_test.rb
diff --git a/actionpack/test/template/debug_helper_test.rb b/actionview/test/template/debug_helper_test.rb
index 42d06bd9ff..42d06bd9ff 100644
--- a/actionpack/test/template/debug_helper_test.rb
+++ b/actionview/test/template/debug_helper_test.rb
diff --git a/actionpack/test/template/dependency_tracker_test.rb b/actionview/test/template/dependency_tracker_test.rb
index 7a9b4b26ac..7a9b4b26ac 100644
--- a/actionpack/test/template/dependency_tracker_test.rb
+++ b/actionview/test/template/dependency_tracker_test.rb
diff --git a/actionpack/test/template/digestor_test.rb b/actionview/test/template/digestor_test.rb
index 06735c30d3..06735c30d3 100644
--- a/actionpack/test/template/digestor_test.rb
+++ b/actionview/test/template/digestor_test.rb
diff --git a/actionpack/test/template/erb/form_for_test.rb b/actionview/test/template/erb/form_for_test.rb
index e722b40a9a..e722b40a9a 100644
--- a/actionpack/test/template/erb/form_for_test.rb
+++ b/actionview/test/template/erb/form_for_test.rb
diff --git a/actionpack/test/template/erb/helper.rb b/actionview/test/template/erb/helper.rb
index a1973068d5..a1973068d5 100644
--- a/actionpack/test/template/erb/helper.rb
+++ b/actionview/test/template/erb/helper.rb
diff --git a/actionpack/test/template/erb/tag_helper_test.rb b/actionview/test/template/erb/tag_helper_test.rb
index 84e328d8be..84e328d8be 100644
--- a/actionpack/test/template/erb/tag_helper_test.rb
+++ b/actionview/test/template/erb/tag_helper_test.rb
diff --git a/actionpack/test/template/erb_util_test.rb b/actionview/test/template/erb_util_test.rb
index 3e5b029cea..3e5b029cea 100644
--- a/actionpack/test/template/erb_util_test.rb
+++ b/actionview/test/template/erb_util_test.rb
diff --git a/actionpack/test/template/form_collections_helper_test.rb b/actionview/test/template/form_collections_helper_test.rb
index 2131f81396..bc9c21dfd3 100644
--- a/actionpack/test/template/form_collections_helper_test.rb
+++ b/actionview/test/template/form_collections_helper_test.rb
@@ -76,6 +76,14 @@ class FormCollectionsHelperTest < ActionView::TestCase
assert_select 'input[type=radio][value=false].special-radio#user_active_false'
end
+ test 'collection radio accepts html options as the last element of array' do
+ collection = [[1, true, {class: 'foo'}], [0, false, {class: 'bar'}]]
+ with_collection_radio_buttons :user, :active, collection, :second, :first
+
+ assert_select 'input[type=radio][value=true].foo#user_active_true'
+ assert_select 'input[type=radio][value=false].bar#user_active_false'
+ end
+
test 'collection radio does not wrap input inside the label' do
with_collection_radio_buttons :user, :active, [true, false], :to_s, :to_s
@@ -192,6 +200,14 @@ class FormCollectionsHelperTest < ActionView::TestCase
assert_select 'label[for=user_name_199]', '$1.99'
end
+ test 'collection check boxes accepts html options as the last element of array' do
+ collection = [[1, 'Category 1', {class: 'foo'}], [2, 'Category 2', {class: 'bar'}]]
+ with_collection_check_boxes :user, :active, collection, :first, :second
+
+ assert_select 'input[type=checkbox][value=1].foo'
+ assert_select 'input[type=checkbox][value=2].bar'
+ end
+
test 'collection check boxes accepts selected values as :checked option' do
collection = (1..3).map{|i| [i, "Category #{i}"] }
with_collection_check_boxes :user, :category_ids, collection, :first, :last, :checked => [1, 3]
diff --git a/actionpack/test/template/form_helper_test.rb b/actionview/test/template/form_helper_test.rb
index 1ff320224d..1ff320224d 100644
--- a/actionpack/test/template/form_helper_test.rb
+++ b/actionview/test/template/form_helper_test.rb
diff --git a/actionpack/test/template/form_options_helper_i18n_test.rb b/actionview/test/template/form_options_helper_i18n_test.rb
index 4972ea6511..4972ea6511 100644
--- a/actionpack/test/template/form_options_helper_i18n_test.rb
+++ b/actionview/test/template/form_options_helper_i18n_test.rb
diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionview/test/template/form_options_helper_test.rb
index 1715902927..1715902927 100644
--- a/actionpack/test/template/form_options_helper_test.rb
+++ b/actionview/test/template/form_options_helper_test.rb
diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionview/test/template/form_tag_helper_test.rb
index 70fc6a588b..70fc6a588b 100644
--- a/actionpack/test/template/form_tag_helper_test.rb
+++ b/actionview/test/template/form_tag_helper_test.rb
diff --git a/actionpack/test/template/html-scanner/cdata_node_test.rb b/actionview/test/template/html-scanner/cdata_node_test.rb
index 9b58174641..9b58174641 100644
--- a/actionpack/test/template/html-scanner/cdata_node_test.rb
+++ b/actionview/test/template/html-scanner/cdata_node_test.rb
diff --git a/actionpack/test/template/html-scanner/document_test.rb b/actionview/test/template/html-scanner/document_test.rb
index 17f045d549..17f045d549 100644
--- a/actionpack/test/template/html-scanner/document_test.rb
+++ b/actionview/test/template/html-scanner/document_test.rb
diff --git a/actionpack/test/template/html-scanner/node_test.rb b/actionview/test/template/html-scanner/node_test.rb
index 5b5d092036..5b5d092036 100644
--- a/actionpack/test/template/html-scanner/node_test.rb
+++ b/actionview/test/template/html-scanner/node_test.rb
diff --git a/actionpack/test/template/html-scanner/sanitizer_test.rb b/actionview/test/template/html-scanner/sanitizer_test.rb
index b1c1b83807..b1c1b83807 100644
--- a/actionpack/test/template/html-scanner/sanitizer_test.rb
+++ b/actionview/test/template/html-scanner/sanitizer_test.rb
diff --git a/actionpack/test/template/html-scanner/tag_node_test.rb b/actionview/test/template/html-scanner/tag_node_test.rb
index a29d2d43d7..a29d2d43d7 100644
--- a/actionpack/test/template/html-scanner/tag_node_test.rb
+++ b/actionview/test/template/html-scanner/tag_node_test.rb
diff --git a/actionpack/test/template/html-scanner/text_node_test.rb b/actionview/test/template/html-scanner/text_node_test.rb
index cbcb9e78f0..cbcb9e78f0 100644
--- a/actionpack/test/template/html-scanner/text_node_test.rb
+++ b/actionview/test/template/html-scanner/text_node_test.rb
diff --git a/actionpack/test/template/html-scanner/tokenizer_test.rb b/actionview/test/template/html-scanner/tokenizer_test.rb
index 1d59de23b6..1d59de23b6 100644
--- a/actionpack/test/template/html-scanner/tokenizer_test.rb
+++ b/actionview/test/template/html-scanner/tokenizer_test.rb
diff --git a/actionpack/test/template/javascript_helper_test.rb b/actionview/test/template/javascript_helper_test.rb
index de6a6eaab3..de6a6eaab3 100644
--- a/actionpack/test/template/javascript_helper_test.rb
+++ b/actionview/test/template/javascript_helper_test.rb
diff --git a/actionpack/test/template/log_subscriber_test.rb b/actionview/test/template/log_subscriber_test.rb
index 7f4c84929f..7f4c84929f 100644
--- a/actionpack/test/template/log_subscriber_test.rb
+++ b/actionview/test/template/log_subscriber_test.rb
diff --git a/actionpack/test/template/lookup_context_test.rb b/actionview/test/template/lookup_context_test.rb
index 073bd14783..073bd14783 100644
--- a/actionpack/test/template/lookup_context_test.rb
+++ b/actionview/test/template/lookup_context_test.rb
diff --git a/actionpack/test/template/number_helper_test.rb b/actionview/test/template/number_helper_test.rb
index 6e640889d2..6e640889d2 100644
--- a/actionpack/test/template/number_helper_test.rb
+++ b/actionview/test/template/number_helper_test.rb
diff --git a/actionpack/test/template/output_buffer_test.rb b/actionview/test/template/output_buffer_test.rb
index eb0df3d1ab..eb0df3d1ab 100644
--- a/actionpack/test/template/output_buffer_test.rb
+++ b/actionview/test/template/output_buffer_test.rb
diff --git a/actionpack/test/template/output_safety_helper_test.rb b/actionview/test/template/output_safety_helper_test.rb
index 76c71c9e6d..76c71c9e6d 100644
--- a/actionpack/test/template/output_safety_helper_test.rb
+++ b/actionview/test/template/output_safety_helper_test.rb
diff --git a/actionpack/test/template/record_identifier_test.rb b/actionview/test/template/record_identifier_test.rb
index 22038110a5..22038110a5 100644
--- a/actionpack/test/template/record_identifier_test.rb
+++ b/actionview/test/template/record_identifier_test.rb
diff --git a/actionpack/test/template/record_tag_helper_test.rb b/actionview/test/template/record_tag_helper_test.rb
index ab84bccb56..ab84bccb56 100644
--- a/actionpack/test/template/record_tag_helper_test.rb
+++ b/actionview/test/template/record_tag_helper_test.rb
diff --git a/actionpack/test/template/render_test.rb b/actionview/test/template/render_test.rb
index 81f3391fcd..8cffe73cce 100644
--- a/actionpack/test/template/render_test.rb
+++ b/actionview/test/template/render_test.rb
@@ -376,6 +376,7 @@ module RenderTestCases
def test_render_ignores_templates_with_malformed_template_handlers
ActiveSupport::Deprecation.silence do
%w(malformed malformed.erb malformed.html.erb malformed.en.html.erb).each do |name|
+ assert File.exists?(File.expand_path("#{FIXTURE_LOAD_PATH}/test/malformed/#{name}~")), "Malformed file (#{name}~) which should be ignored does not exists"
assert_raises(ActionView::MissingTemplate) { @view.render(:file => "test/malformed/#{name}") }
end
end
diff --git a/actionpack/test/template/resolver_patterns_test.rb b/actionview/test/template/resolver_patterns_test.rb
index 97b1bad055..97b1bad055 100644
--- a/actionpack/test/template/resolver_patterns_test.rb
+++ b/actionview/test/template/resolver_patterns_test.rb
diff --git a/actionpack/test/template/sanitize_helper_test.rb b/actionview/test/template/sanitize_helper_test.rb
index 12d5260a9d..12d5260a9d 100644
--- a/actionpack/test/template/sanitize_helper_test.rb
+++ b/actionview/test/template/sanitize_helper_test.rb
diff --git a/actionpack/test/template/streaming_render_test.rb b/actionview/test/template/streaming_render_test.rb
index 520bf3a824..8a24d78e74 100644
--- a/actionpack/test/template/streaming_render_test.rb
+++ b/actionview/test/template/streaming_render_test.rb
@@ -1,6 +1,5 @@
# encoding: utf-8
require 'abstract_unit'
-require 'controller/fake_models'
class TestController < ActionController::Base
end
diff --git a/actionpack/test/template/tag_helper_test.rb b/actionview/test/template/tag_helper_test.rb
index 9e711c6529..802da5d566 100644
--- a/actionpack/test/template/tag_helper_test.rb
+++ b/actionview/test/template/tag_helper_test.rb
@@ -30,8 +30,8 @@ class TagHelperTest < ActionView::TestCase
end
def test_tag_options_converts_boolean_option
- assert_equal '<p disabled="disabled" itemscope="itemscope" multiple="multiple" readonly="readonly" />',
- tag("p", :disabled => true, :itemscope => true, :multiple => true, :readonly => true)
+ assert_dom_equal '<p disabled="disabled" itemscope="itemscope" multiple="multiple" readonly="readonly" allowfullscreen="allowfullscreen" seamless="seamless" typemustmatch="typemustmatch" sortable="sortable" default="default" inert="inert" truespeed="truespeed" />',
+ tag("p", :disabled => true, :itemscope => true, :multiple => true, :readonly => true, :allowfullscreen => true, :seamless => true, :typemustmatch => true, :sortable => true, :default => true, :inert => true, :truespeed => true)
end
def test_content_tag
diff --git a/actionpack/test/template/template_error_test.rb b/actionview/test/template/template_error_test.rb
index 91424daeed..91424daeed 100644
--- a/actionpack/test/template/template_error_test.rb
+++ b/actionview/test/template/template_error_test.rb
diff --git a/actionpack/test/template/template_test.rb b/actionview/test/template/template_test.rb
index c94508d678..c94508d678 100644
--- a/actionpack/test/template/template_test.rb
+++ b/actionview/test/template/template_test.rb
diff --git a/actionpack/test/template/test_case_test.rb b/actionview/test/template/test_case_test.rb
index acd002ce73..4ee0930341 100644
--- a/actionpack/test/template/test_case_test.rb
+++ b/actionview/test/template/test_case_test.rb
@@ -1,5 +1,4 @@
require 'abstract_unit'
-require 'controller/fake_controllers'
module ActionView
diff --git a/actionpack/test/template/test_test.rb b/actionview/test/template/test_test.rb
index 108a674d95..108a674d95 100644
--- a/actionpack/test/template/test_test.rb
+++ b/actionview/test/template/test_test.rb
diff --git a/actionpack/test/template/testing/fixture_resolver_test.rb b/actionview/test/template/testing/fixture_resolver_test.rb
index 9649f349cb..9649f349cb 100644
--- a/actionpack/test/template/testing/fixture_resolver_test.rb
+++ b/actionview/test/template/testing/fixture_resolver_test.rb
diff --git a/actionpack/test/template/testing/null_resolver_test.rb b/actionview/test/template/testing/null_resolver_test.rb
index 55ec36e753..55ec36e753 100644
--- a/actionpack/test/template/testing/null_resolver_test.rb
+++ b/actionview/test/template/testing/null_resolver_test.rb
diff --git a/actionpack/test/template/text_helper_test.rb b/actionview/test/template/text_helper_test.rb
index 1b2234f4e2..1b2234f4e2 100644
--- a/actionpack/test/template/text_helper_test.rb
+++ b/actionview/test/template/text_helper_test.rb
diff --git a/actionpack/test/template/translation_helper_test.rb b/actionview/test/template/translation_helper_test.rb
index d496dbb35e..d496dbb35e 100644
--- a/actionpack/test/template/translation_helper_test.rb
+++ b/actionview/test/template/translation_helper_test.rb
diff --git a/actionpack/test/template/url_helper_test.rb b/actionview/test/template/url_helper_test.rb
index f63f235a5c..8373d7f992 100644
--- a/actionpack/test/template/url_helper_test.rb
+++ b/actionview/test/template/url_helper_test.rb
@@ -1,6 +1,5 @@
# encoding: utf-8
require 'abstract_unit'
-require 'controller/fake_controllers'
class UrlHelperTest < ActiveSupport::TestCase
@@ -348,6 +347,11 @@ class UrlHelperTest < ActiveSupport::TestCase
link_to_unless(true, "Showing", url_hash) {
"test"
}
+
+ assert_equal %{&lt;b&gt;Showing&lt;/b&gt;}, link_to_unless(true, "<b>Showing</b>", url_hash)
+ assert_equal %{<a href="/">&lt;b&gt;Showing&lt;/b&gt;</a>}, link_to_unless(false, "<b>Showing</b>", url_hash)
+ assert_equal %{<b>Showing</b>}, link_to_unless(true, "<b>Showing</b>".html_safe, url_hash)
+ assert_equal %{<a href="/"><b>Showing</b></a>}, link_to_unless(false, "<b>Showing</b>".html_safe, url_hash)
end
def test_link_to_if
diff --git a/activemodel/Rakefile b/activemodel/Rakefile
index 45d1587ed6..f72b949c64 100644
--- a/activemodel/Rakefile
+++ b/activemodel/Rakefile
@@ -28,7 +28,7 @@ Gem::PackageTask.new(spec) do |p|
p.gem_spec = spec
end
-desc "Release to gemcutter"
+desc "Release to rubygems"
task :release => :package do
require 'rake/gemcutter'
Rake::Gemcutter::Tasks.new(spec).define
diff --git a/activemodel/lib/active_model/model.rb b/activemodel/lib/active_model/model.rb
index 62383a03e8..f048dda5c6 100644
--- a/activemodel/lib/active_model/model.rb
+++ b/activemodel/lib/active_model/model.rb
@@ -79,6 +79,8 @@ module ActiveModel
params.each do |attr, value|
self.public_send("#{attr}=", value)
end if params
+
+ super()
end
# Indicates if the model is persisted. Default is +false+.
diff --git a/activemodel/test/cases/model_test.rb b/activemodel/test/cases/model_test.rb
index 24e4ca91c6..ee0fa26546 100644
--- a/activemodel/test/cases/model_test.rb
+++ b/activemodel/test/cases/model_test.rb
@@ -3,7 +3,30 @@ require 'cases/helper'
class ModelTest < ActiveModel::TestCase
include ActiveModel::Lint::Tests
+ module DefaultValue
+ def self.included(klass)
+ klass.class_eval { attr_accessor :hello }
+ end
+
+ def initialize(*args)
+ @attr ||= 'default value'
+ super
+ end
+ end
+
class BasicModel
+ include DefaultValue
+ include ActiveModel::Model
+ attr_accessor :attr
+ end
+
+ class BasicModelWithReversedMixins
+ include ActiveModel::Model
+ include DefaultValue
+ attr_accessor :attr
+ end
+
+ class SimpleModel
include ActiveModel::Model
attr_accessor :attr
end
@@ -14,14 +37,20 @@ class ModelTest < ActiveModel::TestCase
def test_initialize_with_params
object = BasicModel.new(attr: "value")
- assert_equal object.attr, "value"
+ assert_equal "value", object.attr
+ end
+
+ def test_initialize_with_params_and_mixins_reversed
+ object = BasicModelWithReversedMixins.new(attr: "value")
+ assert_equal "value", object.attr
end
def test_initialize_with_nil_or_empty_hash_params_does_not_explode
assert_nothing_raised do
BasicModel.new()
- BasicModel.new nil
+ BasicModel.new(nil)
BasicModel.new({})
+ SimpleModel.new(attr: 'value')
end
end
@@ -29,4 +58,18 @@ class ModelTest < ActiveModel::TestCase
object = BasicModel.new(attr: "value")
assert object.persisted? == false
end
+
+ def test_mixin_inclusion_chain
+ object = BasicModel.new
+ assert_equal 'default value', object.attr
+ end
+
+ def test_mixin_initializer_when_args_exist
+ object = BasicModel.new(hello: 'world')
+ assert_equal 'world', object.hello
+ end
+
+ def test_mixin_initializer_when_args_dont_exist
+ assert_raises(NoMethodError) { SimpleModel.new(hello: 'world') }
+ end
end
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index ab1eb49286..4055dcd484 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,33 +1,98 @@
+* Flatten merged join_values before building the joins.
+
+ While joining_values special treatment is given to string values.
+ By flattening the array it ensures that string values are detected
+ as strings and not arrays.
+
+ Fixes #10669.
+
+ *Neeraj Singh and iwiznia*
+
+* Do not load all child records for inverse case.
+
+ currently `post.comments.find(Comment.first.id)` would load all
+ comments for the given post to set the inverse association.
+
+ This has a huge performance penalty. Because if post has 100k
+ records and all these 100k records would be loaded in memory
+ even though the comment id was supplied.
+
+ Fix is to use in-memory records only if loaded? is true. Otherwise
+ load the records using full sql.
+
+ Fixes #10509.
+
+ *Neeraj Singh*
+
+* `inspect` on Active Record model classes does not initiate a
+ new connection. This means that calling `inspect`, when the
+ database is missing, will no longer raise an exception.
+ Fixes #10936.
+
+ Example:
+
+ Author.inspect # => "Author(no database connection)"
+
+ *Yves Senn*
+
+* Handle single quotes in PostgreSQL default column values.
+ Fixes #10881.
+
+ *Dylan Markow*
+
+* Log the sql that is actually sent to the database.
+
+ If I have a query that produces sql
+ `WHERE "users"."name" = 'a b'` then in the log all the
+ whitespace is being squeezed. So the sql that is printed in the
+ log is `WHERE "users"."name" = 'a b'`.
+
+ Do not squeeze whitespace out of sql queries. Fixes #10982.
+
+ *Neeraj Singh*
+
+* Fixture setup does no longer depend on `ActiveRecord::Base.configurations`.
+ This is relevant when `ENV["DATABASE_URL"]` is used in place of a `database.yml`.
+
+ *Yves Senn*
+
+* Fix mysql2 adapter raises the correct exception when executing a query on a
+ closed connection.
+
+ *Yves Senn*
+
* Ambiguous reflections are on :through relationships are no longer supported.
For example, you need to change this:
- class Author < ActiveRecord::Base
- has_many :posts
- has_many :taggings, :through => :posts
- end
-
- class Post < ActiveRecord::Base
- has_one :tagging
- has_many :taggings
- end
-
- class Tagging < ActiveRecord::Base
- end
+ class Author < ActiveRecord::Base
+ has_many :posts
+ has_many :taggings, :through => :posts
+ end
+
+ class Post < ActiveRecord::Base
+ has_one :tagging
+ has_many :taggings
+ end
+
+ class Tagging < ActiveRecord::Base
+ end
To this:
- class Author < ActiveRecord::Base
- has_many :posts
- has_many :taggings, :through => :posts, :source => :tagging
- end
-
- class Post < ActiveRecord::Base
- has_one :tagging
- has_many :taggings
- end
-
- class Tagging < ActiveRecord::Base
- end
+ class Author < ActiveRecord::Base
+ has_many :posts
+ has_many :taggings, :through => :posts, :source => :tagging
+ end
+
+ class Post < ActiveRecord::Base
+ has_one :tagging
+ has_many :taggings
+ end
+
+ class Tagging < ActiveRecord::Base
+ end
+
+ *Aaron Peterson*
* Remove column restrictions for `count`, let the database raise if the SQL is
invalid. The previous behavior was untested and surprising for the user.
@@ -60,9 +125,9 @@
You can turn off the automatic detection of inverse associations by setting
the `:inverse_of` option to `false` like so:
- class Taggable < ActiveRecord::Base
- belongs_to :tag, inverse_of: false
- end
+ class Taggable < ActiveRecord::Base
+ belongs_to :tag, inverse_of: false
+ end
*John Wang*
@@ -100,7 +165,7 @@
* Deprecate `ConnectionAdapters::SchemaStatements#distinct`,
as it is no longer used by internals.
- *Ben Woosley#
+ *Ben Woosley*
* Fix pending migrations error when loading schema and `ActiveRecord::Base.table_name_prefix`
is not blank.
diff --git a/activerecord/Rakefile b/activerecord/Rakefile
index 136bb1dfbc..df0193e1b5 100644
--- a/activerecord/Rakefile
+++ b/activerecord/Rakefile
@@ -222,7 +222,7 @@ end
# Publishing ------------------------------------------------------
-desc "Release to gemcutter"
+desc "Release to rubygems"
task :release => :package do
require 'rake/gemcutter'
Rake::Gemcutter::Tasks.new(spec).define
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb
index efd7ecb97c..9833822f8f 100644
--- a/activerecord/lib/active_record/associations/collection_association.rb
+++ b/activerecord/lib/active_record/associations/collection_association.rb
@@ -81,7 +81,7 @@ module ActiveRecord
else
if options[:finder_sql]
find_by_scan(*args)
- elsif options[:inverse_of]
+ elsif options[:inverse_of] && loaded?
args = args.flatten
raise RecordNotFound, "Couldn't find #{scope.klass.name} without an ID" if args.blank?
diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb
index e82c195335..7cdb5ba5b3 100644
--- a/activerecord/lib/active_record/associations/collection_proxy.rb
+++ b/activerecord/lib/active_record/associations/collection_proxy.rb
@@ -830,7 +830,7 @@ module ActiveRecord
# person.pets.include?(Pet.find(20)) # => true
# person.pets.include?(Pet.find(21)) # => false
def include?(record)
- @association.include?(record)
+ !!@association.include?(record)
end
def proxy_association
diff --git a/activerecord/lib/active_record/attribute_methods/serialization.rb b/activerecord/lib/active_record/attribute_methods/serialization.rb
index 9caf73e627..1287de0d0d 100644
--- a/activerecord/lib/active_record/attribute_methods/serialization.rb
+++ b/activerecord/lib/active_record/attribute_methods/serialization.rb
@@ -56,7 +56,11 @@ module ActiveRecord
end
def type_cast(value)
- value.unserialized_value @column.type_cast value.value
+ if value.state == :serialized
+ value.unserialized_value @column.type_cast value.value
+ else
+ value.unserialized_value
+ end
end
def type
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
index 3ac55a0f11..9a1923dec5 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -214,8 +214,8 @@ module ActiveRecord
# its block form to do so yourself:
#
# create_join_table :products, :categories do |t|
- # t.index :products
- # t.index :categories
+ # t.index :product_id
+ # t.index :category_id
# end
#
# ====== Add a backend specific option to the generated SQL (MySQL)
diff --git a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
index 530a27d099..edeb338310 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
@@ -213,9 +213,11 @@ module ActiveRecord
# Executes the SQL statement in the context of this connection.
def execute(sql, name = nil)
- # make sure we carry over any changes to ActiveRecord::Base.default_timezone that have been
- # made since we established the connection
- @connection.query_options[:database_timezone] = ActiveRecord::Base.default_timezone
+ if @connection
+ # make sure we carry over any changes to ActiveRecord::Base.default_timezone that have been
+ # made since we established the connection
+ @connection.query_options[:database_timezone] = ActiveRecord::Base.default_timezone
+ end
super
end
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index d5a603cadc..98126249df 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -84,7 +84,7 @@ module ActiveRecord
$1
# Character types
when /\A\(?'(.*)'::.*\b(?:character varying|bpchar|text)\z/m
- $1
+ $1.gsub(/''/, "'")
# Binary data types
when /\A'(.*)'::bytea\z/m
$1
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb
index ba053700f2..f0141aaaab 100644
--- a/activerecord/lib/active_record/core.rb
+++ b/activerecord/lib/active_record/core.rb
@@ -123,6 +123,8 @@ module ActiveRecord
super
elsif abstract_class?
"#{super}(abstract)"
+ elsif !connected?
+ "#{super}(no database connection)"
elsif table_exists?
attr_list = columns.map { |c| "#{c.name}: #{c.type}" } * ', '
"#{super}(#{attr_list})"
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index 33e19313a0..70eda332b3 100644
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
@@ -841,8 +841,6 @@ module ActiveRecord
end
def setup_fixtures
- return if ActiveRecord::Base.configurations.blank?
-
if pre_loaded_fixtures && !use_transactional_fixtures
raise RuntimeError, 'pre_loaded_fixtures requires use_transactional_fixtures'
end
@@ -875,8 +873,6 @@ module ActiveRecord
end
def teardown_fixtures
- return if ActiveRecord::Base.configurations.blank?
-
# Rollback changes if a transaction is active.
if run_in_transaction?
@fixture_connections.each do |connection|
diff --git a/activerecord/lib/active_record/log_subscriber.rb b/activerecord/lib/active_record/log_subscriber.rb
index 61e5c120df..0358a36b14 100644
--- a/activerecord/lib/active_record/log_subscriber.rb
+++ b/activerecord/lib/active_record/log_subscriber.rb
@@ -41,7 +41,7 @@ module ActiveRecord
return if IGNORE_PAYLOAD_NAMES.include?(payload[:name])
name = "#{payload[:name]} (#{event.duration.round(1)}ms)"
- sql = payload[:sql].squeeze(' ')
+ sql = payload[:sql]
binds = nil
unless (payload[:binds] || []).empty?
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake
index f69e9b2217..0b74553bf8 100644
--- a/activerecord/lib/active_record/railties/databases.rake
+++ b/activerecord/lib/active_record/railties/databases.rake
@@ -324,7 +324,7 @@ db_namespace = namespace :db do
ActiveRecord::Schema.verbose = false
db_namespace["schema:load"].invoke
ensure
- ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations[Rails.env])
+ ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations[ActiveRecord::Tasks::DatabaseTasks.env])
end
end
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb
index 1550d702a6..3ea3c33fcc 100644
--- a/activerecord/lib/active_record/relation/finder_methods.rb
+++ b/activerecord/lib/active_record/relation/finder_methods.rb
@@ -124,11 +124,7 @@ module ActiveRecord
#
def first(limit = nil)
if limit
- if order_values.empty? && primary_key
- order(arel_table[primary_key].asc).limit(limit).to_a
- else
- limit(limit).to_a
- end
+ find_first_with_limit(order_values, limit)
else
find_first
end
@@ -358,12 +354,15 @@ module ActiveRecord
if loaded?
@records.first
else
- @first ||=
- if with_default_scope.order_values.empty? && primary_key
- order(arel_table[primary_key].asc).limit(1).to_a.first
- else
- limit(1).to_a.first
- end
+ @first ||= find_first_with_limit(with_default_scope.order_values, 1).first
+ end
+ end
+
+ def find_first_with_limit(order_values, limit)
+ if order_values.empty? && primary_key
+ order(arel_table[primary_key].asc).limit(limit).to_a
+ else
+ limit(limit).to_a
end
end
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index ca1de2d4dc..0200fcf69b 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -802,7 +802,7 @@ module ActiveRecord
def build_arel
arel = Arel::SelectManager.new(table.engine, table)
- build_joins(arel, joins_values) unless joins_values.empty?
+ build_joins(arel, joins_values.flatten) unless joins_values.empty?
collapse_wheres(arel, (where_values - ['']).uniq)
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb
index 4aa6567d85..1cfaf552af 100644
--- a/activerecord/test/cases/associations/eager_test.rb
+++ b/activerecord/test/cases/associations/eager_test.rb
@@ -250,7 +250,8 @@ class EagerAssociationTest < ActiveRecord::TestCase
assert_nil Post.all.merge!(:includes => :author).find(posts(:authorless).id).author
end
- def test_nested_loading_with_no_associations
+ # Regression test for 21c75e5
+ def test_nested_loading_does_not_raise_exception_when_association_does_not_exist
assert_nothing_raised do
Post.all.merge!(:includes => {:author => :author_addresss}).find(posts(:authorless).id)
end
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb
index 9f64ecd845..168ce13097 100644
--- a/activerecord/test/cases/associations/has_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_associations_test.rb
@@ -418,7 +418,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
client_ary = firm.clients_using_finder_sql.find("2", "3")
assert_kind_of Array, client_ary
assert_equal 2, client_ary.size
- assert client_ary.include?(client)
+ assert_equal true, client_ary.include?(client)
end
def test_find_all
@@ -1220,14 +1220,14 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
end
def test_included_in_collection
- assert companies(:first_firm).clients.include?(Client.find(2))
+ assert_equal true, companies(:first_firm).clients.include?(Client.find(2))
end
def test_included_in_collection_for_new_records
client = Client.create(:name => 'Persisted')
assert_nil client.client_of
- assert !Firm.new.clients_of_firm.include?(client),
- 'includes a client that does not belong to any firm'
+ assert_equal false, Firm.new.clients_of_firm.include?(client),
+ 'includes a client that does not belong to any firm'
end
def test_adding_array_and_collection
@@ -1254,7 +1254,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
firm.save
firm.reload
assert_equal 2, firm.clients.length
- assert !firm.clients.include?(:first_client)
+ assert_equal false, firm.clients.include?(:first_client)
end
def test_replace_failure
@@ -1332,7 +1332,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
firm.save!
assert_equal 2, firm.clients(true).size
- assert firm.clients.include?(companies(:second_client))
+ assert_equal true, firm.clients.include?(companies(:second_client))
end
def test_get_ids_for_through
@@ -1366,7 +1366,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
assert_no_queries do
assert firm.clients.loaded?
- assert firm.clients.include?(client)
+ assert_equal true, firm.clients.include?(client)
end
end
@@ -1377,7 +1377,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
firm.reload
assert ! firm.clients.loaded?
assert_queries(1) do
- assert firm.clients.include?(client)
+ assert_equal true, firm.clients.include?(client)
end
assert ! firm.clients.loaded?
end
@@ -1388,7 +1388,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
firm.reload
assert ! firm.clients_using_sql.loaded?
- assert firm.clients_using_sql.include?(client)
+ assert_equal true, firm.clients_using_sql.include?(client)
assert firm.clients_using_sql.loaded?
end
@@ -1398,7 +1398,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
client = Client.create!(:name => 'Not Associated')
assert ! firm.clients.loaded?
- assert ! firm.clients.include?(client)
+ assert_equal false, firm.clients.include?(client)
end
def test_calling_first_or_last_on_association_should_not_load_association
@@ -1613,7 +1613,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
def test_include_method_in_has_many_association_should_return_true_for_instance_added_with_build
post = Post.new
comment = post.comments.build
- assert post.comments.include?(comment)
+ assert_equal true, post.comments.include?(comment)
end
def test_load_target_respects_protected_attributes
diff --git a/activerecord/test/cases/associations/inverse_associations_test.rb b/activerecord/test/cases/associations/inverse_associations_test.rb
index b1f0be3204..71cf1237e8 100644
--- a/activerecord/test/cases/associations/inverse_associations_test.rb
+++ b/activerecord/test/cases/associations/inverse_associations_test.rb
@@ -401,10 +401,22 @@ class InverseHasManyTests < ActiveRecord::TestCase
assert_equal man.name, man.interests.find(interest.id).man.name, "The name of the man should match after the child name is changed"
end
+ def test_find_on_child_instance_with_id_should_not_load_all_child_records
+ man = Man.create!
+ interest = Interest.create!(man: man)
+
+ man.interests.find(interest.id)
+ refute man.interests.loaded?
+ end
+
def test_raise_record_not_found_error_when_invalid_ids_are_passed
+ # delete all interest records to ensure that hard coded invalid_id(s)
+ # are indeed invalid.
+ Interest.delete_all
+
man = Man.create!
- invalid_id = 2394823094892348920348523452345
+ invalid_id = 245324523
assert_raise(ActiveRecord::RecordNotFound) { man.interests.find(invalid_id) }
invalid_ids = [8432342, 2390102913, 2453245234523452]
diff --git a/activerecord/test/cases/attribute_methods/serialization_test.rb b/activerecord/test/cases/attribute_methods/serialization_test.rb
new file mode 100644
index 0000000000..75de773961
--- /dev/null
+++ b/activerecord/test/cases/attribute_methods/serialization_test.rb
@@ -0,0 +1,29 @@
+require "cases/helper"
+
+module ActiveRecord
+ module AttributeMethods
+ class SerializationTest < ActiveSupport::TestCase
+ class FakeColumn < Struct.new(:name)
+ def type; :integer; end
+ def type_cast(s); "#{s}!"; end
+ end
+
+ class NullCoder
+ def load(v); v; end
+ end
+
+ def test_type_cast_serialized_value
+ value = Serialization::Attribute.new(NullCoder.new, "Hello world", :serialized)
+ type = Serialization::Type.new(FakeColumn.new)
+ assert_equal "Hello world!", type.type_cast(value)
+ end
+
+ def test_type_cast_unserialized_value
+ value = Serialization::Attribute.new(nil, "Hello world", :unserialized)
+ type = Serialization::Type.new(FakeColumn.new)
+ type.type_cast(value)
+ assert_equal "Hello world", type.type_cast(value)
+ end
+ end
+ end
+end
diff --git a/activerecord/test/cases/connection_pool_test.rb b/activerecord/test/cases/connection_pool_test.rb
index e6af29282c..d5365b695e 100644
--- a/activerecord/test/cases/connection_pool_test.rb
+++ b/activerecord/test/cases/connection_pool_test.rb
@@ -329,7 +329,7 @@ module ActiveRecord
end
# make sure exceptions are thrown when establish_connection
- # is called with a anonymous class
+ # is called with an anonymous class
def test_anonymous_class_exception
anonymous = Class.new(ActiveRecord::Base)
handler = ActiveRecord::Base.connection_handler
diff --git a/activerecord/test/cases/defaults_test.rb b/activerecord/test/cases/defaults_test.rb
index e0cf4adf13..7e3d91e08c 100644
--- a/activerecord/test/cases/defaults_test.rb
+++ b/activerecord/test/cases/defaults_test.rb
@@ -39,6 +39,31 @@ class DefaultTest < ActiveRecord::TestCase
end
end
+class DefaultStringsTest < ActiveRecord::TestCase
+ class DefaultString < ActiveRecord::Base; end
+
+ setup do
+ @connection = ActiveRecord::Base.connection
+ @connection.create_table :default_strings do |t|
+ t.string :string_col, default: "Smith"
+ t.string :string_col_with_quotes, default: "O'Connor"
+ end
+ DefaultString.reset_column_information
+ end
+
+ def test_default_strings
+ assert_equal "Smith", DefaultString.new.string_col
+ end
+
+ def test_default_strings_containing_single_quotes
+ assert_equal "O'Connor", DefaultString.new.string_col_with_quotes
+ end
+
+ teardown do
+ @connection.drop_table :default_strings
+ end
+end
+
if current_adapter?(:MysqlAdapter, :Mysql2Adapter)
class DefaultsTestWithoutTransactionalFixtures < ActiveRecord::TestCase
# ActiveRecord::Base#create! (and #save and other related methods) will
diff --git a/activerecord/test/cases/disconnected_test.rb b/activerecord/test/cases/disconnected_test.rb
new file mode 100644
index 0000000000..cc2c1f6489
--- /dev/null
+++ b/activerecord/test/cases/disconnected_test.rb
@@ -0,0 +1,26 @@
+require "cases/helper"
+
+class TestRecord < ActiveRecord::Base
+end
+
+class TestDisconnectedAdapter < ActiveRecord::TestCase
+ self.use_transactional_fixtures = false
+
+ def setup
+ @connection = ActiveRecord::Base.connection
+ end
+
+ def teardown
+ spec = ActiveRecord::Base.connection_config
+ ActiveRecord::Base.establish_connection(spec)
+ @connection = nil
+ end
+
+ test "can't execute statements while disconnected" do
+ @connection.execute "SELECT count(*) from products"
+ @connection.disconnect!
+ assert_raises(ActiveRecord::StatementInvalid) do
+ @connection.execute "SELECT count(*) from products"
+ end
+ end
+end
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb
index f6cfee0cb8..df6edc4057 100644
--- a/activerecord/test/cases/fixtures_test.rb
+++ b/activerecord/test/cases/fixtures_test.rb
@@ -245,6 +245,22 @@ class FixturesTest < ActiveRecord::TestCase
def test_serialized_fixtures
assert_equal ["Green", "Red", "Orange"], traffic_lights(:uk).state
end
+
+ def test_fixtures_are_set_up_with_database_env_variable
+ ENV.stubs(:[]).with("DATABASE_URL").returns("sqlite3:///:memory:")
+ ActiveRecord::Base.stubs(:configurations).returns({})
+ test_case = Class.new(ActiveRecord::TestCase) do
+ fixtures :accounts
+
+ def test_fixtures
+ assert accounts(:signals37)
+ end
+ end
+
+ result = test_case.new(:test_fixtures).run
+
+ assert result.passed?, "Expected #{result.name} to pass:\n#{result}"
+ end
end
if Account.connection.respond_to?(:reset_pk_sequence!)
diff --git a/activerecord/test/cases/invalid_connection_test.rb b/activerecord/test/cases/invalid_connection_test.rb
new file mode 100644
index 0000000000..f6fe7f0d7d
--- /dev/null
+++ b/activerecord/test/cases/invalid_connection_test.rb
@@ -0,0 +1,20 @@
+require "cases/helper"
+require "models/bird"
+
+class TestAdapterWithInvalidConnection < ActiveRecord::TestCase
+ self.use_transactional_fixtures = false
+
+ def setup
+ @spec = ActiveRecord::Base.connection_config
+ non_existing_spec = {adapter: @spec[:adapter], database: "i_do_not_exist"}
+ ActiveRecord::Base.establish_connection(non_existing_spec)
+ end
+
+ def teardown
+ ActiveRecord::Base.establish_connection(@spec)
+ end
+
+ test "inspect on Model class does not raise" do
+ assert_equal "Bird(no database connection)", Bird.inspect
+ end
+end
diff --git a/activerecord/test/cases/log_subscriber_test.rb b/activerecord/test/cases/log_subscriber_test.rb
index 57eac0c175..3bdc5a1302 100644
--- a/activerecord/test/cases/log_subscriber_test.rb
+++ b/activerecord/test/cases/log_subscriber_test.rb
@@ -56,6 +56,13 @@ class LogSubscriberTest < ActiveRecord::TestCase
assert_equal 2, logger.debugs.length
end
+ def test_sql_statements_are_not_squeezed
+ event = Struct.new(:duration, :payload)
+ logger = TestDebugLogSubscriber.new
+ logger.sql(event.new(0, sql: 'ruby rails'))
+ assert_match(/ruby rails/, logger.debugs.first)
+ end
+
def test_ignore_binds_payload_with_nil_column
event = Struct.new(:duration, :payload)
diff --git a/activerecord/test/cases/relation_test.rb b/activerecord/test/cases/relation_test.rb
index 55fd068d37..693b36f35c 100644
--- a/activerecord/test/cases/relation_test.rb
+++ b/activerecord/test/cases/relation_test.rb
@@ -176,7 +176,7 @@ module ActiveRecord
assert_equal ['foo = bar'], relation.where_values
end
- def test_relation_merging_with_merged_joins
+ def test_relation_merging_with_merged_joins_as_symbols
special_comments_with_ratings = SpecialComment.joins(:ratings)
posts_with_special_comments_with_ratings = Post.group("posts.id").joins(:special_comments).merge(special_comments_with_ratings)
assert_equal 3, authors(:david).posts.merge(posts_with_special_comments_with_ratings).count.length
@@ -190,6 +190,13 @@ module ActiveRecord
assert_equal false, post.respond_to?(:title), "post should not respond_to?(:body) since invoking it raises exception"
end
+ def test_relation_merging_with_merged_joins_as_strings
+ join_string = "LEFT OUTER JOIN #{Rating.quoted_table_name} ON #{SpecialComment.quoted_table_name}.id = #{Rating.quoted_table_name}.comment_id"
+ special_comments_with_ratings = SpecialComment.joins join_string
+ posts_with_special_comments_with_ratings = Post.group("posts.id").joins(:special_comments).merge(special_comments_with_ratings)
+ assert_equal 3, authors(:david).posts.merge(posts_with_special_comments_with_ratings).count.length
+ end
+
end
class RelationMutationTest < ActiveSupport::TestCase
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index 1863eec947..45f71daa08 100644
--- a/activesupport/CHANGELOG.md
+++ b/activesupport/CHANGELOG.md
@@ -1,5 +1,20 @@
+* Fix return value from `BacktraceCleaner#noise` when the cleaner is configured
+ with multiple silencers.
+
+ Fixes #11030
+
+ *Mark J. Titorenko*
+
+* `HashWithIndifferentAccess#select` now returns a `HashWithIndifferentAccess`
+ instance instead of a `Hash` instance.
+
+ Fixes #10723
+
+ *Albert Llop*
+
* Add `DateTime#usec` and `DateTime#nsec` so that `ActiveSupport::TimeWithZone` keeps
sub-second resolution when wrapping a `DateTime` value.
+
Fixes #10855
*Andrew White*
@@ -15,6 +30,7 @@
* Prevent side effects to hashes inside arrays when
`Hash#with_indifferent_access` is called.
+
Fixes #10526
*Yves Senn*
diff --git a/activesupport/Rakefile b/activesupport/Rakefile
index f50225a9f0..c5e8e382c9 100644
--- a/activesupport/Rakefile
+++ b/activesupport/Rakefile
@@ -25,7 +25,7 @@ Gem::PackageTask.new(spec) do |p|
p.gem_spec = spec
end
-desc "Release to gemcutter"
+desc "Release to rubygems"
task :release => :package do
require 'rake/gemcutter'
Rake::Gemcutter::Tasks.new(spec).define
diff --git a/activesupport/lib/active_support/backtrace_cleaner.rb b/activesupport/lib/active_support/backtrace_cleaner.rb
index 6f9dc679c2..c88ae3e661 100644
--- a/activesupport/lib/active_support/backtrace_cleaner.rb
+++ b/activesupport/lib/active_support/backtrace_cleaner.rb
@@ -97,11 +97,7 @@ module ActiveSupport
end
def noise(backtrace)
- @silencers.each do |s|
- backtrace = backtrace.select { |line| s.call(line) }
- end
-
- backtrace
+ backtrace - silence(backtrace)
end
end
end
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb
index d38e4b0732..73559bfe0e 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -416,7 +416,7 @@ module ActiveSupport #:nodoc:
def load_file(path, const_paths = loadable_constants_for_path(path))
log_call path, const_paths
const_paths = [const_paths].compact unless const_paths.is_a? Array
- parent_paths = const_paths.collect { |const_path| const_path[/.*(?=::)/] || :Object }
+ parent_paths = const_paths.collect { |const_path| const_path[/.*(?=::)/] || ::Object }
result = nil
newly_defined_paths = new_constants_in(*parent_paths) do
@@ -634,7 +634,7 @@ module ActiveSupport #:nodoc:
when String then desc.sub(/^::/, '')
when Symbol then desc.to_s
when Module
- desc.name.presence ||
+ desc.name ||
raise(ArgumentError, "Anonymous modules have no name to be referenced by")
else raise TypeError, "Not a valid constant descriptor: #{desc.inspect}"
end
diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb
index 0a81a8393d..56213de50e 100644
--- a/activesupport/lib/active_support/hash_with_indifferent_access.rb
+++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb
@@ -227,6 +227,10 @@ module ActiveSupport
def deep_symbolize_keys; to_hash.deep_symbolize_keys end
def to_options!; self end
+ def select(*args, &block)
+ dup.select!(*args, &block)
+ end
+
# Convert to a regular hash with string keys.
def to_hash
_new_hash= {}
diff --git a/activesupport/lib/active_support/inflector/methods.rb b/activesupport/lib/active_support/inflector/methods.rb
index 39648727fd..a2263fa4d0 100644
--- a/activesupport/lib/active_support/inflector/methods.rb
+++ b/activesupport/lib/active_support/inflector/methods.rb
@@ -219,7 +219,12 @@ module ActiveSupport
# unknown.
def constantize(camel_cased_word)
names = camel_cased_word.split('::')
- names.shift if names.empty? || names.first.empty?
+
+ # Trigger a builtin NameError exception including the ill-formed constant in the message.
+ Object.const_get(camel_cased_word) if names.empty?
+
+ # Remove the first blank element in case of '::ClassName' notation.
+ names.shift if names.size > 1 && names.first.empty?
names.inject(Object) do |constant, name|
if constant == Object
@@ -314,9 +319,14 @@ module ActiveSupport
private
# Mount a regular expression that will match part by part of the constant.
- # For instance, Foo::Bar::Baz will generate Foo(::Bar(::Baz)?)?
+ #
+ # const_regexp("Foo::Bar::Baz") # => /Foo(::Bar(::Baz)?)?/
+ # const_regexp("::") # => /::/
def const_regexp(camel_cased_word) #:nodoc:
parts = camel_cased_word.split("::")
+
+ return Regexp.escape(camel_cased_word) if parts.blank?
+
last = parts.pop
parts.reverse.inject(last) do |acc, part|
diff --git a/activesupport/lib/active_support/testing/declarative.rb b/activesupport/lib/active_support/testing/declarative.rb
index 508e37254a..1fa73caefa 100644
--- a/activesupport/lib/active_support/testing/declarative.rb
+++ b/activesupport/lib/active_support/testing/declarative.rb
@@ -19,9 +19,12 @@ module ActiveSupport
end
unless defined?(Spec)
- # test "verify something" do
- # ...
- # end
+ # Helper to define a test method using a String. Under the hood, it replaces
+ # spaces with underscores and defines the test method.
+ #
+ # test "verify something" do
+ # ...
+ # end
def test(name, &block)
test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
defined = instance_method(test_name) rescue false
diff --git a/activesupport/lib/active_support/testing/setup_and_teardown.rb b/activesupport/lib/active_support/testing/setup_and_teardown.rb
index a65148cf1f..33f2b8dc9b 100644
--- a/activesupport/lib/active_support/testing/setup_and_teardown.rb
+++ b/activesupport/lib/active_support/testing/setup_and_teardown.rb
@@ -3,6 +3,19 @@ require 'active_support/callbacks'
module ActiveSupport
module Testing
+ # Adds support for +setup+ and +teardown+ callbacks.
+ # These callbacks serve as a replacement to overwriting the
+ # <tt>#setup</tt> and <tt>#teardown</tt> methods of your TestCase.
+ #
+ # class ExampleTest < ActiveSupport::TestCase
+ # setup do
+ # # ...
+ # end
+ #
+ # teardown do
+ # # ...
+ # end
+ # end
module SetupAndTeardown
extend ActiveSupport::Concern
@@ -12,21 +25,23 @@ module ActiveSupport
end
module ClassMethods
+ # Add a callback, which runs before <tt>TestCase#setup</tt>.
def setup(*args, &block)
set_callback(:setup, :before, *args, &block)
end
+ # Add a callback, which runs after <tt>TestCase#teardown</tt>.
def teardown(*args, &block)
set_callback(:teardown, :after, *args, &block)
end
end
- def before_setup
+ def before_setup # :nodoc:
super
run_callbacks :setup
end
- def after_teardown
+ def after_teardown # :nodoc:
run_callbacks :teardown
super
end
diff --git a/activesupport/test/clean_backtrace_test.rb b/activesupport/test/clean_backtrace_test.rb
index b14950acb3..dd67a45cf6 100644
--- a/activesupport/test/clean_backtrace_test.rb
+++ b/activesupport/test/clean_backtrace_test.rb
@@ -36,6 +36,27 @@ class BacktraceCleanerSilencerTest < ActiveSupport::TestCase
end
end
+class BacktraceCleanerMultipleSilencersTest < ActiveSupport::TestCase
+ def setup
+ @bc = ActiveSupport::BacktraceCleaner.new
+ @bc.add_silencer { |line| line =~ /mongrel/ }
+ @bc.add_silencer { |line| line =~ /yolo/ }
+ end
+
+ test "backtrace should not contain lines that match the silencers" do
+ assert_equal \
+ [ "/other/class.rb" ],
+ @bc.clean([ "/mongrel/class.rb", "/other/class.rb", "/mongrel/stuff.rb", "/other/yolo.rb" ])
+ end
+
+ test "backtrace should only contain lines that match the silencers" do
+ assert_equal \
+ [ "/mongrel/class.rb", "/mongrel/stuff.rb", "/other/yolo.rb" ],
+ @bc.clean([ "/mongrel/class.rb", "/other/class.rb", "/mongrel/stuff.rb", "/other/yolo.rb" ],
+ :noise)
+ end
+end
+
class BacktraceCleanerFilterAndSilencerTest < ActiveSupport::TestCase
def setup
@bc = ActiveSupport::BacktraceCleaner.new
diff --git a/activesupport/test/constantize_test_cases.rb b/activesupport/test/constantize_test_cases.rb
index 9b62295c96..bbeb710a0c 100644
--- a/activesupport/test/constantize_test_cases.rb
+++ b/activesupport/test/constantize_test_cases.rb
@@ -34,8 +34,6 @@ module ConstantizeTestCases
assert_equal Case::Dice, yield("Object::Case::Dice")
assert_equal ConstantizeTestCases, yield("ConstantizeTestCases")
assert_equal ConstantizeTestCases, yield("::ConstantizeTestCases")
- assert_equal Object, yield("")
- assert_equal Object, yield("::")
assert_raises(NameError) { yield("UnknownClass") }
assert_raises(NameError) { yield("UnknownClass::Ace") }
assert_raises(NameError) { yield("UnknownClass::Ace::Base") }
@@ -45,6 +43,8 @@ module ConstantizeTestCases
assert_raises(NameError) { yield("Ace::Base::ConstantizeTestCases") }
assert_raises(NameError) { yield("Ace::Gas::Base") }
assert_raises(NameError) { yield("Ace::Gas::ConstantizeTestCases") }
+ assert_raises(NameError) { yield("") }
+ assert_raises(NameError) { yield("::") }
end
def run_safe_constantize_tests_on
@@ -58,8 +58,8 @@ module ConstantizeTestCases
assert_equal Case::Dice, yield("Object::Case::Dice")
assert_equal ConstantizeTestCases, yield("ConstantizeTestCases")
assert_equal ConstantizeTestCases, yield("::ConstantizeTestCases")
- assert_equal Object, yield("")
- assert_equal Object, yield("::")
+ assert_nil yield("")
+ assert_nil yield("::")
assert_nil yield("UnknownClass")
assert_nil yield("UnknownClass::Ace")
assert_nil yield("UnknownClass::Ace::Base")
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb
index 39bd0a2dd4..c6d7ab618c 100644
--- a/activesupport/test/core_ext/hash_ext_test.rb
+++ b/activesupport/test/core_ext/hash_ext_test.rb
@@ -480,6 +480,36 @@ class HashExtTest < ActiveSupport::TestCase
assert_equal hash.delete('a'), nil
end
+ def test_indifferent_select
+ hash = ActiveSupport::HashWithIndifferentAccess.new(@strings).select {|k,v| v == 1}
+
+ assert_equal({ 'a' => 1 }, hash)
+ assert_instance_of ActiveSupport::HashWithIndifferentAccess, hash
+ end
+
+ def test_indifferent_select_bang
+ indifferent_strings = ActiveSupport::HashWithIndifferentAccess.new(@strings)
+ indifferent_strings.select! {|k,v| v == 1}
+
+ assert_equal({ 'a' => 1 }, indifferent_strings)
+ assert_instance_of ActiveSupport::HashWithIndifferentAccess, indifferent_strings
+ end
+
+ def test_indifferent_reject
+ hash = ActiveSupport::HashWithIndifferentAccess.new(@strings).reject {|k,v| v != 1}
+
+ assert_equal({ 'a' => 1 }, hash)
+ assert_instance_of ActiveSupport::HashWithIndifferentAccess, hash
+ end
+
+ def test_indifferent_reject_bang
+ indifferent_strings = ActiveSupport::HashWithIndifferentAccess.new(@strings)
+ indifferent_strings.reject! {|k,v| v != 1}
+
+ assert_equal({ 'a' => 1 }, indifferent_strings)
+ assert_instance_of ActiveSupport::HashWithIndifferentAccess, indifferent_strings
+ end
+
def test_indifferent_to_hash
# Should convert to a Hash with String keys.
assert_equal @strings, @mixed.with_indifferent_access.to_hash
diff --git a/activesupport/test/xml_mini/jdom_engine_test.rb b/activesupport/test/xml_mini/jdom_engine_test.rb
index 904ef7b208..ed4de8aba2 100644
--- a/activesupport/test/xml_mini/jdom_engine_test.rb
+++ b/activesupport/test/xml_mini/jdom_engine_test.rb
@@ -178,7 +178,7 @@ if RUBY_PLATFORM =~ /java/
private
def assert_equal_rexml(xml)
parsed_xml = XmlMini.parse(xml)
- hash = XmlMini.with_backend('REXML') { parsed_xml }
+ hash = XmlMini.with_backend('REXML') { XmlMini.parse(xml) }
assert_equal(hash, parsed_xml)
end
end
diff --git a/activesupport/test/xml_mini/libxml_engine_test.rb b/activesupport/test/xml_mini/libxml_engine_test.rb
index e7cb350663..a8df2e1f7b 100644
--- a/activesupport/test/xml_mini/libxml_engine_test.rb
+++ b/activesupport/test/xml_mini/libxml_engine_test.rb
@@ -195,7 +195,8 @@ class LibxmlEngineTest < ActiveSupport::TestCase
private
def assert_equal_rexml(xml)
parsed_xml = XmlMini.parse(xml)
- hash = XmlMini.with_backend('REXML') { parsed_xml }
+ xml.rewind if xml.respond_to?(:rewind)
+ hash = XmlMini.with_backend('REXML') { XmlMini.parse(xml) }
assert_equal(hash, parsed_xml)
end
end
diff --git a/activesupport/test/xml_mini/libxmlsax_engine_test.rb b/activesupport/test/xml_mini/libxmlsax_engine_test.rb
index 07485911c9..d6d90639e2 100644
--- a/activesupport/test/xml_mini/libxmlsax_engine_test.rb
+++ b/activesupport/test/xml_mini/libxmlsax_engine_test.rb
@@ -186,7 +186,8 @@ class LibXMLSAXEngineTest < ActiveSupport::TestCase
private
def assert_equal_rexml(xml)
parsed_xml = XmlMini.parse(xml)
- hash = XmlMini.with_backend('REXML') { parsed_xml }
+ xml.rewind if xml.respond_to?(:rewind)
+ hash = XmlMini.with_backend('REXML') { XmlMini.parse(xml) }
assert_equal(hash, parsed_xml)
end
end
diff --git a/activesupport/test/xml_mini/nokogiri_engine_test.rb b/activesupport/test/xml_mini/nokogiri_engine_test.rb
index 937517786e..2e962576b5 100644
--- a/activesupport/test/xml_mini/nokogiri_engine_test.rb
+++ b/activesupport/test/xml_mini/nokogiri_engine_test.rb
@@ -208,7 +208,8 @@ class NokogiriEngineTest < ActiveSupport::TestCase
private
def assert_equal_rexml(xml)
parsed_xml = XmlMini.parse(xml)
- hash = XmlMini.with_backend('REXML') { parsed_xml }
+ xml.rewind if xml.respond_to?(:rewind)
+ hash = XmlMini.with_backend('REXML') { XmlMini.parse(xml) }
assert_equal(hash, parsed_xml)
end
end
diff --git a/activesupport/test/xml_mini/nokogirisax_engine_test.rb b/activesupport/test/xml_mini/nokogirisax_engine_test.rb
index 84a5c44a87..4f078f31e0 100644
--- a/activesupport/test/xml_mini/nokogirisax_engine_test.rb
+++ b/activesupport/test/xml_mini/nokogirisax_engine_test.rb
@@ -209,7 +209,8 @@ class NokogiriSAXEngineTest < ActiveSupport::TestCase
private
def assert_equal_rexml(xml)
parsed_xml = XmlMini.parse(xml)
- hash = XmlMini.with_backend('REXML') { parsed_xml }
+ xml.rewind if xml.respond_to?(:rewind)
+ hash = XmlMini.with_backend('REXML') { XmlMini.parse(xml) }
assert_equal(hash, parsed_xml)
end
end
diff --git a/activesupport/test/xml_mini/rexml_engine_test.rb b/activesupport/test/xml_mini/rexml_engine_test.rb
index 70a3b918fd..0c1f11803c 100644
--- a/activesupport/test/xml_mini/rexml_engine_test.rb
+++ b/activesupport/test/xml_mini/rexml_engine_test.rb
@@ -30,7 +30,8 @@ class REXMLEngineTest < ActiveSupport::TestCase
private
def assert_equal_rexml(xml)
parsed_xml = XmlMini.parse(xml)
- hash = XmlMini.with_backend('REXML') { parsed_xml }
+ xml.rewind if xml.respond_to?(:rewind)
+ hash = XmlMini.with_backend('REXML') { XmlMini.parse(xml) }
assert_equal(hash, parsed_xml)
end
end
diff --git a/ci/travis.rb b/ci/travis.rb
index 9029c3f41c..7e68993332 100755
--- a/ci/travis.rb
+++ b/ci/travis.rb
@@ -20,7 +20,8 @@ class Build
'am' => 'actionmailer',
'amo' => 'activemodel',
'as' => 'activesupport',
- 'ar' => 'activerecord'
+ 'ar' => 'activerecord',
+ 'av' => 'actionview'
}
attr_reader :component, :options
diff --git a/guides/CHANGELOG.md b/guides/CHANGELOG.md
index 766f7f6f56..37257baeba 100644
--- a/guides/CHANGELOG.md
+++ b/guides/CHANGELOG.md
@@ -1,3 +1,5 @@
-* No changes.
+* Removed repetitive th tags. Instead of them added one th tag with a colspan attribute.
+
+ *Sıtkı Bağdat*
Please check [4-0-stable](https://github.com/rails/rails/blob/4-0-stable/guides/CHANGELOG.md) for previous changes.
diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md
index 84fc254207..2555927d15 100644
--- a/guides/source/active_record_querying.md
+++ b/guides/source/active_record_querying.md
@@ -687,6 +687,10 @@ The SQL that would be executed:
```sql
SELECT * FROM posts WHERE id > 10 LIMIT 20
+
+# Original query without `except`
+SELECT * FROM posts WHERE id > 10 ORDER BY id asc LIMIT 20
+
```
### `unscope`
@@ -722,6 +726,10 @@ The SQL that would be executed:
```sql
SELECT * FROM posts WHERE id > 10 ORDER BY id DESC
+
+# Original query without `only`
+SELECT "posts".* FROM "posts" WHERE (id > 10) ORDER BY id desc LIMIT 20
+
```
### `reorder`
diff --git a/guides/source/configuring.md b/guides/source/configuring.md
index ee0d373287..9bb5d621fc 100644
--- a/guides/source/configuring.md
+++ b/guides/source/configuring.md
@@ -196,7 +196,7 @@ Every Rails application comes with a standard set of middleware which it uses in
* `Rack::Lock` wraps the app in mutex so it can only be called by a single thread at a time. Only enabled when `config.cache_classes` is `false`.
* `ActiveSupport::Cache::Strategy::LocalCache` serves as a basic memory backed cache. This cache is not thread safe and is intended only for serving as a temporary memory cache for a single thread.
* `Rack::Runtime` sets an `X-Runtime` header, containing the time (in seconds) taken to execute the request.
-* `Rails::Rack::Logger` notifies the logs that the request has began. After request is complete, flushes all the logs.
+* `Rails::Rack::Logger` notifies the logs that the request has begun. After request is complete, flushes all the logs.
* `ActionDispatch::ShowExceptions` rescues any exception returned by the application and renders nice exception pages if the request is local or if `config.consider_all_requests_local` is set to `true`. If `config.action_dispatch.show_exceptions` is set to `false`, exceptions will be raised regardless.
* `ActionDispatch::RequestId` makes a unique X-Request-Id header available to the response and enables the `ActionDispatch::Request#uuid` method.
* `ActionDispatch::RemoteIp` checks for IP spoofing attacks and gets valid `client_ip` from request headers. Configurable with the `config.action_dispatch.ip_spoofing_check`, and `config.action_dispatch.trusted_proxies` options.
@@ -603,7 +603,7 @@ end
The `initializer` method takes three arguments with the first being the name for the initializer and the second being an options hash (not shown here) and the third being a block. The `:before` key in the options hash can be specified to specify which initializer this new initializer must run before, and the `:after` key will specify which initializer to run this initializer _after_.
-Initializers defined using the `initializer` method will be ran in the order they are defined in, with the exception of ones that use the `:before` or `:after` methods.
+Initializers defined using the `initializer` method will be run in the order they are defined in, with the exception of ones that use the `:before` or `:after` methods.
WARNING: You may put your initializer before or after any other initializer in the chain, as long as it is logical. Say you have 4 initializers called "one" through "four" (defined in that order) and you define "four" to go _before_ "four" but _after_ "three", that just isn't logical and Rails will not be able to determine your initializer order.
@@ -705,7 +705,7 @@ Below is a comprehensive list of all the initializers found in Rails in the orde
* `ensure_autoload_once_paths_as_subset` Ensures that the `config.autoload_once_paths` only contains paths from `config.autoload_paths`. If it contains extra paths, then an exception will be raised.
-* `add_to_prepare_blocks` The block for every `config.to_prepare` call in the application, a railtie or engine is added to the `to_prepare` callbacks for Action Dispatch which will be ran per request in development, or before the first request in production.
+* `add_to_prepare_blocks` The block for every `config.to_prepare` call in the application, a railtie or engine is added to the `to_prepare` callbacks for Action Dispatch which will be run per request in development, or before the first request in production.
* `add_builtin_route` If the application is running under the development environment then this will append the route for `rails/info/properties` to the application routes. This route provides the detailed information such as Rails and Ruby version for `public/index.html` in a default Rails application.
diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md
index 2fb0cd7c72..0d44f0e776 100644
--- a/guides/source/getting_started.md
+++ b/guides/source/getting_started.md
@@ -932,8 +932,7 @@ appear next to the "Show" link:
<tr>
<th>Title</th>
<th>Text</th>
- <th></th>
- <th></th>
+ <th colspan="2"></th>
</tr>
<% @posts.each do |post| %>
@@ -1073,9 +1072,7 @@ together.
<tr>
<th>Title</th>
<th>Text</th>
- <th></th>
- <th></th>
- <th></th>
+ <th colspan="3"></th>
</tr>
<% @posts.each do |post| %>
diff --git a/guides/source/i18n.md b/guides/source/i18n.md
index b248c7645a..9e5278c92b 100644
--- a/guides/source/i18n.md
+++ b/guides/source/i18n.md
@@ -865,11 +865,11 @@ Rails uses fixed strings and other localizations, such as format strings and oth
#### Action View Helper Methods
-* `distance_of_time_in_words` translates and pluralizes its result and interpolates the number of seconds, minutes, hours, and so on. See [datetime.distance_in_words](https://github.com/rails/rails/blob/master/actionpack/lib/action_view/locale/en.yml#L51) translations.
+* `distance_of_time_in_words` translates and pluralizes its result and interpolates the number of seconds, minutes, hours, and so on. See [datetime.distance_in_words](https://github.com/rails/rails/blob/master/actionview/lib/action_view/locale/en.yml#L51) translations.
-* `datetime_select` and `select_month` use translated month names for populating the resulting select tag. See [date.month_names](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L15) for translations. `datetime_select` also looks up the order option from [date.order](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L18) (unless you pass the option explicitly). All date selection helpers translate the prompt using the translations in the [datetime.prompts](https://github.com/rails/rails/blob/master/actionpack/lib/action_view/locale/en.yml#L83) scope if applicable.
+* `datetime_select` and `select_month` use translated month names for populating the resulting select tag. See [date.month_names](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L15) for translations. `datetime_select` also looks up the order option from [date.order](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L18) (unless you pass the option explicitly). All date selection helpers translate the prompt using the translations in the [datetime.prompts](https://github.com/rails/rails/blob/master/actionview/lib/action_view/locale/en.yml#L83) scope if applicable.
-* The `number_to_currency`, `number_with_precision`, `number_to_percentage`, `number_with_delimiter`, and `number_to_human_size` helpers use the number format settings located in the [number](https://github.com/rails/rails/blob/master/actionpack/lib/action_view/locale/en.yml#L2) scope.
+* The `number_to_currency`, `number_with_precision`, `number_to_percentage`, `number_with_delimiter`, and `number_to_human_size` helpers use the number format settings located in the [number](https://github.com/rails/rails/blob/master/actionview/lib/action_view/locale/en.yml#L2) scope.
#### Active Model Methods
diff --git a/guides/source/layout.html.erb b/guides/source/layout.html.erb
index ef2bdf0753..1dcf383b92 100644
--- a/guides/source/layout.html.erb
+++ b/guides/source/layout.html.erb
@@ -102,11 +102,11 @@
</p>
<p>
If you see any typos or factual errors you are confident to
- patch, please clone <%= link_to 'docrails', 'https://github.com/rails/docrails' %>
- and push the change yourself. That branch of Rails has public write access.
- Commits are still reviewed, but that happens after you've submitted your
- contribution. <%= link_to 'docrails', 'https://github.com/rails/docrails' %> is
- cross-merged with master periodically.
+ patch, please clone the <%= link_to 'rails', 'https://github.com/rails/rails' %>
+ repository and open a new pull request. You can also ask for commit rights on
+ <%= link_to 'docrails', 'https://github.com/rails/docrails' %> if you plan to submit
+ several patches. Commits are reviewed, but that happens after you've submitted your
+ contribution. This repository is cross-merged with master periodically.
</p>
<p>
You may also find incomplete content, or stuff that is not up to date.
diff --git a/guides/source/migrations.md b/guides/source/migrations.md
index eb0cfd9451..508e52a77c 100644
--- a/guides/source/migrations.md
+++ b/guides/source/migrations.md
@@ -390,8 +390,8 @@ will create a `categorization` table.
```ruby
create_join_table :products, :categories do |t|
- t.index :products
- t.index :categories
+ t.index :product_id
+ t.index :category_id
end
```
diff --git a/rails.gemspec b/rails.gemspec
index 4a17beac69..b426faf0e8 100644
--- a/rails.gemspec
+++ b/rails.gemspec
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
s.add_dependency 'activesupport', version
s.add_dependency 'actionpack', version
+ s.add_dependency 'actionview', version
s.add_dependency 'activerecord', version
s.add_dependency 'actionmailer', version
s.add_dependency 'railties', version
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md
index 23a7cf6ca3..ae4bfc2447 100644
--- a/railties/CHANGELOG.md
+++ b/railties/CHANGELOG.md
@@ -12,5 +12,9 @@
moved to class methods in Railtie and the Railtie has been made abstract.
*John Wang*
+
+* Changes repetitive th tags to use colspan attribute in `index.html.erb` template.
+
+ *Sıtkı Bağdat*
Please check [4-0-stable](https://github.com/rails/rails/blob/4-0-stable/railties/CHANGELOG.md) for previous changes.
diff --git a/railties/Rakefile b/railties/Rakefile
index 4789f41ad4..5728c774bd 100644
--- a/railties/Rakefile
+++ b/railties/Rakefile
@@ -54,7 +54,7 @@ end
# Publishing -------------------------------------------------------
-desc "Release to gemcutter"
+desc "Release to rubygems"
task :release => :package do
require 'rake/gemcutter'
Rake::Gemcutter::Tasks.new(spec).define
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index 753e870a8c..b5c5a6191f 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -52,11 +52,12 @@ module Rails
# 11) Run config.after_initialize callbacks
#
class Application < Engine
- autoload :Bootstrap, 'rails/application/bootstrap'
- autoload :Configuration, 'rails/application/configuration'
- autoload :Finisher, 'rails/application/finisher'
- autoload :Railties, 'rails/engine/railties'
- autoload :RoutesReloader, 'rails/application/routes_reloader'
+ autoload :Bootstrap, 'rails/application/bootstrap'
+ autoload :Configuration, 'rails/application/configuration'
+ autoload :DefaultMiddlewareStack, 'rails/application/default_middleware_stack'
+ autoload :Finisher, 'rails/application/finisher'
+ autoload :Railties, 'rails/engine/railties'
+ autoload :RoutesReloader, 'rails/application/routes_reloader'
class << self
def inherited(base)
@@ -102,7 +103,6 @@ module Rails
routes_reloader.reload!
end
-
# Return the application's KeyGenerator
def key_generator
# number of iterations selected based on consultation with the google security
@@ -119,32 +119,9 @@ module Rails
# Stores some of the Rails initial environment parameters which
# will be used by middlewares and engines to configure themselves.
- # Currently stores:
- #
- # * "action_dispatch.parameter_filter" => config.filter_parameters
- # * "action_dispatch.redirect_filter" => config.filter_redirect
- # * "action_dispatch.secret_token" => config.secret_token
- # * "action_dispatch.secret_key_base" => config.secret_key_base
- # * "action_dispatch.show_exceptions" => config.action_dispatch.show_exceptions
- # * "action_dispatch.show_detailed_exceptions" => config.consider_all_requests_local
- # * "action_dispatch.logger" => Rails.logger
- # * "action_dispatch.backtrace_cleaner" => Rails.backtrace_cleaner
- # * "action_dispatch.key_generator" => key_generator
- # * "action_dispatch.http_auth_salt" => config.action_dispatch.http_auth_salt
- # * "action_dispatch.signed_cookie_salt" => config.action_dispatch.signed_cookie_salt
- # * "action_dispatch.encrypted_cookie_salt" => config.action_dispatch.encrypted_cookie_salt
- # * "action_dispatch.encrypted_signed_cookie_salt" => config.action_dispatch.encrypted_signed_cookie_salt
- #
def env_config
@app_env_config ||= begin
- if config.secret_key_base.blank?
- ActiveSupport::Deprecation.warn "You didn't set config.secret_key_base. " +
- "Read the upgrade documentation to learn more about this new config option."
-
- if config.secret_token.blank?
- raise "You must set config.secret_key_base in your app's config."
- end
- end
+ validate_secret_key_config!
super.merge({
"action_dispatch.parameter_filter" => config.filter_parameters,
@@ -298,96 +275,9 @@ module Rails
initializers
end
- def reload_dependencies? #:nodoc:
- config.reload_classes_only_on_change != true || reloaders.map(&:updated?).any?
- end
-
def default_middleware_stack #:nodoc:
- ActionDispatch::MiddlewareStack.new.tap do |middleware|
- app = self
-
- if rack_cache = load_rack_cache
- require "action_dispatch/http/rack_cache"
- middleware.use ::Rack::Cache, rack_cache
- end
-
- if config.force_ssl
- middleware.use ::ActionDispatch::SSL, config.ssl_options
- end
-
- if config.action_dispatch.x_sendfile_header.present?
- middleware.use ::Rack::Sendfile, config.action_dispatch.x_sendfile_header
- end
-
- if config.serve_static_assets
- middleware.use ::ActionDispatch::Static, paths["public"].first, config.static_cache_control
- end
-
- middleware.use ::Rack::Lock unless allow_concurrency?
- middleware.use ::Rack::Runtime
- middleware.use ::Rack::MethodOverride
- middleware.use ::ActionDispatch::RequestId
-
- # Must come after Rack::MethodOverride to properly log overridden methods
- middleware.use ::Rails::Rack::Logger, config.log_tags
- middleware.use ::ActionDispatch::ShowExceptions, show_exceptions_app
- middleware.use ::ActionDispatch::DebugExceptions, app
- middleware.use ::ActionDispatch::RemoteIp, config.action_dispatch.ip_spoofing_check, config.action_dispatch.trusted_proxies
-
- unless config.cache_classes
- middleware.use ::ActionDispatch::Reloader, lambda { app.reload_dependencies? }
- end
-
- middleware.use ::ActionDispatch::Callbacks
- middleware.use ::ActionDispatch::Cookies
-
- if config.session_store
- if config.force_ssl && !config.session_options.key?(:secure)
- config.session_options[:secure] = true
- end
- middleware.use config.session_store, config.session_options
- middleware.use ::ActionDispatch::Flash
- end
-
- middleware.use ::ActionDispatch::ParamsParser
- middleware.use ::Rack::Head
- middleware.use ::Rack::ConditionalGet
- middleware.use ::Rack::ETag, "no-cache"
- end
- end
-
- def allow_concurrency?
- if config.allow_concurrency.nil?
- config.cache_classes
- else
- config.allow_concurrency
- end
- end
-
- def load_rack_cache
- rack_cache = config.action_dispatch.rack_cache
- return unless rack_cache
-
- begin
- require 'rack/cache'
- rescue LoadError => error
- error.message << ' Be sure to add rack-cache to your Gemfile'
- raise
- end
-
- if rack_cache == true
- {
- metastore: "rails:/",
- entitystore: "rails:/",
- verbose: false
- }
- else
- rack_cache
- end
- end
-
- def show_exceptions_app
- config.exceptions_app || ActionDispatch::PublicExceptions.new(Rails.public_path)
+ default_stack = DefaultMiddlewareStack.new(self, config, paths)
+ default_stack.build_stack
end
def build_original_fullpath(env) #:nodoc:
@@ -401,5 +291,11 @@ module Rails
"#{script_name}#{path_info}"
end
end
+
+ def validate_secret_key_config! #:nodoc:
+ if config.secret_key_base.blank? && config.secret_token.blank?
+ raise "You must set config.secret_key_base in your app's config."
+ end
+ end
end
end
diff --git a/railties/lib/rails/application/default_middleware_stack.rb b/railties/lib/rails/application/default_middleware_stack.rb
new file mode 100644
index 0000000000..370c906086
--- /dev/null
+++ b/railties/lib/rails/application/default_middleware_stack.rb
@@ -0,0 +1,101 @@
+module Rails
+ class Application
+ class DefaultMiddlewareStack
+ attr_reader :config, :paths, :app
+
+ def initialize(app, config, paths)
+ @app = app
+ @config = config
+ @paths = paths
+ end
+
+ def build_stack
+ ActionDispatch::MiddlewareStack.new.tap do |middleware|
+ if rack_cache = load_rack_cache
+ require "action_dispatch/http/rack_cache"
+ middleware.use ::Rack::Cache, rack_cache
+ end
+
+ if config.force_ssl
+ middleware.use ::ActionDispatch::SSL, config.ssl_options
+ end
+
+ if config.action_dispatch.x_sendfile_header.present?
+ middleware.use ::Rack::Sendfile, config.action_dispatch.x_sendfile_header
+ end
+
+ if config.serve_static_assets
+ middleware.use ::ActionDispatch::Static, paths["public"].first, config.static_cache_control
+ end
+
+ middleware.use ::Rack::Lock unless allow_concurrency?
+ middleware.use ::Rack::Runtime
+ middleware.use ::Rack::MethodOverride
+ middleware.use ::ActionDispatch::RequestId
+
+ # Must come after Rack::MethodOverride to properly log overridden methods
+ middleware.use ::Rails::Rack::Logger, config.log_tags
+ middleware.use ::ActionDispatch::ShowExceptions, show_exceptions_app
+ middleware.use ::ActionDispatch::DebugExceptions, app
+ middleware.use ::ActionDispatch::RemoteIp, config.action_dispatch.ip_spoofing_check, config.action_dispatch.trusted_proxies
+
+ unless config.cache_classes
+ middleware.use ::ActionDispatch::Reloader, lambda { reload_dependencies? }
+ end
+
+ middleware.use ::ActionDispatch::Callbacks
+ middleware.use ::ActionDispatch::Cookies
+
+ if config.session_store
+ if config.force_ssl && !config.session_options.key?(:secure)
+ config.session_options[:secure] = true
+ end
+ middleware.use config.session_store, config.session_options
+ middleware.use ::ActionDispatch::Flash
+ end
+
+ middleware.use ::ActionDispatch::ParamsParser
+ middleware.use ::Rack::Head
+ middleware.use ::Rack::ConditionalGet
+ middleware.use ::Rack::ETag, "no-cache"
+ end
+ end
+
+ private
+
+ def reload_dependencies?
+ config.reload_classes_only_on_change != true || app.reloaders.map(&:updated?).any?
+ end
+
+ def allow_concurrency?
+ config.allow_concurrency.nil? ? config.cache_classes : config.allow_concurrency
+ end
+
+ def load_rack_cache
+ rack_cache = config.action_dispatch.rack_cache
+ return unless rack_cache
+
+ begin
+ require 'rack/cache'
+ rescue LoadError => error
+ error.message << ' Be sure to add rack-cache to your Gemfile'
+ raise
+ end
+
+ if rack_cache == true
+ {
+ metastore: "rails:/",
+ entitystore: "rails:/",
+ verbose: false
+ }
+ else
+ rack_cache
+ end
+ end
+
+ def show_exceptions_app
+ config.exceptions_app || ActionDispatch::PublicExceptions.new(Rails.public_path)
+ end
+ end
+ end
+end
diff --git a/railties/lib/rails/commands.rb b/railties/lib/rails/commands.rb
index e8c42b149b..48007dd2ab 100644
--- a/railties/lib/rails/commands.rb
+++ b/railties/lib/rails/commands.rb
@@ -5,7 +5,6 @@ aliases = {
"d" => "destroy",
"c" => "console",
"s" => "server",
- "t" => "test",
"db" => "dbconsole",
"r" => "runner"
}
@@ -17,7 +16,6 @@ The most common rails commands are:
generate Generate new code (short-cut alias: "g")
console Start the Rails console (short-cut alias: "c")
server Start the Rails server (short-cut alias: "s")
- test Running the test file (short-cut alias: "t")
dbconsole Start a console for the database specified in config/database.yml
(short-cut alias: "db")
new Create a new Rails application. "rails new my_app" creates a
diff --git a/railties/lib/rails/commands/runner.rb b/railties/lib/rails/commands/runner.rb
index c4622d6a2d..2b77d5d387 100644
--- a/railties/lib/rails/commands/runner.rb
+++ b/railties/lib/rails/commands/runner.rb
@@ -48,7 +48,7 @@ if code_or_file.nil?
exit 1
elsif File.exist?(code_or_file)
$0 = code_or_file
- eval(File.read(code_or_file), nil, code_or_file)
+ Kernel.load code_or_file
else
eval(code_or_file)
end
diff --git a/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb b/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb
index 9d778642f2..814d6fdb0e 100644
--- a/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb
+++ b/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb
@@ -6,9 +6,7 @@
<% attributes.reject(&:password_digest?).each do |attribute| -%>
<th><%= attribute.human_name %></th>
<% end -%>
- <th></th>
- <th></th>
- <th></th>
+ <th colspan="3"></th>
</tr>
</thead>
diff --git a/railties/lib/rails/tasks/framework.rake b/railties/lib/rails/tasks/framework.rake
index 2116330b45..76a95304c3 100644
--- a/railties/lib/rails/tasks/framework.rake
+++ b/railties/lib/rails/tasks/framework.rake
@@ -47,7 +47,7 @@ namespace :rails do
gen = Rails::Generators::AppGenerator.new ["rails"], { with_dispatchers: true },
destination_root: Rails.root
File.exists?(Rails.root.join("config", "application.rb")) ?
- gen.send(:app_const) : gen.send(:valid_app_const?)
+ gen.send(:app_const) : gen.send(:valid_const?)
gen
end
end
diff --git a/railties/test/application/asset_debugging_test.rb b/railties/test/application/asset_debugging_test.rb
index b3b40448c0..9a571fac3a 100644
--- a/railties/test/application/asset_debugging_test.rb
+++ b/railties/test/application/asset_debugging_test.rb
@@ -14,7 +14,7 @@ module ApplicationTests
app_file "app/views/posts/index.html.erb", "<%= javascript_include_tag 'application' %>"
app_file "config/routes.rb", <<-RUBY
- AppTemplate::Application.routes.draw do
+ Rails.application.routes.draw do
get '/posts', to: "posts#index"
end
RUBY
diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb
index fd0ddc4d08..633d864dac 100644
--- a/railties/test/application/assets_test.rb
+++ b/railties/test/application/assets_test.rb
@@ -45,7 +45,7 @@ module ApplicationTests
app_file "app/assets/javascripts/demo.js.erb", "a = <%= image_path('rails.png').inspect %>;"
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do
+ Rails.application.routes.draw do
get '*path', to: lambda { |env| [200, { "Content-Type" => "text/html" }, ["Not an asset"]] }
end
RUBY
@@ -165,6 +165,29 @@ module ApplicationTests
assert_file_exists("#{app_path}/public/assets/something-*.js")
end
+ test 'precompile use assets defined in app env config' do
+ add_to_env_config 'production', 'config.assets.precompile = [ "something.js" ]'
+
+ app_file 'app/assets/javascripts/something.js.erb', 'alert();'
+
+ precompile! 'RAILS_ENV=production'
+
+ assert_file_exists("#{app_path}/public/assets/something-*.js")
+ end
+
+ test 'precompile use assets defined in app config and reassigned in app env config' do
+ add_to_config 'config.assets.precompile = [ "something.js" ]'
+ add_to_env_config 'production', 'config.assets.precompile += [ "another.js" ]'
+
+ app_file 'app/assets/javascripts/something.js.erb', 'alert();'
+ app_file 'app/assets/javascripts/another.js.erb', 'alert();'
+
+ precompile! 'RAILS_ENV=production'
+
+ assert_file_exists("#{app_path}/public/assets/something-*.js")
+ assert_file_exists("#{app_path}/public/assets/another-*.js")
+ end
+
test "asset pipeline should use a Sprockets::Index when config.assets.digest is true" do
add_to_config "config.assets.digest = true"
add_to_config "config.action_controller.perform_caching = false"
@@ -313,7 +336,7 @@ module ApplicationTests
app_file "app/assets/javascripts/demo.js.erb", "<%= :alert %>();"
app_file "config/routes.rb", <<-RUBY
- AppTemplate::Application.routes.draw do
+ Rails.application.routes.draw do
get '/omg', :to => "omg#index"
end
RUBY
@@ -463,7 +486,7 @@ module ApplicationTests
app_file "app/views/posts/index.html.erb", "<%= javascript_include_tag 'application' %>"
app_file "config/routes.rb", <<-RUBY
- AppTemplate::Application.routes.draw do
+ Rails.application.routes.draw do
get '/posts', :to => "posts#index"
end
RUBY
diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb
index bc794e1602..33659db927 100644
--- a/railties/test/application/initializers/frameworks_test.rb
+++ b/railties/test/application/initializers/frameworks_test.rb
@@ -41,7 +41,7 @@ module ApplicationTests
test "allows me to configure default url options for ActionMailer" do
app_file "config/environments/development.rb", <<-RUBY
- AppTemplate::Application.configure do
+ Rails.application.configure do
config.action_mailer.default_url_options = { :host => "test.rails" }
end
RUBY
@@ -52,7 +52,7 @@ module ApplicationTests
test "does not include url helpers as action methods" do
app_file "config/routes.rb", <<-RUBY
- AppTemplate::Application.routes.draw do
+ Rails.application.routes.draw do
get "/foo", :to => lambda { |env| [200, {}, []] }, :as => :foo
end
RUBY
@@ -115,7 +115,7 @@ module ApplicationTests
RUBY
app_file "config/routes.rb", <<-RUBY
- AppTemplate::Application.routes.draw do
+ Rails.application.routes.draw do
get "/:controller(/:action)"
end
RUBY
diff --git a/railties/test/application/initializers/i18n_test.rb b/railties/test/application/initializers/i18n_test.rb
index 17d0b10b70..97df073ec7 100644
--- a/railties/test/application/initializers/i18n_test.rb
+++ b/railties/test/application/initializers/i18n_test.rb
@@ -84,7 +84,7 @@ en:
RUBY
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do
+ Rails.application.routes.draw do
get '/i18n', :to => lambda { |env| [200, {}, [Foo.instance_variable_get('@foo')]] }
end
RUBY
@@ -108,7 +108,7 @@ en:
YAML
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do
+ Rails.application.routes.draw do
get '/i18n', :to => lambda { |env| [200, {}, [I18n.t(:foo)]] }
end
RUBY
diff --git a/railties/test/application/initializers/load_path_test.rb b/railties/test/application/initializers/load_path_test.rb
index 0c66213caa..b36628ee37 100644
--- a/railties/test/application/initializers/load_path_test.rb
+++ b/railties/test/application/initializers/load_path_test.rb
@@ -75,7 +75,7 @@ module ApplicationTests
$initialize_test_set_from_env = nil
app_file "config/environments/development.rb", <<-RUBY
$initialize_test_set_from_env = 'success'
- AppTemplate::Application.configure do
+ Rails.application.configure do
config.cache_classes = true
config.time_zone = "Brasilia"
end
@@ -89,8 +89,8 @@ module ApplicationTests
require "#{app_path}/config/environment"
assert_equal "success", $initialize_test_set_from_env
- assert AppTemplate::Application.config.cache_classes
- assert_equal "Brasilia", AppTemplate::Application.config.time_zone
+ assert Rails.application.config.cache_classes
+ assert_equal "Brasilia", Rails.application.config.time_zone
end
end
end
diff --git a/railties/test/application/loading_test.rb b/railties/test/application/loading_test.rb
index 17926ac444..f05eade81f 100644
--- a/railties/test/application/loading_test.rb
+++ b/railties/test/application/loading_test.rb
@@ -213,7 +213,7 @@ class LoadingTest < ActiveSupport::TestCase
app_file 'config/routes.rb', <<-RUBY
$counter ||= 1
$counter *= 2
- AppTemplate::Application.routes.draw do
+ Rails.application.routes.draw do
get '/c', to: lambda { |env| User; [200, {"Content-Type" => "text/plain"}, [$counter.to_s]] }
end
RUBY
diff --git a/railties/test/application/middleware/cache_test.rb b/railties/test/application/middleware/cache_test.rb
index b8e0c9be60..b4db840e68 100644
--- a/railties/test/application/middleware/cache_test.rb
+++ b/railties/test/application/middleware/cache_test.rb
@@ -45,7 +45,7 @@ module ApplicationTests
RUBY
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do
+ Rails.application.routes.draw do
get ':controller(/:action)'
end
RUBY
diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb
index 833114a34c..251fe02bc5 100644
--- a/railties/test/application/middleware_test.rb
+++ b/railties/test/application/middleware_test.rb
@@ -88,7 +88,7 @@ module ApplicationTests
add_to_config "config.ssl_options = { host: 'example.com' }"
boot!
- assert_equal AppTemplate::Application.middleware.first.args, [{host: 'example.com'}]
+ assert_equal Rails.application.middleware.first.args, [{host: 'example.com'}]
end
test "removing Active Record omits its middleware" do
@@ -225,7 +225,7 @@ module ApplicationTests
end
def middleware
- AppTemplate::Application.middleware.map(&:klass).map(&:name)
+ Rails.application.middleware.map(&:klass).map(&:name)
end
end
end
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb
index dc2684ae0d..746ebdaa35 100644
--- a/railties/test/application/rake_test.rb
+++ b/railties/test/application/rake_test.rb
@@ -30,7 +30,7 @@ module ApplicationTests
app_file "config/environment.rb", <<-RUBY
SuperMiddleware = Struct.new(:app)
- AppTemplate::Application.configure do
+ Rails.application.configure do
config.middleware.use SuperMiddleware
end
@@ -142,7 +142,7 @@ module ApplicationTests
def test_rake_routes_calls_the_route_inspector
app_file "config/routes.rb", <<-RUBY
- AppTemplate::Application.routes.draw do
+ Rails.application.routes.draw do
get '/cart', to: 'cart#show'
end
RUBY
@@ -153,7 +153,7 @@ module ApplicationTests
def test_rake_routes_with_controller_environment
app_file "config/routes.rb", <<-RUBY
- AppTemplate::Application.routes.draw do
+ Rails.application.routes.draw do
get '/cart', to: 'cart#show'
get '/basketball', to: 'basketball#index'
end
@@ -166,7 +166,7 @@ module ApplicationTests
def test_rake_routes_displays_message_when_no_routes_are_defined
app_file "config/routes.rb", <<-RUBY
- AppTemplate::Application.routes.draw do
+ Rails.application.routes.draw do
end
RUBY
diff --git a/railties/test/application/rendering_test.rb b/railties/test/application/rendering_test.rb
index 588d64dde9..b01febd768 100644
--- a/railties/test/application/rendering_test.rb
+++ b/railties/test/application/rendering_test.rb
@@ -17,7 +17,7 @@ module ApplicationTests
test "Unknown format falls back to HTML template" do
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do
+ Rails.application.routes.draw do
get 'pages/:id', to: 'pages#show'
end
RUBY
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb
index 68d96bae94..a3295a6e69 100644
--- a/railties/test/isolation/abstract_unit.rb
+++ b/railties/test/isolation/abstract_unit.rb
@@ -163,7 +163,7 @@ module TestHelpers
RUBY
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do
+ Rails.application.routes.draw do
get ':controller(/:action)'
end
RUBY
diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb
index 05e9c4ab6e..50253fe2bc 100644
--- a/railties/test/railties/engine_test.rb
+++ b/railties/test/railties/engine_test.rb
@@ -345,7 +345,7 @@ YAML
#{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support/locale/en.yml
#{RAILS_FRAMEWORK_ROOT}/activemodel/lib/active_model/locale/en.yml
#{RAILS_FRAMEWORK_ROOT}/activerecord/lib/active_record/locale/en.yml
- #{RAILS_FRAMEWORK_ROOT}/actionpack/lib/action_view/locale/en.yml
+ #{RAILS_FRAMEWORK_ROOT}/actionview/lib/action_view/locale/en.yml
#{@plugin.path}/config/locales/en.yml
#{app_path}/config/locales/en.yml
#{app_path}/app/locales/en.yml
diff --git a/railties/test/railties/mounted_engine_test.rb b/railties/test/railties/mounted_engine_test.rb
index c94937f964..0ef2ff2e2e 100644
--- a/railties/test/railties/mounted_engine_test.rb
+++ b/railties/test/railties/mounted_engine_test.rb
@@ -16,7 +16,7 @@ module ApplicationTests
@metrics_plugin = engine "metrics"
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do
+ Rails.application.routes.draw do
mount Weblog::Engine, :at => '/', :as => 'weblog'
resources :posts
get "/engine_route" => "application_generating#engine_route"