diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | Rakefile | 2 | ||||
-rw-r--r-- | actionmailer/Rakefile | 4 | ||||
-rw-r--r-- | actionpack/CHANGELOG.md | 42 | ||||
-rw-r--r-- | actionpack/Rakefile | 23 | ||||
-rw-r--r-- | actionpack/actionpack.gemspec | 4 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/responder.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/http/mime_type.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/journey/router.rb | 8 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/ssl.rb | 5 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 12 | ||||
-rw-r--r-- | actionpack/test/controller/caching_test.rb | 1 | ||||
-rw-r--r-- | actionpack/test/controller/render_test.rb | 6 | ||||
-rw-r--r-- | actionpack/test/dispatch/mount_test.rb | 5 | ||||
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 13 | ||||
-rw-r--r-- | actionpack/test/dispatch/ssl_test.rb | 19 | ||||
-rw-r--r-- | actionview/CHANGELOG.md | 56 | ||||
-rw-r--r-- | actionview/MIT-LICENSE | 21 | ||||
-rw-r--r-- | actionview/README.rdoc | 31 | ||||
-rw-r--r-- | actionview/RUNNING_UNIT_TESTS | 27 | ||||
-rw-r--r-- | actionview/Rakefile | 81 | ||||
-rw-r--r-- | actionview/actionview.gemspec | 29 | ||||
-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) | 4 | ||||
-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) | 0 | ||||
-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) | 2 | ||||
-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) | 0 | ||||
-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) | 0 | ||||
-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) | 0 | ||||
-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.rb | 11 | ||||
-rw-r--r-- | actionview/test/abstract_unit.rb | 382 | ||||
-rw-r--r-- | actionview/test/active_record_unit.rb | 91 | ||||
-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.erb | 1 | ||||
-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.rb | 9 | ||||
-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.erb | 1 | ||||
-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.erb | 1 | ||||
-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.erb | 3 | ||||
-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.erb | 1 | ||||
-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.erb | 1 | ||||
-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.erb | 2 | ||||
-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_param | 5 | ||||
-rw-r--r-- | actionview/test/fixtures/multipart/single_utf8_param | 5 | ||||
-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.css | 3 | ||||
-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.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/ruby_template.ruby | 2 | ||||
-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.erb | 1 | ||||
-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.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/_changing_priority.json.erb | 1 | ||||
-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.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/_customer.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/_customer_greeting.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/_customer_with_var.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/_directory/_partial_with_locales.html.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/_first_json_partial.json.erb | 1 | ||||
-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.erb | 0 | ||||
-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.erb | 3 | ||||
-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.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/_partial.html.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/_partial.js.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/_partial_for_use_in_layout.html.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/_partial_name_local_variable.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/_partial_only.erb | 1 | ||||
-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.erb | 2 | ||||
-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.erb | 13 | ||||
-rw-r--r-- | actionview/test/fixtures/test/_second_json_partial.json.erb | 1 | ||||
-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.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/change_priority.html.erb | 2 | ||||
-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.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/greeting.xml.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/hello.builder | 4 | ||||
-rw-r--r-- | actionview/test/fixtures/test/hello/hello.erb | 1 | ||||
-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.erb | 1 | ||||
-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.erb | 2 | ||||
-rw-r--r-- | actionview/test/fixtures/test/html_template.html.erb | 1 | ||||
-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.erb | 1 | ||||
-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.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/render_file_with_locals.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/render_file_with_locals_and_default.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/render_partial_inside_directory.html.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/render_two_partials.html.erb | 2 | ||||
-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.rb | 35 | ||||
-rw-r--r-- | actionview/test/lib/controller/fake_models.rb | 185 | ||||
-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) | 0 | ||||
-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) | 0 | ||||
-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) | 0 | ||||
-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) | 1 | ||||
-rw-r--r-- | activemodel/Rakefile | 2 | ||||
-rw-r--r-- | activemodel/examples/validations.rb | 2 | ||||
-rw-r--r-- | activemodel/lib/active_model/model.rb | 2 | ||||
-rw-r--r-- | activemodel/lib/active_model/secure_password.rb | 2 | ||||
-rw-r--r-- | activemodel/test/cases/model_test.rb | 47 | ||||
-rw-r--r-- | activerecord/CHANGELOG.md | 53 | ||||
-rw-r--r-- | activerecord/Rakefile | 4 | ||||
-rw-r--r-- | activerecord/examples/performance.rb | 32 | ||||
-rw-r--r-- | activerecord/examples/simple.rb | 6 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/collection_association.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/core.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/log_subscriber.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/railtie.rb | 21 | ||||
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/transactions.rb | 10 | ||||
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 37 | ||||
-rw-r--r-- | activerecord/test/cases/associations/inverse_associations_test.rb | 14 | ||||
-rw-r--r-- | activerecord/test/cases/defaults_test.rb | 25 | ||||
-rw-r--r-- | activerecord/test/cases/invalid_connection_test.rb | 20 | ||||
-rw-r--r-- | activerecord/test/cases/log_subscriber_test.rb | 7 | ||||
-rw-r--r-- | activerecord/test/cases/relation_test.rb | 9 | ||||
-rw-r--r-- | activerecord/test/cases/result_test.rb | 1 | ||||
-rw-r--r-- | activesupport/CHANGELOG.md | 7 | ||||
-rw-r--r-- | activesupport/Rakefile | 4 | ||||
-rw-r--r-- | activesupport/lib/active_support/backtrace_cleaner.rb | 6 | ||||
-rw-r--r-- | activesupport/lib/active_support/testing/declarative.rb | 9 | ||||
-rw-r--r-- | activesupport/lib/active_support/testing/setup_and_teardown.rb | 19 | ||||
-rw-r--r-- | activesupport/test/clean_backtrace_test.rb | 21 | ||||
-rwxr-xr-x | ci/travis.rb | 3 | ||||
-rw-r--r-- | guides/assets/stylesheets/main.css | 2 | ||||
-rw-r--r-- | guides/code/getting_started/app/views/posts/_form.html.erb | 6 | ||||
-rw-r--r-- | guides/source/_welcome.html.erb | 5 | ||||
-rw-r--r-- | guides/source/action_view_overview.md | 2 | ||||
-rw-r--r-- | guides/source/command_line.md | 4 | ||||
-rw-r--r-- | guides/source/configuring.md | 6 | ||||
-rw-r--r-- | guides/source/debugging_rails_applications.md | 4 | ||||
-rw-r--r-- | guides/source/form_helpers.md | 2 | ||||
-rw-r--r-- | guides/source/getting_started.md | 6 | ||||
-rw-r--r-- | guides/source/i18n.md | 6 | ||||
-rw-r--r-- | guides/source/layout.html.erb | 10 | ||||
-rw-r--r-- | guides/source/migrations.md | 4 | ||||
-rw-r--r-- | guides/source/routing.md | 6 | ||||
-rw-r--r-- | rails.gemspec | 1 | ||||
-rw-r--r-- | railties/Rakefile | 2 | ||||
-rw-r--r-- | railties/lib/rails/commands.rb | 2 | ||||
-rw-r--r-- | railties/test/application/assets_test.rb | 23 | ||||
-rw-r--r-- | railties/test/railties/engine_test.rb | 2 |
394 files changed, 1514 insertions, 169 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" @@ -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..5d5539df1d 100644 --- a/actionmailer/Rakefile +++ b/actionmailer/Rakefile @@ -16,7 +16,7 @@ namespace :test do task :isolated do ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) Dir.glob("test/**/*_test.rb").all? do |file| - sh(ruby, '-Ilib:test', file) + sh(ruby, '-w', '-Ilib:test', file) end or raise "Failures" end end @@ -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 b1c5987fe4..05495179c3 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,38 +1,26 @@ -* Use a case insensitive URI Regexp for #asset_path. +* Fix `Mime::Type.parse` when bad accepts header is looked up. Previously it + was setting `request.formats` with an array containing a `nil` value, which + raised an error when setting the controller formats. - This fix a problem where the same asset path using different case are generating - different URIs. + Fixes #10965 - Before: + *Becker* - 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\" />" +* Merge `:action` from routing scope and assign endpoint if both `:controller` + and `:action` are present. The endpoint assignment only occurs if there is + no `:to` present in the options hash so should only affect routes using the + shorthand syntax (i.e. endpoint is inferred from the path). - After: + Fixes #9856 - image_tag("HTTP://google.com") - # => "<img alt=\"Google\" src=\"HTTP://google.com\" />" - image_tag("http://google.com") - # => "<img alt=\"Google\" src=\"http://google.com\" />" + *Yves Senn*, *Andrew White* - *David Celis* +* ActionView extracted from ActionPack -* Element of the `collection_check_boxes` and `collection_radio_buttons` can - optionally contain html attributes as the last element of the array. + *Piotr Sarnacki*, *Łukasz Strzałkowski* - *Vasiliy Ermolovich* +* Fix removing trailing slash for mounted apps #3215 -* 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* + *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..5433e584af 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| - sh(ruby, '-Ilib:test', file) + Dir.glob("test/{abstract,controller,dispatch}/**/*_test.rb").all? do |file| + sh(ruby, '-w', '-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 734ccfc719..fd5b661209 100644 --- a/actionpack/lib/action_controller/metal/responder.rb +++ b/actionpack/lib/action_controller/metal/responder.rb @@ -101,7 +101,7 @@ module ActionController #:nodoc: # # respond_with(@project, location: root_path) # - # To customize the failure scenario, you can pass a a block to + # To customize the failure scenario, you can pass a block to # <code>respond_with</code>: # # def create diff --git a/actionpack/lib/action_dispatch/http/mime_type.rb b/actionpack/lib/action_dispatch/http/mime_type.rb index 61dbf2b96c..ef144c3c76 100644 --- a/actionpack/lib/action_dispatch/http/mime_type.rb +++ b/actionpack/lib/action_dispatch/http/mime_type.rb @@ -175,7 +175,7 @@ module Mime def parse(accept_header) if accept_header !~ /,/ accept_header = accept_header.split(PARAMETER_SEPARATOR_REGEXP).first - parse_trailing_star(accept_header) || [Mime::Type.lookup(accept_header)] + parse_trailing_star(accept_header) || [Mime::Type.lookup(accept_header)].compact else list, index = AcceptList.new, 0 accept_header.split(',').each do |header| 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/lib/action_dispatch/middleware/ssl.rb b/actionpack/lib/action_dispatch/middleware/ssl.rb index 9e03cbf2b7..8d5ab19f60 100644 --- a/actionpack/lib/action_dispatch/middleware/ssl.rb +++ b/actionpack/lib/action_dispatch/middleware/ssl.rb @@ -36,8 +36,7 @@ module ActionDispatch url.scheme = "https" url.host = @host if @host url.port = @port if @port - headers = hsts_headers.merge('Content-Type' => 'text/html', - 'Location' => url.to_s) + headers = { 'Content-Type' => 'text/html', 'Location' => url.to_s } [301, headers, []] end @@ -58,7 +57,7 @@ module ActionDispatch cookies = cookies.split("\n") headers['Set-Cookie'] = cookies.map { |cookie| - if cookie !~ /;\s+secure(;|$)/ + if cookie !~ /;\s+secure(;|$)/i "#{cookie}; secure" else cookie diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 3c58a2cfc3..288ce3e867 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -11,8 +11,8 @@ module ActionDispatch class Mapper URL_OPTIONS = [:protocol, :subdomain, :domain, :host, :port] SCOPE_OPTIONS = [:path, :shallow_path, :as, :shallow_prefix, :module, - :controller, :path_names, :constraints, :defaults, - :shallow, :blocks, :options] + :controller, :action, :path_names, :constraints, + :shallow, :blocks, :defaults, :options] class Constraints #:nodoc: def self.new(app, constraints, request = Rack::Request) @@ -874,6 +874,10 @@ module ActionDispatch child end + def merge_action_scope(parent, child) #:nodoc: + child + end + def merge_path_names_scope(parent, child) #:nodoc: merge_options_scope(parent, child) end @@ -1383,6 +1387,10 @@ module ActionDispatch raise ArgumentError, "Unknown scope #{on.inspect} given to :on" end + if @scope[:controller] && @scope[:action] + options[:to] ||= "#{@scope[:controller]}##{@scope[:action]}" + end + paths.each do |_path| route_options = options.dup route_options[:path] ||= _path if _path.is_a?(String) 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/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 72411ec900..fd835795c0 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -1089,6 +1089,12 @@ class RenderTest < ActionController::TestCase assert_equal '<test>passed formatted html erb</test>', @response.body end + def test_should_render_formatted_html_erb_template_with_bad_accepts_header + @request.env["HTTP_ACCEPT"] = "; a=dsf" + get :formatted_xml_erb + assert_equal '<test>passed formatted html erb</test>', @response.body + end + def test_should_render_formatted_html_erb_template_with_faulty_accepts_header @request.accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, appliction/x-shockwave-flash, */*" get :formatted_xml_erb 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/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 16ba746b9c..8e4339aa0c 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -1253,6 +1253,19 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_equal 'api/v3/products#list', @response.body end + def test_controller_option_with_nesting_and_leading_slash + draw do + scope '/job', controller: 'job' do + scope ':id', action: 'manage_applicant' do + get "/active" + end + end + end + + get '/job/5/active' + assert_equal 'job#manage_applicant', @response.body + end + def test_dynamically_generated_helpers_on_collection_do_not_clobber_resources_url_helper draw do resources :replies do diff --git a/actionpack/test/dispatch/ssl_test.rb b/actionpack/test/dispatch/ssl_test.rb index a9bea7ea73..61b55f3d82 100644 --- a/actionpack/test/dispatch/ssl_test.rb +++ b/actionpack/test/dispatch/ssl_test.rb @@ -37,6 +37,11 @@ class SSLTest < ActionDispatch::IntegrationTest response.headers['Strict-Transport-Security'] end + def test_no_hsts_with_insecure_connection + get "http://example.org/" + assert_not response.headers['Strict-Transport-Security'] + end + def test_hsts_header self.app = ActionDispatch::SSL.new(default_app, :hsts => true) get "https://example.org/" @@ -119,6 +124,20 @@ class SSLTest < ActionDispatch::IntegrationTest response.headers['Set-Cookie'].split("\n") end + def test_flag_cookies_as_secure_with_ignore_case + self.app = ActionDispatch::SSL.new(lambda { |env| + headers = { + 'Content-Type' => "text/html", + 'Set-Cookie' => "problem=def; path=/; Secure; HttpOnly" + } + [200, headers, ["OK"]] + }) + + get "https://example.org/" + assert_equal ["problem=def; path=/; Secure; HttpOnly"], + response.headers['Set-Cookie'].split("\n") + end + def test_no_cookies self.app = ActionDispatch::SSL.new(lambda { |env| [200, {'Content-Type' => "text/html"}, ["OK"]] diff --git a/actionview/CHANGELOG.md b/actionview/CHANGELOG.md new file mode 100644 index 0000000000..31e123d916 --- /dev/null +++ b/actionview/CHANGELOG.md @@ -0,0 +1,56 @@ +* Always escape the result of `link_to_unless` method. + + Before: + + link_to_unless(true, '<b>Showing</b>', 'github.com') + # => "<b>Showing</b>" + + After: + + link_to_unless(true, '<b>Showing</b>', 'github.com') + # => "<b>Showing</b>" + + *dtaniwaki* + +* 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. 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..ee670b5cc0 --- /dev/null +++ b/actionview/Rakefile @@ -0,0 +1,81 @@ +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, '-w', '-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") + t.warning = true + t.verbose = true +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..ba24510e56 100644 --- a/actionpack/lib/action_view/flows.rb +++ b/actionview/lib/action_view/flows.rb @@ -36,7 +36,7 @@ module ActionView @root = Fiber.current.object_id end - # Try to get an stored content. If the content + # Try to get stored content. If the content # is not available and we are inside the layout # fiber, we set that we are waiting for the given # key and yield. @@ -73,4 +73,4 @@ module ActionView Fiber.current.object_id != @root end end -end
\ No newline at end of file +end 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 0b957adb91..0b957adb91 100644 --- a/actionpack/lib/action_view/helpers/asset_url_helper.rb +++ b/actionview/lib/action_view/helpers/asset_url_helper.rb 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..21f892f443 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionview/lib/action_view/helpers/form_options_helper.rb @@ -653,7 +653,7 @@ module ActionView # # Example object structure for use with this method: # class Post < ActiveRecord::Base - # has_and_belongs_to_many :author + # has_and_belongs_to_many :authors # end # class Author < ActiveRecord::Base # has_and_belongs_to_many :posts 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 732f35643a..732f35643a 100644 --- a/actionpack/lib/action_view/helpers/tag_helper.rb +++ b/actionview/lib/action_view/helpers/tag_helper.rb 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 388dcf1f13..388dcf1f13 100644 --- a/actionpack/lib/action_view/helpers/tags/collection_helpers.rb +++ b/actionview/lib/action_view/helpers/tags/collection_helpers.rb 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 19e5941971..19e5941971 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionview/lib/action_view/helpers/url_helper.rb 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 214a13654e..214a13654e 100644 --- a/actionpack/test/template/asset_tag_helper_test.rb +++ b/actionview/test/template/asset_tag_helper_test.rb 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 bc9c21dfd3..bc9c21dfd3 100644 --- a/actionpack/test/template/form_collections_helper_test.rb +++ b/actionview/test/template/form_collections_helper_test.rb 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 802da5d566..802da5d566 100644 --- a/actionpack/test/template/tag_helper_test.rb +++ b/actionview/test/template/tag_helper_test.rb 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 eb4349015a..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 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/examples/validations.rb b/activemodel/examples/validations.rb index a56ec4db39..2c5cc11f49 100644 --- a/activemodel/examples/validations.rb +++ b/activemodel/examples/validations.rb @@ -4,7 +4,7 @@ class Person include ActiveModel::Conversion include ActiveModel::Validations - validates_presence_of :name + validates :name, presence: true attr_accessor :name 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/lib/active_model/secure_password.rb b/activemodel/lib/active_model/secure_password.rb index e553590671..7156f1bb30 100644 --- a/activemodel/lib/active_model/secure_password.rb +++ b/activemodel/lib/active_model/secure_password.rb @@ -15,7 +15,7 @@ module ActiveModel # argument. You can add more validations by hand if need be. # # If you don't need the confirmation validation, just don't set any - # value to the password_confirmation attribute and the the validation + # value to the password_confirmation attribute and the validation # will not be triggered. # # You need to add bcrypt-ruby (~> 3.0.0) to Gemfile to use #has_secure_password: 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 5fa83928a8..e5ec611999 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -3,6 +3,59 @@ *Ben Woosley* +* 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`. diff --git a/activerecord/Rakefile b/activerecord/Rakefile index 136bb1dfbc..18f03e6562 100644 --- a/activerecord/Rakefile +++ b/activerecord/Rakefile @@ -62,7 +62,7 @@ end (Dir["test/cases/**/*_test.rb"].reject { |x| x =~ /\/adapters\// } + Dir["test/cases/adapters/#{adapter_short}/**/*_test.rb"]).all? do |file| - sh(ruby, "-Itest", file) + sh(ruby, '-w' ,"-Itest", file) end or raise "Failures" end @@ -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/examples/performance.rb b/activerecord/examples/performance.rb index ad12f8597f..1f23b13cac 100644 --- a/activerecord/examples/performance.rb +++ b/activerecord/examples/performance.rb @@ -5,12 +5,12 @@ require 'benchmark/ips' TIME = (ENV['BENCHMARK_TIME'] || 20).to_i RECORDS = (ENV['BENCHMARK_RECORDS'] || TIME*1000).to_i -conn = { :adapter => 'sqlite3', :database => ':memory:' } +conn = { adapter: 'sqlite3', database: ':memory:' } ActiveRecord::Base.establish_connection(conn) class User < ActiveRecord::Base - connection.create_table :users, :force => true do |t| + connection.create_table :users, force: true do |t| t.string :name, :email t.timestamps end @@ -19,7 +19,7 @@ class User < ActiveRecord::Base end class Exhibit < ActiveRecord::Base - connection.create_table :exhibits, :force => true do |t| + connection.create_table :exhibits, force: true do |t| t.belongs_to :user t.string :name t.text :notes @@ -77,28 +77,28 @@ today = Date.today puts "Inserting #{RECORDS} users and exhibits..." RECORDS.times do user = User.create( - :created_at => today, - :name => ActiveRecord::Faker.name, - :email => ActiveRecord::Faker.email + created_at: today, + name: ActiveRecord::Faker.name, + email: ActiveRecord::Faker.email ) Exhibit.create( - :created_at => today, - :name => ActiveRecord::Faker.name, - :user => user, - :notes => notes + created_at: today, + name: ActiveRecord::Faker.name, + user: user, + notes: notes ) end Benchmark.ips(TIME) do |x| ar_obj = Exhibit.find(1) - attrs = { :name => 'sam' } - attrs_first = { :name => 'sam' } - attrs_second = { :name => 'tom' } + attrs = { name: 'sam' } + attrs_first = { name: 'sam' } + attrs_second = { name: 'tom' } exhibit = { - :name => ActiveRecord::Faker.name, - :notes => notes, - :created_at => Date.today + name: ActiveRecord::Faker.name, + notes: notes, + :created_at: Date.today } x.report("Model#id") do diff --git a/activerecord/examples/simple.rb b/activerecord/examples/simple.rb index c12f746992..ee3c42a05b 100644 --- a/activerecord/examples/simple.rb +++ b/activerecord/examples/simple.rb @@ -2,13 +2,13 @@ $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib" require 'active_record' class Person < ActiveRecord::Base - establish_connection :adapter => 'sqlite3', :database => 'foobar.db' - connection.create_table table_name, :force => true do |t| + establish_connection adapter: 'sqlite3', database: 'foobar.db' + connection.create_table table_name, force: true do |t| t.string :name end end -bob = Person.create!(:name => 'bob') +bob = Person.create!(name: 'bob') puts Person.all.inspect bob.destroy puts Person.all.inspect 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/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/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/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/railtie.rb b/activerecord/lib/active_record/railtie.rb index 31a0ace864..afb0be7b74 100644 --- a/activerecord/lib/active_record/railtie.rb +++ b/activerecord/lib/active_record/railtie.rb @@ -37,16 +37,21 @@ module ActiveRecord rake_tasks do require "active_record/base" - ActiveRecord::Tasks::DatabaseTasks.env = Rails.env - ActiveRecord::Tasks::DatabaseTasks.db_dir = Rails.application.config.paths["db"].first ActiveRecord::Tasks::DatabaseTasks.seed_loader = Rails.application - ActiveRecord::Tasks::DatabaseTasks.database_configuration = Rails.application.config.database_configuration - ActiveRecord::Tasks::DatabaseTasks.migrations_paths = Rails.application.paths['db/migrate'].to_a - ActiveRecord::Tasks::DatabaseTasks.fixtures_path = File.join Rails.root, 'test', 'fixtures' + ActiveRecord::Tasks::DatabaseTasks.env = Rails.env + + namespace :db do + task :load_config do + ActiveRecord::Tasks::DatabaseTasks.db_dir = Rails.application.config.paths["db"].first + ActiveRecord::Tasks::DatabaseTasks.database_configuration = Rails.application.config.database_configuration + ActiveRecord::Tasks::DatabaseTasks.migrations_paths = Rails.application.paths['db/migrate'].to_a + ActiveRecord::Tasks::DatabaseTasks.fixtures_path = File.join Rails.root, 'test', 'fixtures' - if defined?(APP_RAKEFILE) && engine = Rails::Engine.find(find_engine_path(APP_RAKEFILE)) - if engine.paths['db/migrate'].existent - ActiveRecord::Tasks::DatabaseTasks.migrations_paths += engine.paths['db/migrate'].to_a + if defined?(ENGINE_PATH) && engine = Rails::Engine.find(ENGINE_PATH) + if engine.paths['db/migrate'].existent + ActiveRecord::Tasks::DatabaseTasks.migrations_paths += engine.paths['db/migrate'].to_a + end + end 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/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb index 77634b40bb..62920d936f 100644 --- a/activerecord/lib/active_record/transactions.rb +++ b/activerecord/lib/active_record/transactions.rb @@ -245,7 +245,7 @@ module ActiveRecord if options.is_a?(Hash) && options[:on] assert_valid_transaction_action(options[:on]) options[:if] = Array(options[:if]) - fire_on = Array(options[:on]).map(&:to_sym) + fire_on = Array(options[:on]) options[:if] << "transaction_include_any_action?(#{fire_on})" end end @@ -288,17 +288,17 @@ module ActiveRecord clear_transaction_record_state end - # Call the after_commit callbacks + # Call the +after_commit+ callbacks. # # Ensure that it is not called if the object was never persisted (failed create), - # but call it after the commit of a destroyed object + # but call it after the commit of a destroyed object. def committed! #:nodoc: run_callbacks :commit if destroyed? || persisted? ensure clear_transaction_record_state end - # Call the after rollback callbacks. The restore_state argument indicates if the record + # Call the +after_rollback+ callbacks. The +force_restore_state+ argument indicates if the record # state should be rolled back to the beginning or just to the last savepoint. def rolledback!(force_restore_state = false) #:nodoc: run_callbacks :rollback @@ -306,7 +306,7 @@ module ActiveRecord restore_transaction_record_state(force_restore_state) end - # Add the record to the current transaction so that the :after_rollback and :after_commit callbacks + # Add the record to the current transaction so that the +after_rollback+ and +after_commit+ callbacks # can be called. def add_to_transaction if self.class.connection.add_transaction_record(self) diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index 168ce13097..8f5e18b863 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -176,6 +176,16 @@ class HasManyAssociationsTest < ActiveRecord::TestCase assert_raise(ActiveRecord::SubclassNotFound) { firm.companies.build(:type => "Account") } end + test "building the association with an array" do + speedometer = Speedometer.new(speedometer_id: "a") + data = [{name: "first"}, {name: "second"}] + speedometer.minivans.build(data) + + assert_equal 2, speedometer.minivans.size + assert speedometer.save + assert_equal ["first", "second"], speedometer.reload.minivans.map(&:name) + end + def test_association_keys_bypass_attribute_protection car = Car.create(:name => 'honda') @@ -1326,6 +1336,33 @@ class HasManyAssociationsTest < ActiveRecord::TestCase assert_equal [companies(:second_client).id, companies(:first_client).id], companies(:first_firm).clients_ordered_by_name_ids end + def test_get_ids_for_association_on_new_record_does_not_try_to_find_records + Company.columns # Load schema information so we don't query below + Contract.columns # if running just this test. + + company = Company.new + assert_queries(0) do + company.contract_ids + end + + assert_equal [], company.contract_ids + end + + def test_set_ids_for_association_on_new_record_applies_association_correctly + contract_a = Contract.create! + contract_b = Contract.create! + Contract.create! # another contract + company = Company.new(:name => "Some Company") + + company.contract_ids = [contract_a.id, contract_b.id] + assert_equal [contract_a.id, contract_b.id], company.contract_ids + assert_equal [contract_a, contract_b], company.contracts + + company.save! + assert_equal company, contract_a.reload.company + assert_equal company, contract_b.reload.company + end + def test_assign_ids_ignoring_blanks firm = Firm.create!(:name => 'Apple') firm.client_ids = [companies(:first_client).id, nil, companies(:second_client).id, ''] 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/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/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/activerecord/test/cases/result_test.rb b/activerecord/test/cases/result_test.rb index c305d273fb..b6c583dbf5 100644 --- a/activerecord/test/cases/result_test.rb +++ b/activerecord/test/cases/result_test.rb @@ -2,7 +2,6 @@ require "cases/helper" module ActiveRecord class ResultTest < ActiveRecord::TestCase - def result Result.new(['col_1', 'col_2'], [ ['row 1 col 1', 'row 1 col 2'], diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index b69333851f..45f71daa08 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -1,3 +1,10 @@ +* 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. diff --git a/activesupport/Rakefile b/activesupport/Rakefile index f50225a9f0..99770bace9 100644 --- a/activesupport/Rakefile +++ b/activesupport/Rakefile @@ -14,7 +14,7 @@ namespace :test do task :isolated do ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) Dir.glob("test/**/*_test.rb").all? do |file| - sh(ruby, '-Ilib:test', file) + sh(ruby, '-w', '-Ilib:test', file) end or raise "Failures" end end @@ -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/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/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/assets/stylesheets/main.css b/guides/assets/stylesheets/main.css index dd029e6314..ca319c91cf 100644 --- a/guides/assets/stylesheets/main.css +++ b/guides/assets/stylesheets/main.css @@ -244,7 +244,7 @@ body { #subCol { position: absolute; z-index: 0; - top: 0; + top: 21px; right: 0; background: #FFF; padding: 1em 1.5em 1em 1.25em; diff --git a/guides/code/getting_started/app/views/posts/_form.html.erb b/guides/code/getting_started/app/views/posts/_form.html.erb index c9fb74af9c..f2f83585e1 100644 --- a/guides/code/getting_started/app/views/posts/_form.html.erb +++ b/guides/code/getting_started/app/views/posts/_form.html.erb @@ -1,6 +1,6 @@ <%= form_for @post do |f| %> <% if @post.errors.any? %> - <div id="errorExplanation"> + <div id="error_explanation"> <h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2> <ul> @@ -14,12 +14,12 @@ <%= f.label :title %><br> <%= f.text_field :title %> </p> - + <p> <%= f.label :text %><br> <%= f.text_area :text %> </p> - + <p> <%= f.submit %> </p> diff --git a/guides/source/_welcome.html.erb b/guides/source/_welcome.html.erb index a50961a0c7..9210c40c17 100644 --- a/guides/source/_welcome.html.erb +++ b/guides/source/_welcome.html.erb @@ -10,10 +10,13 @@ </p> <% else %> <p> - These are the new guides for Rails 3.2 based on <a href="https://github.com/rails/rails/tree/<%= @version %>"><%= @version %></a>. + These are the new guides for Rails 4.0 based on <a href="https://github.com/rails/rails/tree/<%= @version %>"><%= @version %></a>. These guides are designed to make you immediately productive with Rails, and to help you understand how all of the pieces fit together. </p> <% end %> <p> + The guides for Rails 3.2.x are available at <a href="http://guides.rubyonrails.org/v3.2.13/">http://guides.rubyonrails.org/v3.2.13/</a>. +</p> +<p> The guides for Rails 2.3.x are available at <a href="http://guides.rubyonrails.org/v2.3.11/">http://guides.rubyonrails.org/v2.3.11/</a>. </p> diff --git a/guides/source/action_view_overview.md b/guides/source/action_view_overview.md index dea1ddef71..187c910e37 100644 --- a/guides/source/action_view_overview.md +++ b/guides/source/action_view_overview.md @@ -1090,7 +1090,7 @@ Example object structure for use with this method: ```ruby class Post < ActiveRecord::Base - has_and_belongs_to_many :author + has_and_belongs_to_many :authors end class Author < ActiveRecord::Base diff --git a/guides/source/command_line.md b/guides/source/command_line.md index e0b44bbf93..e00e70576f 100644 --- a/guides/source/command_line.md +++ b/guides/source/command_line.md @@ -64,7 +64,7 @@ With no further work, `rails server` will run our new shiny Rails app: $ cd commandsapp $ rails server => Booting WEBrick -=> Rails 3.2.3 application starting in development on http://0.0.0.0:3000 +=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2012-05-28 00:39:41] INFO WEBrick 1.3.1 @@ -289,7 +289,7 @@ If you wish to test out some code without changing any data, you can do that by ```bash $ rails console --sandbox -Loading development environment in sandbox (Rails 3.2.3) +Loading development environment in sandbox (Rails 4.0.0) Any modifications you make will be rolled back on exit irb(main):001:0> ``` 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/debugging_rails_applications.md b/guides/source/debugging_rails_applications.md index 70055c1d7d..0860e3119d 100644 --- a/guides/source/debugging_rails_applications.md +++ b/guides/source/debugging_rails_applications.md @@ -248,7 +248,7 @@ Make sure you have started your web server with the option `--debugger`: ```bash $ rails server --debugger => Booting WEBrick -=> Rails 3.2.13 application starting on http://0.0.0.0:3000 +=> Rails 4.0.0 application starting on http://0.0.0.0:3000 => Debugger enabled ... ``` @@ -504,7 +504,7 @@ TIP: You can use the debugger while using `rails console`. Just remember to `req ``` $ rails console -Loading development environment (Rails 3.2.13) +Loading development environment (Rails 4.0.0) >> require "debugger" => [] >> author = Author.first diff --git a/guides/source/form_helpers.md b/guides/source/form_helpers.md index b409534cb0..7f37a298b1 100644 --- a/guides/source/form_helpers.md +++ b/guides/source/form_helpers.md @@ -973,4 +973,4 @@ As a convenience you can instead pass the symbol `:all_blank` which will create ### Adding Fields on the Fly -Rather than rendering multiple sets of fields ahead of time you may wish to add them only when a user clicks on an 'Add new child' button. Rails does not provide any builtin support for this. When generating new sets of fields you must ensure the the key of the associated array is unique - the current javascript date (milliseconds after the epoch) is a common choice. +Rather than rendering multiple sets of fields ahead of time you may wish to add them only when a user clicks on an 'Add new child' button. Rails does not provide any builtin support for this. When generating new sets of fields you must ensure the key of the associated array is unique - the current javascript date (milliseconds after the epoch) is a common choice. diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index 0d44f0e776..a773519bba 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -793,7 +793,7 @@ something went wrong. To do that, you'll modify ```html+erb <%= form_for :post, url: posts_path do |f| %> <% if @post.errors.any? %> - <div id="errorExplanation"> + <div id="error_explanation"> <h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2> <ul> @@ -862,7 +862,7 @@ it look as follows: <%= form_for :post, url: post_path(@post.id), method: :patch do |f| %> <% if @post.errors.any? %> - <div id="errorExplanation"> + <div id="error_explanation"> <h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2> <ul> @@ -977,7 +977,7 @@ content: ```html+erb <%= form_for @post do |f| %> <% if @post.errors.any? %> - <div id="errorExplanation"> + <div id="error_explanation"> <h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2> <ul> 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/guides/source/routing.md b/guides/source/routing.md index 076b9dd176..592429952a 100644 --- a/guides/source/routing.md +++ b/guides/source/routing.md @@ -767,11 +767,11 @@ You can also reuse dynamic segments from the match in the path to redirect to: get '/stories/:name', to: redirect('/posts/%{name}') ``` -You can also provide a block to redirect, which receives the params and the request object: +You can also provide a block to redirect, which receives the symbolized path parameters and the request object: ```ruby -get '/stories/:name', to: redirect {|params, req| "/posts/#{params[:name].pluralize}" } -get '/stories', to: redirect {|p, req| "/posts/#{req.subdomain}" } +get '/stories/:name', to: redirect {|path_params, req| "/posts/#{path_params[:name].pluralize}" } +get '/stories', to: redirect {|path_params, req| "/posts/#{req.subdomain}" } ``` Please note that this redirection is a 301 "Moved Permanently" redirect. Keep in mind that some web browsers or proxy servers will cache this type of redirect, making the old page inaccessible. 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/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/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/test/application/assets_test.rb b/railties/test/application/assets_test.rb index 94446c6c1b..633d864dac 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -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" 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 |