aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/Rakefile1
-rw-r--r--actionpack/actionpack.gemspec7
-rw-r--r--actionpack/lib/abstract_controller/layouts.rb10
-rw-r--r--actionpack/lib/abstract_controller/rendering_controller.rb14
-rw-r--r--actionpack/lib/action_controller/base.rb2
-rw-r--r--actionpack/lib/action_controller/legacy/layout.rb4
-rw-r--r--actionpack/lib/action_controller/testing/process.rb2
-rw-r--r--actionpack/lib/action_dispatch/middleware/session/cookie_store.rb15
-rw-r--r--actionpack/lib/action_view.rb1
-rw-r--r--actionpack/lib/action_view/helpers/asset_tag_helper.rb8
-rw-r--r--actionpack/lib/action_view/helpers/tag_helper.rb2
-rw-r--r--actionpack/lib/action_view/template/resolver.rb185
-rw-r--r--actionpack/test/abstract_controller/abstract_controller_test.rb4
-rw-r--r--actionpack/test/activerecord/active_record_store_test.rb1
-rw-r--r--actionpack/test/controller/action_pack_assertions_test.rb1
-rw-r--r--actionpack/test/controller/addresses_render_test.rb8
-rw-r--r--actionpack/test/controller/integration_test.rb1
-rw-r--r--actionpack/test/controller/routing_test.rb78
-rw-r--r--actionpack/test/controller/url_rewriter_test.rb1
-rw-r--r--actionpack/test/controller/view_paths_test.rb2
-rw-r--r--actionpack/test/dispatch/session/cookie_store_test.rb4
-rw-r--r--actionpack/test/lib/controller/fake_controllers.rb10
-rw-r--r--actionpack/test/lib/fixture_template.rb61
-rw-r--r--actionpack/test/new_base/content_negotiation_test.rb18
-rw-r--r--actionpack/test/new_base/render_file_test.rb2
-rw-r--r--actionpack/test/template/asset_tag_helper_test.rb62
-rw-r--r--actionpack/test/template/compiled_templates_test.rb3
-rw-r--r--actionpack/test/template/url_helper_test.rb118
28 files changed, 356 insertions, 269 deletions
diff --git a/actionpack/Rakefile b/actionpack/Rakefile
index 7b7a83d2fc..06f6905af0 100644
--- a/actionpack/Rakefile
+++ b/actionpack/Rakefile
@@ -116,6 +116,7 @@ spec = Gem::Specification.new do |s|
s.requirements << 'none'
s.add_dependency('activesupport', '= 3.0.pre' + PKG_BUILD)
+ s.add_dependency('activemodel', '= 3.0.pre' + PKG_BUILD)
s.add_dependency('rack', '~> 1.0.0')
s.add_dependency('rack-test', '~> 0.4.2')
diff --git a/actionpack/actionpack.gemspec b/actionpack/actionpack.gemspec
index c38f8f67a2..b91993a12e 100644
--- a/actionpack/actionpack.gemspec
+++ b/actionpack/actionpack.gemspec
@@ -7,10 +7,10 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["David Heinemeier Hansson"]
s.autorequire = %q{action_controller}
- s.date = %q{2009-08-31}
+ s.date = %q{2009-09-01}
s.description = %q{Eases web-request routing, handling, and response as a half-way front, half-way page controller. Implemented with specific emphasis on enabling easy unit/integration testing that doesn't require a browser.}
s.email = %q{david@loudthinking.com}
- s.files = ["Rakefile", "install.rb", "README", "RUNNING_UNIT_TESTS", "CHANGELOG", "MIT-LICENSE", "lib/abstract_controller", "lib/abstract_controller/base.rb", "lib/abstract_controller/benchmarker.rb", "lib/abstract_controller/callbacks.rb", "lib/abstract_controller/exceptions.rb", "lib/abstract_controller/helpers.rb", "lib/abstract_controller/layouts.rb", "lib/abstract_controller/logger.rb", "lib/abstract_controller/rendering_controller.rb", "lib/abstract_controller.rb", "lib/action_controller", "lib/action_controller/base.rb", "lib/action_controller/caching", "lib/action_controller/caching/actions.rb", "lib/action_controller/caching/fragments.rb", "lib/action_controller/caching/pages.rb", "lib/action_controller/caching/sweeping.rb", "lib/action_controller/caching.rb", "lib/action_controller/deprecated.rb", "lib/action_controller/dispatch", "lib/action_controller/dispatch/dispatcher.rb", "lib/action_controller/dispatch/middlewares.rb", "lib/action_controller/legacy", "lib/action_controller/legacy/layout.rb", "lib/action_controller/metal", "lib/action_controller/metal/compatibility.rb", "lib/action_controller/metal/conditional_get.rb", "lib/action_controller/metal/cookies.rb", "lib/action_controller/metal/exceptions.rb", "lib/action_controller/metal/filter_parameter_logging.rb", "lib/action_controller/metal/flash.rb", "lib/action_controller/metal/helpers.rb", "lib/action_controller/metal/hide_actions.rb", "lib/action_controller/metal/http_authentication.rb", "lib/action_controller/metal/layouts.rb", "lib/action_controller/metal/mime_responds.rb", "lib/action_controller/metal/rack_convenience.rb", "lib/action_controller/metal/redirector.rb", "lib/action_controller/metal/render_options.rb", "lib/action_controller/metal/rendering_controller.rb", "lib/action_controller/metal/request_forgery_protection.rb", "lib/action_controller/metal/rescuable.rb", "lib/action_controller/metal/responder.rb", "lib/action_controller/metal/session.rb", "lib/action_controller/metal/session_management.rb", "lib/action_controller/metal/streaming.rb", "lib/action_controller/metal/testing.rb", "lib/action_controller/metal/url_for.rb", "lib/action_controller/metal/verification.rb", "lib/action_controller/metal.rb", "lib/action_controller/middleware.rb", "lib/action_controller/record_identifier.rb", "lib/action_controller/routing", "lib/action_controller/routing/builder.rb", "lib/action_controller/routing/generation", "lib/action_controller/routing/generation/polymorphic_routes.rb", "lib/action_controller/routing/generation/url_rewriter.rb", "lib/action_controller/routing/optimisations.rb", "lib/action_controller/routing/recognition_optimisation.rb", "lib/action_controller/routing/resources.rb", "lib/action_controller/routing/route.rb", "lib/action_controller/routing/route_set.rb", "lib/action_controller/routing/routing_ext.rb", "lib/action_controller/routing/segments.rb", "lib/action_controller/routing.rb", "lib/action_controller/testing", "lib/action_controller/testing/integration.rb", "lib/action_controller/testing/performance_test.rb", "lib/action_controller/testing/process.rb", "lib/action_controller/testing/test_case.rb", "lib/action_controller/translation.rb", "lib/action_controller/vendor", "lib/action_controller/vendor/html-scanner", "lib/action_controller/vendor/html-scanner/html", "lib/action_controller/vendor/html-scanner/html/document.rb", "lib/action_controller/vendor/html-scanner/html/node.rb", "lib/action_controller/vendor/html-scanner/html/sanitizer.rb", "lib/action_controller/vendor/html-scanner/html/selector.rb", "lib/action_controller/vendor/html-scanner/html/tokenizer.rb", "lib/action_controller/vendor/html-scanner/html/version.rb", "lib/action_controller/vendor/html-scanner.rb", "lib/action_controller.rb", "lib/action_dispatch", "lib/action_dispatch/http", "lib/action_dispatch/http/headers.rb", "lib/action_dispatch/http/mime_type.rb", "lib/action_dispatch/http/mime_types.rb", "lib/action_dispatch/http/request.rb", "lib/action_dispatch/http/response.rb", "lib/action_dispatch/http/status_codes.rb", "lib/action_dispatch/middleware", "lib/action_dispatch/middleware/callbacks.rb", "lib/action_dispatch/middleware/params_parser.rb", "lib/action_dispatch/middleware/rescue.rb", "lib/action_dispatch/middleware/session", "lib/action_dispatch/middleware/session/abstract_store.rb", "lib/action_dispatch/middleware/session/cookie_store.rb", "lib/action_dispatch/middleware/session/mem_cache_store.rb", "lib/action_dispatch/middleware/show_exceptions.rb", "lib/action_dispatch/middleware/stack.rb", "lib/action_dispatch/middleware/templates", "lib/action_dispatch/middleware/templates/rescues", "lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb", "lib/action_dispatch/middleware/templates/rescues/_trace.erb", "lib/action_dispatch/middleware/templates/rescues/diagnostics.erb", "lib/action_dispatch/middleware/templates/rescues/layout.erb", "lib/action_dispatch/middleware/templates/rescues/missing_template.erb", "lib/action_dispatch/middleware/templates/rescues/routing_error.erb", "lib/action_dispatch/middleware/templates/rescues/template_error.erb", "lib/action_dispatch/middleware/templates/rescues/unknown_action.erb", "lib/action_dispatch/testing", "lib/action_dispatch/testing/assertions", "lib/action_dispatch/testing/assertions/dom.rb", "lib/action_dispatch/testing/assertions/model.rb", "lib/action_dispatch/testing/assertions/response.rb", "lib/action_dispatch/testing/assertions/routing.rb", "lib/action_dispatch/testing/assertions/selector.rb", "lib/action_dispatch/testing/assertions/tag.rb", "lib/action_dispatch/testing/assertions.rb", "lib/action_dispatch/testing/test_request.rb", "lib/action_dispatch/testing/test_response.rb", "lib/action_dispatch.rb", "lib/action_pack", "lib/action_pack/version.rb", "lib/action_pack.rb", "lib/action_view", "lib/action_view/base.rb", "lib/action_view/context.rb", "lib/action_view/erb", "lib/action_view/erb/util.rb", "lib/action_view/helpers", "lib/action_view/helpers/active_model_helper.rb", "lib/action_view/helpers/ajax_helper.rb", "lib/action_view/helpers/asset_tag_helper.rb", "lib/action_view/helpers/atom_feed_helper.rb", "lib/action_view/helpers/benchmark_helper.rb", "lib/action_view/helpers/cache_helper.rb", "lib/action_view/helpers/capture_helper.rb", "lib/action_view/helpers/date_helper.rb", "lib/action_view/helpers/debug_helper.rb", "lib/action_view/helpers/form_helper.rb", "lib/action_view/helpers/form_options_helper.rb", "lib/action_view/helpers/form_tag_helper.rb", "lib/action_view/helpers/javascript_helper.rb", "lib/action_view/helpers/number_helper.rb", "lib/action_view/helpers/prototype_helper.rb", "lib/action_view/helpers/record_identification_helper.rb", "lib/action_view/helpers/record_tag_helper.rb", "lib/action_view/helpers/sanitize_helper.rb", "lib/action_view/helpers/scriptaculous_helper.rb", "lib/action_view/helpers/tag_helper.rb", "lib/action_view/helpers/text_helper.rb", "lib/action_view/helpers/translation_helper.rb", "lib/action_view/helpers/url_helper.rb", "lib/action_view/helpers.rb", "lib/action_view/locale", "lib/action_view/locale/en.yml", "lib/action_view/paths.rb", "lib/action_view/render", "lib/action_view/render/partials.rb", "lib/action_view/render/rendering.rb", "lib/action_view/template", "lib/action_view/template/error.rb", "lib/action_view/template/handler.rb", "lib/action_view/template/handlers", "lib/action_view/template/handlers/builder.rb", "lib/action_view/template/handlers/erb.rb", "lib/action_view/template/handlers/rjs.rb", "lib/action_view/template/handlers.rb", "lib/action_view/template/inline.rb", "lib/action_view/template/partial.rb", "lib/action_view/template/renderable.rb", "lib/action_view/template/resolver.rb", "lib/action_view/template/template.rb", "lib/action_view/template/text.rb", "lib/action_view/test_case.rb", "lib/action_view.rb", "lib/actionpack.rb", "test/abstract_controller", "test/abstract_controller/abstract_controller_test.rb", "test/abstract_controller/callbacks_test.rb", "test/abstract_controller/helper_test.rb", "test/abstract_controller/layouts_test.rb", "test/abstract_controller/test_helper.rb", "test/abstract_controller/views", "test/abstract_controller/views/abstract_controller", "test/abstract_controller/views/abstract_controller/testing", "test/abstract_controller/views/abstract_controller/testing/me3", "test/abstract_controller/views/abstract_controller/testing/me3/formatted.html.erb", "test/abstract_controller/views/abstract_controller/testing/me3/index.erb", "test/abstract_controller/views/abstract_controller/testing/me4", "test/abstract_controller/views/abstract_controller/testing/me4/index.erb", "test/abstract_controller/views/abstract_controller/testing/me5", "test/abstract_controller/views/abstract_controller/testing/me5/index.erb", "test/abstract_controller/views/action_with_ivars.erb", "test/abstract_controller/views/helper_test.erb", "test/abstract_controller/views/index.erb", "test/abstract_controller/views/layouts", "test/abstract_controller/views/layouts/abstract_controller", "test/abstract_controller/views/layouts/abstract_controller/testing", "test/abstract_controller/views/layouts/abstract_controller/testing/me4.erb", "test/abstract_controller/views/layouts/application.erb", "test/abstract_controller/views/naked_render.erb", "test/abstract_unit.rb", "test/activerecord", "test/activerecord/active_record_store_test.rb", "test/activerecord/polymorphic_routes_test.rb", "test/activerecord/render_partial_with_record_identification_test.rb", "test/controller", "test/controller/action_pack_assertions_test.rb", "test/controller/addresses_render_test.rb", "test/controller/assert_select_test.rb", "test/controller/base_test.rb", "test/controller/benchmark_test.rb", "test/controller/caching_test.rb", "test/controller/capture_test.rb", "test/controller/content_type_test.rb", "test/controller/controller_fixtures", "test/controller/controller_fixtures/app", "test/controller/controller_fixtures/app/controllers", "test/controller/controller_fixtures/app/controllers/admin", "test/controller/controller_fixtures/app/controllers/admin/user_controller.rb", "test/controller/controller_fixtures/app/controllers/user_controller.rb", "test/controller/controller_fixtures/vendor", "test/controller/controller_fixtures/vendor/plugins", "test/controller/controller_fixtures/vendor/plugins/bad_plugin", "test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib", "test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb", "test/controller/cookie_test.rb", "test/controller/deprecation", "test/controller/deprecation/deprecated_base_methods_test.rb", "test/controller/dispatcher_test.rb", "test/controller/filter_params_test.rb", "test/controller/filters_test.rb", "test/controller/flash_test.rb", "test/controller/helper_test.rb", "test/controller/http_basic_authentication_test.rb", "test/controller/http_digest_authentication_test.rb", "test/controller/integration_test.rb", "test/controller/layout_test.rb", "test/controller/logging_test.rb", "test/controller/mime_responds_test.rb", "test/controller/record_identifier_test.rb", "test/controller/redirect_test.rb", "test/controller/render_js_test.rb", "test/controller/render_json_test.rb", "test/controller/render_other_test.rb", "test/controller/render_test.rb", "test/controller/render_xml_test.rb", "test/controller/request", "test/controller/request/test_request_test.rb", "test/controller/request_forgery_protection_test.rb", "test/controller/rescue_test.rb", "test/controller/resources_test.rb", "test/controller/routing_test.rb", "test/controller/selector_test.rb", "test/controller/send_file_test.rb", "test/controller/test_test.rb", "test/controller/translation_test.rb", "test/controller/url_rewriter_test.rb", "test/controller/verification_test.rb", "test/controller/view_paths_test.rb", "test/controller/webservice_test.rb", "test/dispatch", "test/dispatch/header_test.rb", "test/dispatch/middleware_stack_test.rb", "test/dispatch/mime_type_test.rb", "test/dispatch/rack_test.rb", "test/dispatch/request", "test/dispatch/request/json_params_parsing_test.rb", "test/dispatch/request/multipart_params_parsing_test.rb", "test/dispatch/request/query_string_parsing_test.rb", "test/dispatch/request/url_encoded_params_parsing_test.rb", "test/dispatch/request/xml_params_parsing_test.rb", "test/dispatch/request_test.rb", "test/dispatch/response_test.rb", "test/dispatch/session", "test/dispatch/session/cookie_store_test.rb", "test/dispatch/session/mem_cache_store_test.rb", "test/dispatch/session/test_session_test.rb", "test/dispatch/show_exceptions_test.rb", "test/dispatch/test_request_test.rb", "test/fixtures", "test/fixtures/_top_level_partial.html.erb", "test/fixtures/_top_level_partial_only.erb", "test/fixtures/addresses", "test/fixtures/addresses/list.erb", "test/fixtures/alternate_helpers", "test/fixtures/alternate_helpers/foo_helper.rb", "test/fixtures/bad_customers", "test/fixtures/bad_customers/_bad_customer.html.erb", "test/fixtures/companies.yml", "test/fixtures/company.rb", "test/fixtures/content_type", "test/fixtures/content_type/render_default_content_types_for_respond_to.xml.erb", "test/fixtures/content_type/render_default_for_rhtml.rhtml", "test/fixtures/content_type/render_default_for_rjs.rjs", "test/fixtures/content_type/render_default_for_rxml.rxml", "test/fixtures/customers", "test/fixtures/customers/_customer.html.erb", "test/fixtures/db_definitions", "test/fixtures/db_definitions/sqlite.sql", "test/fixtures/developer.rb", "test/fixtures/developers", "test/fixtures/developers/_developer.erb", "test/fixtures/developers.yml", "test/fixtures/developers_projects.yml", "test/fixtures/fun", "test/fixtures/fun/games", "test/fixtures/fun/games/_game.erb", "test/fixtures/fun/games/hello_world.erb", "test/fixtures/fun/serious", "test/fixtures/fun/serious/games", "test/fixtures/fun/serious/games/_game.erb", "test/fixtures/functional_caching", "test/fixtures/functional_caching/_partial.erb", "test/fixtures/functional_caching/formatted_fragment_cached.html.erb", "test/fixtures/functional_caching/formatted_fragment_cached.js.rjs", "test/fixtures/functional_caching/formatted_fragment_cached.xml.builder", "test/fixtures/functional_caching/fragment_cached.html.erb", "test/fixtures/functional_caching/html_fragment_cached_with_partial.html.erb", "test/fixtures/functional_caching/inline_fragment_cached.html.erb", "test/fixtures/functional_caching/js_fragment_cached_with_partial.js.rjs", "test/fixtures/good_customers", "test/fixtures/good_customers/_good_customer.html.erb", "test/fixtures/happy_path", "test/fixtures/happy_path/render_action", "test/fixtures/happy_path/render_action/hello_world.erb", "test/fixtures/helpers", "test/fixtures/helpers/abc_helper.rb", "test/fixtures/helpers/fun", "test/fixtures/helpers/fun/games_helper.rb", "test/fixtures/helpers/fun/pdf_helper.rb", "test/fixtures/layout_tests", "test/fixtures/layout_tests/alt", "test/fixtures/layout_tests/alt/hello.rhtml", "test/fixtures/layout_tests/alt/layouts", "test/fixtures/layout_tests/alt/layouts/alt.rhtml", "test/fixtures/layout_tests/layouts", "test/fixtures/layout_tests/layouts/controller_name_space", "test/fixtures/layout_tests/layouts/controller_name_space/nested.rhtml", "test/fixtures/layout_tests/layouts/item.rhtml", "test/fixtures/layout_tests/layouts/layout_test.rhtml", "test/fixtures/layout_tests/layouts/multiple_extensions.html.erb", "test/fixtures/layout_tests/layouts/symlinked", "test/fixtures/layout_tests/layouts/third_party_template_library.mab", "test/fixtures/layout_tests/views", "test/fixtures/layout_tests/views/goodbye.rhtml", "test/fixtures/layout_tests/views/hello.rhtml", "test/fixtures/layouts", "test/fixtures/layouts/_column.html.erb", "test/fixtures/layouts/block_with_layout.erb", "test/fixtures/layouts/builder.builder", "test/fixtures/layouts/partial_with_layout.erb", "test/fixtures/layouts/standard.html.erb", "test/fixtures/layouts/talk_from_action.erb", "test/fixtures/layouts/xhr.html.erb", "test/fixtures/layouts/yield.erb", "test/fixtures/mascot.rb", "test/fixtures/mascots", "test/fixtures/mascots/_mascot.html.erb", "test/fixtures/mascots.yml", "test/fixtures/multipart", "test/fixtures/multipart/binary_file", "test/fixtures/multipart/boundary_problem_file", "test/fixtures/multipart/bracketed_param", "test/fixtures/multipart/empty", "test/fixtures/multipart/hello.txt", "test/fixtures/multipart/large_text_file", "test/fixtures/multipart/mixed_files", "test/fixtures/multipart/mona_lisa.jpg", "test/fixtures/multipart/none", "test/fixtures/multipart/single_parameter", "test/fixtures/multipart/text_file", "test/fixtures/override", "test/fixtures/override/test", "test/fixtures/override/test/hello_world.erb", "test/fixtures/override2", "test/fixtures/override2/layouts", "test/fixtures/override2/layouts/test", "test/fixtures/override2/layouts/test/sub.erb", "test/fixtures/post_test", "test/fixtures/post_test/layouts", "test/fixtures/post_test/layouts/post.html.erb", "test/fixtures/post_test/layouts/super_post.iphone.erb", "test/fixtures/post_test/post", "test/fixtures/post_test/post/index.html.erb", "test/fixtures/post_test/post/index.iphone.erb", "test/fixtures/post_test/super_post", "test/fixtures/post_test/super_post/index.html.erb", "test/fixtures/post_test/super_post/index.iphone.erb", "test/fixtures/project.rb", "test/fixtures/projects", "test/fixtures/projects/_project.erb", "test/fixtures/projects.yml", "test/fixtures/public", "test/fixtures/public/404.html", "test/fixtures/public/500.da.html", "test/fixtures/public/500.html", "test/fixtures/public/absolute", "test/fixtures/public/absolute/test.css", "test/fixtures/public/absolute/test.js", "test/fixtures/public/elsewhere", "test/fixtures/public/elsewhere/cools.js", "test/fixtures/public/elsewhere/file.css", "test/fixtures/public/images", "test/fixtures/public/images/rails.png", "test/fixtures/public/javascripts", "test/fixtures/public/javascripts/application.js", "test/fixtures/public/javascripts/bank.js", "test/fixtures/public/javascripts/cache", "test/fixtures/public/javascripts/common.javascript", "test/fixtures/public/javascripts/controls.js", "test/fixtures/public/javascripts/dragdrop.js", "test/fixtures/public/javascripts/effects.js", "test/fixtures/public/javascripts/prototype.js", "test/fixtures/public/javascripts/robber.js", "test/fixtures/public/javascripts/subdir", "test/fixtures/public/javascripts/subdir/subdir.js", "test/fixtures/public/javascripts/version.1.0.js", "test/fixtures/public/stylesheets", "test/fixtures/public/stylesheets/bank.css", "test/fixtures/public/stylesheets/random.styles", "test/fixtures/public/stylesheets/robber.css", "test/fixtures/public/stylesheets/subdir", "test/fixtures/public/stylesheets/subdir/subdir.css", "test/fixtures/public/stylesheets/version.1.0.css", "test/fixtures/quiz", "test/fixtures/quiz/questions", "test/fixtures/quiz/questions/_question.html.erb", "test/fixtures/replies", "test/fixtures/replies/_reply.erb", "test/fixtures/replies.yml", "test/fixtures/reply.rb", "test/fixtures/respond_to", "test/fixtures/respond_to/all_types_with_layout.html.erb", "test/fixtures/respond_to/all_types_with_layout.js.rjs", "test/fixtures/respond_to/custom_constant_handling_without_block.mobile.erb", "test/fixtures/respond_to/iphone_with_html_response_type.html.erb", "test/fixtures/respond_to/iphone_with_html_response_type.iphone.erb", "test/fixtures/respond_to/layouts", "test/fixtures/respond_to/layouts/missing.html.erb", "test/fixtures/respond_to/layouts/standard.html.erb", "test/fixtures/respond_to/layouts/standard.iphone.erb", "test/fixtures/respond_to/using_defaults.html.erb", "test/fixtures/respond_to/using_defaults.js.rjs", "test/fixtures/respond_to/using_defaults.xml.builder", "test/fixtures/respond_to/using_defaults_with_type_list.html.erb", "test/fixtures/respond_to/using_defaults_with_type_list.js.rjs", "test/fixtures/respond_to/using_defaults_with_type_list.xml.builder", "test/fixtures/respond_with", "test/fixtures/respond_with/edit.html.erb", "test/fixtures/respond_with/new.html.erb", "test/fixtures/respond_with/using_defaults.html.erb", "test/fixtures/respond_with/using_defaults.js.rjs", "test/fixtures/respond_with/using_defaults_with_type_list.js.rjs", "test/fixtures/respond_with/using_defaults_with_type_list.xml.builder", "test/fixtures/respond_with/using_resource.js.rjs", "test/fixtures/scope", "test/fixtures/scope/test", "test/fixtures/scope/test/modgreet.erb", "test/fixtures/shared.html.erb", "test/fixtures/symlink_parent", "test/fixtures/symlink_parent/symlinked_layout.erb", "test/fixtures/test", "test/fixtures/test/_counter.html.erb", "test/fixtures/test/_customer.erb", "test/fixtures/test/_customer_counter.erb", "test/fixtures/test/_customer_greeting.erb", "test/fixtures/test/_customer_with_var.erb", "test/fixtures/test/_form.erb", "test/fixtures/test/_hash_greeting.erb", "test/fixtures/test/_hash_object.erb", "test/fixtures/test/_hello.builder", "test/fixtures/test/_labelling_form.erb", "test/fixtures/test/_layout_for_block_with_args.html.erb", "test/fixtures/test/_layout_for_partial.html.erb", "test/fixtures/test/_local_inspector.html.erb", "test/fixtures/test/_one.html.erb", "test/fixtures/test/_partial.erb", "test/fixtures/test/_partial.html.erb", "test/fixtures/test/_partial.js.erb", "test/fixtures/test/_partial_for_use_in_layout.html.erb", "test/fixtures/test/_partial_only.erb", "test/fixtures/test/_partial_with_only_html_version.html.erb", "test/fixtures/test/_person.erb", "test/fixtures/test/_raise.html.erb", "test/fixtures/test/_two.html.erb", "test/fixtures/test/action_talk_to_layout.erb", "test/fixtures/test/basic.html.erb", "test/fixtures/test/calling_partial_with_layout.html.erb", "test/fixtures/test/capturing.erb", "test/fixtures/test/content_for.erb", "test/fixtures/test/content_for_concatenated.erb", "test/fixtures/test/content_for_with_parameter.erb", "test/fixtures/test/delete_with_js.rjs", "test/fixtures/test/dont_pick_me", "test/fixtures/test/dot.directory", "test/fixtures/test/dot.directory/render_file_with_ivar.erb", "test/fixtures/test/enum_rjs_test.rjs", "test/fixtures/test/formatted_html_erb.html.erb", "test/fixtures/test/formatted_xml_erb.builder", "test/fixtures/test/formatted_xml_erb.html.erb", "test/fixtures/test/formatted_xml_erb.xml.erb", "test/fixtures/test/greeting.html.erb", "test/fixtures/test/greeting.js.rjs", "test/fixtures/test/greeting.xml.erb", "test/fixtures/test/hello.builder", "test/fixtures/test/hello_world.da.html.erb", "test/fixtures/test/hello_world.erb", "test/fixtures/test/hello_world.erb~", "test/fixtures/test/hello_world.pt-BR.html.erb", "test/fixtures/test/hello_world_container.builder", "test/fixtures/test/hello_world_from_rxml.builder", "test/fixtures/test/hello_world_with_layout_false.erb", "test/fixtures/test/hello_xml_world.builder", "test/fixtures/test/hyphen-ated.erb", "test/fixtures/test/implicit_content_type.atom.builder", "test/fixtures/test/list.erb", "test/fixtures/test/malformed", "test/fixtures/test/malformed/malformed.en.html.erb~", "test/fixtures/test/malformed/malformed.erb~", "test/fixtures/test/malformed/malformed.html.erb~", "test/fixtures/test/nested_layout.erb", "test/fixtures/test/non_erb_block_content_for.builder", "test/fixtures/test/potential_conflicts.erb", "test/fixtures/test/render_explicit_html_template.js.rjs", "test/fixtures/test/render_file_from_template.html.erb", "test/fixtures/test/render_file_with_ivar.erb", "test/fixtures/test/render_file_with_locals.erb", "test/fixtures/test/render_file_with_locals_and_default.erb", "test/fixtures/test/render_implicit_html_template.js.rjs", "test/fixtures/test/render_implicit_html_template_from_xhr_request.da.html.erb", "test/fixtures/test/render_implicit_html_template_from_xhr_request.html.erb", "test/fixtures/test/render_implicit_js_template_without_layout.js.erb", "test/fixtures/test/render_to_string_test.erb", "test/fixtures/test/sub_template_raise.html.erb", "test/fixtures/test/template.erb", "test/fixtures/test/update_element_with_capture.erb", "test/fixtures/test/using_layout_around_block.html.erb", "test/fixtures/test/utf8.html.erb", "test/fixtures/test/utf8_magic.html.erb", "test/fixtures/topic.rb", "test/fixtures/topics", "test/fixtures/topics/_topic.html.erb", "test/fixtures/topics.yml", "test/html-scanner", "test/html-scanner/cdata_node_test.rb", "test/html-scanner/document_test.rb", "test/html-scanner/node_test.rb", "test/html-scanner/sanitizer_test.rb", "test/html-scanner/tag_node_test.rb", "test/html-scanner/text_node_test.rb", "test/html-scanner/tokenizer_test.rb", "test/javascript", "test/javascript/ajax_test.rb", "test/lib", "test/lib/active_record_unit.rb", "test/lib/controller", "test/lib/controller/fake_controllers.rb", "test/lib/controller/fake_models.rb", "test/lib/fixture_template.rb", "test/lib/testing_sandbox.rb", "test/new_base", "test/new_base/base_test.rb", "test/new_base/content_type_test.rb", "test/new_base/etag_test.rb", "test/new_base/metal_test.rb", "test/new_base/redirect_test.rb", "test/new_base/render_action_test.rb", "test/new_base/render_file_test.rb", "test/new_base/render_implicit_action_test.rb", "test/new_base/render_layout_test.rb", "test/new_base/render_partial_test.rb", "test/new_base/render_rjs_test.rb", "test/new_base/render_template_test.rb", "test/new_base/render_test.rb", "test/new_base/render_text_test.rb", "test/new_base/render_xml_test.rb", "test/new_base/test_helper.rb", "test/old_base", "test/old_base/abstract_unit.rb", "test/runner", "test/template", "test/template/active_record_helper_i18n_test.rb", "test/template/active_record_helper_test.rb", "test/template/asset_tag_helper_test.rb", "test/template/atom_feed_helper_test.rb", "test/template/benchmark_helper_test.rb", "test/template/body_parts_test.rb", "test/template/capture_helper_test.rb", "test/template/compiled_templates_test.rb", "test/template/date_helper_i18n_test.rb", "test/template/date_helper_test.rb", "test/template/erb_util_test.rb", "test/template/form_helper_test.rb", "test/template/form_options_helper_i18n_test.rb", "test/template/form_options_helper_test.rb", "test/template/form_tag_helper_test.rb", "test/template/javascript_helper_test.rb", "test/template/number_helper_i18n_test.rb", "test/template/number_helper_test.rb", "test/template/output_buffer_test.rb", "test/template/prototype_helper_test.rb", "test/template/record_tag_helper_test.rb", "test/template/render_test.rb", "test/template/sanitize_helper_test.rb", "test/template/scriptaculous_helper_test.rb", "test/template/tag_helper_test.rb", "test/template/test_test.rb", "test/template/text_helper_test.rb", "test/template/translation_helper_test.rb", "test/template/url_helper_test.rb", "test/tmp", "test/view", "test/view/test_case_test.rb"]
+ s.files = ["Rakefile", "install.rb", "README", "RUNNING_UNIT_TESTS", "CHANGELOG", "MIT-LICENSE", "lib/abstract_controller", "lib/abstract_controller/base.rb", "lib/abstract_controller/benchmarker.rb", "lib/abstract_controller/callbacks.rb", "lib/abstract_controller/exceptions.rb", "lib/abstract_controller/helpers.rb", "lib/abstract_controller/layouts.rb", "lib/abstract_controller/logger.rb", "lib/abstract_controller/rendering_controller.rb", "lib/abstract_controller.rb", "lib/action_controller", "lib/action_controller/base.rb", "lib/action_controller/caching", "lib/action_controller/caching/actions.rb", "lib/action_controller/caching/fragments.rb", "lib/action_controller/caching/pages.rb", "lib/action_controller/caching/sweeping.rb", "lib/action_controller/caching.rb", "lib/action_controller/deprecated.rb", "lib/action_controller/dispatch", "lib/action_controller/dispatch/dispatcher.rb", "lib/action_controller/dispatch/middlewares.rb", "lib/action_controller/legacy", "lib/action_controller/legacy/layout.rb", "lib/action_controller/metal", "lib/action_controller/metal/compatibility.rb", "lib/action_controller/metal/conditional_get.rb", "lib/action_controller/metal/cookies.rb", "lib/action_controller/metal/exceptions.rb", "lib/action_controller/metal/filter_parameter_logging.rb", "lib/action_controller/metal/flash.rb", "lib/action_controller/metal/helpers.rb", "lib/action_controller/metal/hide_actions.rb", "lib/action_controller/metal/http_authentication.rb", "lib/action_controller/metal/layouts.rb", "lib/action_controller/metal/mime_responds.rb", "lib/action_controller/metal/rack_convenience.rb", "lib/action_controller/metal/redirector.rb", "lib/action_controller/metal/render_options.rb", "lib/action_controller/metal/rendering_controller.rb", "lib/action_controller/metal/request_forgery_protection.rb", "lib/action_controller/metal/rescuable.rb", "lib/action_controller/metal/responder.rb", "lib/action_controller/metal/session.rb", "lib/action_controller/metal/session_management.rb", "lib/action_controller/metal/streaming.rb", "lib/action_controller/metal/testing.rb", "lib/action_controller/metal/url_for.rb", "lib/action_controller/metal/verification.rb", "lib/action_controller/metal.rb", "lib/action_controller/middleware.rb", "lib/action_controller/record_identifier.rb", "lib/action_controller/routing", "lib/action_controller/routing/builder.rb", "lib/action_controller/routing/generation", "lib/action_controller/routing/generation/polymorphic_routes.rb", "lib/action_controller/routing/generation/url_rewriter.rb", "lib/action_controller/routing/optimisations.rb", "lib/action_controller/routing/recognition_optimisation.rb", "lib/action_controller/routing/resources.rb", "lib/action_controller/routing/route.rb", "lib/action_controller/routing/route_set.rb", "lib/action_controller/routing/routing_ext.rb", "lib/action_controller/routing/segments.rb", "lib/action_controller/routing.rb", "lib/action_controller/testing", "lib/action_controller/testing/integration.rb", "lib/action_controller/testing/performance_test.rb", "lib/action_controller/testing/process.rb", "lib/action_controller/testing/test_case.rb", "lib/action_controller/translation.rb", "lib/action_controller/vendor", "lib/action_controller/vendor/html-scanner", "lib/action_controller/vendor/html-scanner/html", "lib/action_controller/vendor/html-scanner/html/document.rb", "lib/action_controller/vendor/html-scanner/html/node.rb", "lib/action_controller/vendor/html-scanner/html/sanitizer.rb", "lib/action_controller/vendor/html-scanner/html/selector.rb", "lib/action_controller/vendor/html-scanner/html/tokenizer.rb", "lib/action_controller/vendor/html-scanner/html/version.rb", "lib/action_controller/vendor/html-scanner.rb", "lib/action_controller.rb", "lib/action_dispatch", "lib/action_dispatch/http", "lib/action_dispatch/http/headers.rb", "lib/action_dispatch/http/mime_type.rb", "lib/action_dispatch/http/mime_types.rb", "lib/action_dispatch/http/request.rb", "lib/action_dispatch/http/response.rb", "lib/action_dispatch/http/status_codes.rb", "lib/action_dispatch/middleware", "lib/action_dispatch/middleware/callbacks.rb", "lib/action_dispatch/middleware/params_parser.rb", "lib/action_dispatch/middleware/rescue.rb", "lib/action_dispatch/middleware/session", "lib/action_dispatch/middleware/session/abstract_store.rb", "lib/action_dispatch/middleware/session/cookie_store.rb", "lib/action_dispatch/middleware/session/mem_cache_store.rb", "lib/action_dispatch/middleware/show_exceptions.rb", "lib/action_dispatch/middleware/stack.rb", "lib/action_dispatch/middleware/templates", "lib/action_dispatch/middleware/templates/rescues", "lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb", "lib/action_dispatch/middleware/templates/rescues/_trace.erb", "lib/action_dispatch/middleware/templates/rescues/diagnostics.erb", "lib/action_dispatch/middleware/templates/rescues/layout.erb", "lib/action_dispatch/middleware/templates/rescues/missing_template.erb", "lib/action_dispatch/middleware/templates/rescues/routing_error.erb", "lib/action_dispatch/middleware/templates/rescues/template_error.erb", "lib/action_dispatch/middleware/templates/rescues/unknown_action.erb", "lib/action_dispatch/testing", "lib/action_dispatch/testing/assertions", "lib/action_dispatch/testing/assertions/dom.rb", "lib/action_dispatch/testing/assertions/model.rb", "lib/action_dispatch/testing/assertions/response.rb", "lib/action_dispatch/testing/assertions/routing.rb", "lib/action_dispatch/testing/assertions/selector.rb", "lib/action_dispatch/testing/assertions/tag.rb", "lib/action_dispatch/testing/assertions.rb", "lib/action_dispatch/testing/test_request.rb", "lib/action_dispatch/testing/test_response.rb", "lib/action_dispatch/vendor", "lib/action_dispatch/vendor/rack-1.1.pre", "lib/action_dispatch/vendor/rack-test", "lib/action_dispatch/vendor/rack-test/rack", "lib/action_dispatch.rb", "lib/action_pack", "lib/action_pack/version.rb", "lib/action_pack.rb", "lib/action_view", "lib/action_view/base.rb", "lib/action_view/context.rb", "lib/action_view/erb", "lib/action_view/erb/util.rb", "lib/action_view/helpers", "lib/action_view/helpers/active_model_helper.rb", "lib/action_view/helpers/ajax_helper.rb", "lib/action_view/helpers/asset_tag_helper.rb", "lib/action_view/helpers/atom_feed_helper.rb", "lib/action_view/helpers/benchmark_helper.rb", "lib/action_view/helpers/cache_helper.rb", "lib/action_view/helpers/capture_helper.rb", "lib/action_view/helpers/date_helper.rb", "lib/action_view/helpers/debug_helper.rb", "lib/action_view/helpers/form_helper.rb", "lib/action_view/helpers/form_options_helper.rb", "lib/action_view/helpers/form_tag_helper.rb", "lib/action_view/helpers/javascript_helper.rb", "lib/action_view/helpers/number_helper.rb", "lib/action_view/helpers/prototype_helper.rb", "lib/action_view/helpers/record_identification_helper.rb", "lib/action_view/helpers/record_tag_helper.rb", "lib/action_view/helpers/sanitize_helper.rb", "lib/action_view/helpers/scriptaculous_helper.rb", "lib/action_view/helpers/tag_helper.rb", "lib/action_view/helpers/text_helper.rb", "lib/action_view/helpers/translation_helper.rb", "lib/action_view/helpers/url_helper.rb", "lib/action_view/helpers.rb", "lib/action_view/locale", "lib/action_view/locale/en.yml", "lib/action_view/paths.rb", "lib/action_view/render", "lib/action_view/render/partials.rb", "lib/action_view/render/rendering.rb", "lib/action_view/template", "lib/action_view/template/error.rb", "lib/action_view/template/handler.rb", "lib/action_view/template/handlers", "lib/action_view/template/handlers/builder.rb", "lib/action_view/template/handlers/erb.rb", "lib/action_view/template/handlers/rjs.rb", "lib/action_view/template/handlers.rb", "lib/action_view/template/inline.rb", "lib/action_view/template/partial.rb", "lib/action_view/template/renderable.rb", "lib/action_view/template/resolver.rb", "lib/action_view/template/template.rb", "lib/action_view/template/text.rb", "lib/action_view/test_case.rb", "lib/action_view.rb", "lib/actionpack.rb", "test/abstract_controller", "test/abstract_controller/abstract_controller_test.rb", "test/abstract_controller/callbacks_test.rb", "test/abstract_controller/helper_test.rb", "test/abstract_controller/layouts_test.rb", "test/abstract_controller/test_helper.rb", "test/abstract_controller/views", "test/abstract_controller/views/abstract_controller", "test/abstract_controller/views/abstract_controller/testing", "test/abstract_controller/views/abstract_controller/testing/me3", "test/abstract_controller/views/abstract_controller/testing/me3/formatted.html.erb", "test/abstract_controller/views/abstract_controller/testing/me3/index.erb", "test/abstract_controller/views/abstract_controller/testing/me4", "test/abstract_controller/views/abstract_controller/testing/me4/index.erb", "test/abstract_controller/views/abstract_controller/testing/me5", "test/abstract_controller/views/abstract_controller/testing/me5/index.erb", "test/abstract_controller/views/action_with_ivars.erb", "test/abstract_controller/views/helper_test.erb", "test/abstract_controller/views/index.erb", "test/abstract_controller/views/layouts", "test/abstract_controller/views/layouts/abstract_controller", "test/abstract_controller/views/layouts/abstract_controller/testing", "test/abstract_controller/views/layouts/abstract_controller/testing/me4.erb", "test/abstract_controller/views/layouts/application.erb", "test/abstract_controller/views/naked_render.erb", "test/abstract_unit.rb", "test/activerecord", "test/activerecord/active_record_store_test.rb", "test/activerecord/polymorphic_routes_test.rb", "test/activerecord/render_partial_with_record_identification_test.rb", "test/controller", "test/controller/action_pack_assertions_test.rb", "test/controller/addresses_render_test.rb", "test/controller/assert_select_test.rb", "test/controller/base_test.rb", "test/controller/benchmark_test.rb", "test/controller/caching_test.rb", "test/controller/capture_test.rb", "test/controller/content_type_test.rb", "test/controller/controller_fixtures", "test/controller/controller_fixtures/app", "test/controller/controller_fixtures/app/controllers", "test/controller/controller_fixtures/app/controllers/admin", "test/controller/controller_fixtures/app/controllers/admin/user_controller.rb", "test/controller/controller_fixtures/app/controllers/user_controller.rb", "test/controller/controller_fixtures/vendor", "test/controller/controller_fixtures/vendor/plugins", "test/controller/controller_fixtures/vendor/plugins/bad_plugin", "test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib", "test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb", "test/controller/cookie_test.rb", "test/controller/deprecation", "test/controller/deprecation/deprecated_base_methods_test.rb", "test/controller/dispatcher_test.rb", "test/controller/filter_params_test.rb", "test/controller/filters_test.rb", "test/controller/flash_test.rb", "test/controller/helper_test.rb", "test/controller/http_basic_authentication_test.rb", "test/controller/http_digest_authentication_test.rb", "test/controller/integration_test.rb", "test/controller/layout_test.rb", "test/controller/logging_test.rb", "test/controller/mime_responds_test.rb", "test/controller/record_identifier_test.rb", "test/controller/redirect_test.rb", "test/controller/render_js_test.rb", "test/controller/render_json_test.rb", "test/controller/render_other_test.rb", "test/controller/render_test.rb", "test/controller/render_xml_test.rb", "test/controller/request", "test/controller/request/test_request_test.rb", "test/controller/request_forgery_protection_test.rb", "test/controller/rescue_test.rb", "test/controller/resources_test.rb", "test/controller/routing_test.rb", "test/controller/selector_test.rb", "test/controller/send_file_test.rb", "test/controller/test_test.rb", "test/controller/translation_test.rb", "test/controller/url_rewriter_test.rb", "test/controller/verification_test.rb", "test/controller/view_paths_test.rb", "test/controller/webservice_test.rb", "test/dispatch", "test/dispatch/header_test.rb", "test/dispatch/middleware_stack_test.rb", "test/dispatch/mime_type_test.rb", "test/dispatch/rack_test.rb", "test/dispatch/request", "test/dispatch/request/json_params_parsing_test.rb", "test/dispatch/request/multipart_params_parsing_test.rb", "test/dispatch/request/query_string_parsing_test.rb", "test/dispatch/request/url_encoded_params_parsing_test.rb", "test/dispatch/request/xml_params_parsing_test.rb", "test/dispatch/request_test.rb", "test/dispatch/response_test.rb", "test/dispatch/session", "test/dispatch/session/cookie_store_test.rb", "test/dispatch/session/mem_cache_store_test.rb", "test/dispatch/session/test_session_test.rb", "test/dispatch/show_exceptions_test.rb", "test/dispatch/test_request_test.rb", "test/fixtures", "test/fixtures/_top_level_partial.html.erb", "test/fixtures/_top_level_partial_only.erb", "test/fixtures/addresses", "test/fixtures/addresses/list.erb", "test/fixtures/alternate_helpers", "test/fixtures/alternate_helpers/foo_helper.rb", "test/fixtures/bad_customers", "test/fixtures/bad_customers/_bad_customer.html.erb", "test/fixtures/companies.yml", "test/fixtures/company.rb", "test/fixtures/content_type", "test/fixtures/content_type/render_default_content_types_for_respond_to.xml.erb", "test/fixtures/content_type/render_default_for_rhtml.rhtml", "test/fixtures/content_type/render_default_for_rjs.rjs", "test/fixtures/content_type/render_default_for_rxml.rxml", "test/fixtures/customers", "test/fixtures/customers/_customer.html.erb", "test/fixtures/db_definitions", "test/fixtures/db_definitions/sqlite.sql", "test/fixtures/developer.rb", "test/fixtures/developers", "test/fixtures/developers/_developer.erb", "test/fixtures/developers.yml", "test/fixtures/developers_projects.yml", "test/fixtures/fun", "test/fixtures/fun/games", "test/fixtures/fun/games/_game.erb", "test/fixtures/fun/games/hello_world.erb", "test/fixtures/fun/serious", "test/fixtures/fun/serious/games", "test/fixtures/fun/serious/games/_game.erb", "test/fixtures/functional_caching", "test/fixtures/functional_caching/_partial.erb", "test/fixtures/functional_caching/formatted_fragment_cached.html.erb", "test/fixtures/functional_caching/formatted_fragment_cached.js.rjs", "test/fixtures/functional_caching/formatted_fragment_cached.xml.builder", "test/fixtures/functional_caching/fragment_cached.html.erb", "test/fixtures/functional_caching/html_fragment_cached_with_partial.html.erb", "test/fixtures/functional_caching/inline_fragment_cached.html.erb", "test/fixtures/functional_caching/js_fragment_cached_with_partial.js.rjs", "test/fixtures/good_customers", "test/fixtures/good_customers/_good_customer.html.erb", "test/fixtures/happy_path", "test/fixtures/happy_path/render_action", "test/fixtures/happy_path/render_action/hello_world.erb", "test/fixtures/helpers", "test/fixtures/helpers/abc_helper.rb", "test/fixtures/helpers/fun", "test/fixtures/helpers/fun/games_helper.rb", "test/fixtures/helpers/fun/pdf_helper.rb", "test/fixtures/layout_tests", "test/fixtures/layout_tests/alt", "test/fixtures/layout_tests/alt/hello.rhtml", "test/fixtures/layout_tests/alt/layouts", "test/fixtures/layout_tests/alt/layouts/alt.rhtml", "test/fixtures/layout_tests/layouts", "test/fixtures/layout_tests/layouts/controller_name_space", "test/fixtures/layout_tests/layouts/controller_name_space/nested.rhtml", "test/fixtures/layout_tests/layouts/item.rhtml", "test/fixtures/layout_tests/layouts/layout_test.rhtml", "test/fixtures/layout_tests/layouts/multiple_extensions.html.erb", "test/fixtures/layout_tests/layouts/symlinked", "test/fixtures/layout_tests/layouts/third_party_template_library.mab", "test/fixtures/layout_tests/views", "test/fixtures/layout_tests/views/goodbye.rhtml", "test/fixtures/layout_tests/views/hello.rhtml", "test/fixtures/layouts", "test/fixtures/layouts/_column.html.erb", "test/fixtures/layouts/block_with_layout.erb", "test/fixtures/layouts/builder.builder", "test/fixtures/layouts/partial_with_layout.erb", "test/fixtures/layouts/standard.html.erb", "test/fixtures/layouts/talk_from_action.erb", "test/fixtures/layouts/xhr.html.erb", "test/fixtures/layouts/yield.erb", "test/fixtures/mascot.rb", "test/fixtures/mascots", "test/fixtures/mascots/_mascot.html.erb", "test/fixtures/mascots.yml", "test/fixtures/multipart", "test/fixtures/multipart/binary_file", "test/fixtures/multipart/boundary_problem_file", "test/fixtures/multipart/bracketed_param", "test/fixtures/multipart/empty", "test/fixtures/multipart/hello.txt", "test/fixtures/multipart/large_text_file", "test/fixtures/multipart/mixed_files", "test/fixtures/multipart/mona_lisa.jpg", "test/fixtures/multipart/none", "test/fixtures/multipart/single_parameter", "test/fixtures/multipart/text_file", "test/fixtures/override", "test/fixtures/override/test", "test/fixtures/override/test/hello_world.erb", "test/fixtures/override2", "test/fixtures/override2/layouts", "test/fixtures/override2/layouts/test", "test/fixtures/override2/layouts/test/sub.erb", "test/fixtures/post_test", "test/fixtures/post_test/layouts", "test/fixtures/post_test/layouts/post.html.erb", "test/fixtures/post_test/layouts/super_post.iphone.erb", "test/fixtures/post_test/post", "test/fixtures/post_test/post/index.html.erb", "test/fixtures/post_test/post/index.iphone.erb", "test/fixtures/post_test/super_post", "test/fixtures/post_test/super_post/index.html.erb", "test/fixtures/post_test/super_post/index.iphone.erb", "test/fixtures/project.rb", "test/fixtures/projects", "test/fixtures/projects/_project.erb", "test/fixtures/projects.yml", "test/fixtures/public", "test/fixtures/public/404.html", "test/fixtures/public/500.da.html", "test/fixtures/public/500.html", "test/fixtures/public/absolute", "test/fixtures/public/absolute/test.css", "test/fixtures/public/absolute/test.js", "test/fixtures/public/elsewhere", "test/fixtures/public/elsewhere/cools.js", "test/fixtures/public/elsewhere/file.css", "test/fixtures/public/images", "test/fixtures/public/images/rails.png", "test/fixtures/public/javascripts", "test/fixtures/public/javascripts/application.js", "test/fixtures/public/javascripts/bank.js", "test/fixtures/public/javascripts/cache", "test/fixtures/public/javascripts/common.javascript", "test/fixtures/public/javascripts/controls.js", "test/fixtures/public/javascripts/dragdrop.js", "test/fixtures/public/javascripts/effects.js", "test/fixtures/public/javascripts/prototype.js", "test/fixtures/public/javascripts/robber.js", "test/fixtures/public/javascripts/subdir", "test/fixtures/public/javascripts/subdir/subdir.js", "test/fixtures/public/javascripts/version.1.0.js", "test/fixtures/public/stylesheets", "test/fixtures/public/stylesheets/bank.css", "test/fixtures/public/stylesheets/random.styles", "test/fixtures/public/stylesheets/robber.css", "test/fixtures/public/stylesheets/subdir", "test/fixtures/public/stylesheets/subdir/subdir.css", "test/fixtures/public/stylesheets/version.1.0.css", "test/fixtures/quiz", "test/fixtures/quiz/questions", "test/fixtures/quiz/questions/_question.html.erb", "test/fixtures/replies", "test/fixtures/replies/_reply.erb", "test/fixtures/replies.yml", "test/fixtures/reply.rb", "test/fixtures/respond_to", "test/fixtures/respond_to/all_types_with_layout.html.erb", "test/fixtures/respond_to/all_types_with_layout.js.rjs", "test/fixtures/respond_to/custom_constant_handling_without_block.mobile.erb", "test/fixtures/respond_to/iphone_with_html_response_type.html.erb", "test/fixtures/respond_to/iphone_with_html_response_type.iphone.erb", "test/fixtures/respond_to/layouts", "test/fixtures/respond_to/layouts/missing.html.erb", "test/fixtures/respond_to/layouts/standard.html.erb", "test/fixtures/respond_to/layouts/standard.iphone.erb", "test/fixtures/respond_to/using_defaults.html.erb", "test/fixtures/respond_to/using_defaults.js.rjs", "test/fixtures/respond_to/using_defaults.xml.builder", "test/fixtures/respond_to/using_defaults_with_type_list.html.erb", "test/fixtures/respond_to/using_defaults_with_type_list.js.rjs", "test/fixtures/respond_to/using_defaults_with_type_list.xml.builder", "test/fixtures/respond_with", "test/fixtures/respond_with/edit.html.erb", "test/fixtures/respond_with/new.html.erb", "test/fixtures/respond_with/using_defaults.html.erb", "test/fixtures/respond_with/using_defaults.js.rjs", "test/fixtures/respond_with/using_defaults_with_type_list.js.rjs", "test/fixtures/respond_with/using_defaults_with_type_list.xml.builder", "test/fixtures/respond_with/using_resource.js.rjs", "test/fixtures/scope", "test/fixtures/scope/test", "test/fixtures/scope/test/modgreet.erb", "test/fixtures/shared.html.erb", "test/fixtures/symlink_parent", "test/fixtures/symlink_parent/symlinked_layout.erb", "test/fixtures/test", "test/fixtures/test/_counter.html.erb", "test/fixtures/test/_customer.erb", "test/fixtures/test/_customer_counter.erb", "test/fixtures/test/_customer_greeting.erb", "test/fixtures/test/_customer_with_var.erb", "test/fixtures/test/_form.erb", "test/fixtures/test/_hash_greeting.erb", "test/fixtures/test/_hash_object.erb", "test/fixtures/test/_hello.builder", "test/fixtures/test/_labelling_form.erb", "test/fixtures/test/_layout_for_block_with_args.html.erb", "test/fixtures/test/_layout_for_partial.html.erb", "test/fixtures/test/_local_inspector.html.erb", "test/fixtures/test/_one.html.erb", "test/fixtures/test/_partial.erb", "test/fixtures/test/_partial.html.erb", "test/fixtures/test/_partial.js.erb", "test/fixtures/test/_partial_for_use_in_layout.html.erb", "test/fixtures/test/_partial_only.erb", "test/fixtures/test/_partial_with_only_html_version.html.erb", "test/fixtures/test/_person.erb", "test/fixtures/test/_raise.html.erb", "test/fixtures/test/_two.html.erb", "test/fixtures/test/action_talk_to_layout.erb", "test/fixtures/test/basic.html.erb", "test/fixtures/test/calling_partial_with_layout.html.erb", "test/fixtures/test/capturing.erb", "test/fixtures/test/content_for.erb", "test/fixtures/test/content_for_concatenated.erb", "test/fixtures/test/content_for_with_parameter.erb", "test/fixtures/test/delete_with_js.rjs", "test/fixtures/test/dont_pick_me", "test/fixtures/test/dot.directory", "test/fixtures/test/dot.directory/render_file_with_ivar.erb", "test/fixtures/test/enum_rjs_test.rjs", "test/fixtures/test/formatted_html_erb.html.erb", "test/fixtures/test/formatted_xml_erb.builder", "test/fixtures/test/formatted_xml_erb.html.erb", "test/fixtures/test/formatted_xml_erb.xml.erb", "test/fixtures/test/greeting.html.erb", "test/fixtures/test/greeting.js.rjs", "test/fixtures/test/greeting.xml.erb", "test/fixtures/test/hello.builder", "test/fixtures/test/hello_world.da.html.erb", "test/fixtures/test/hello_world.erb", "test/fixtures/test/hello_world.erb~", "test/fixtures/test/hello_world.pt-BR.html.erb", "test/fixtures/test/hello_world_container.builder", "test/fixtures/test/hello_world_from_rxml.builder", "test/fixtures/test/hello_world_with_layout_false.erb", "test/fixtures/test/hello_xml_world.builder", "test/fixtures/test/hyphen-ated.erb", "test/fixtures/test/implicit_content_type.atom.builder", "test/fixtures/test/list.erb", "test/fixtures/test/malformed", "test/fixtures/test/malformed/malformed.en.html.erb~", "test/fixtures/test/malformed/malformed.erb~", "test/fixtures/test/malformed/malformed.html.erb~", "test/fixtures/test/nested_layout.erb", "test/fixtures/test/non_erb_block_content_for.builder", "test/fixtures/test/potential_conflicts.erb", "test/fixtures/test/render_explicit_html_template.js.rjs", "test/fixtures/test/render_file_from_template.html.erb", "test/fixtures/test/render_file_with_ivar.erb", "test/fixtures/test/render_file_with_locals.erb", "test/fixtures/test/render_file_with_locals_and_default.erb", "test/fixtures/test/render_implicit_html_template.js.rjs", "test/fixtures/test/render_implicit_html_template_from_xhr_request.da.html.erb", "test/fixtures/test/render_implicit_html_template_from_xhr_request.html.erb", "test/fixtures/test/render_implicit_js_template_without_layout.js.erb", "test/fixtures/test/render_to_string_test.erb", "test/fixtures/test/sub_template_raise.html.erb", "test/fixtures/test/template.erb", "test/fixtures/test/update_element_with_capture.erb", "test/fixtures/test/using_layout_around_block.html.erb", "test/fixtures/test/utf8.html.erb", "test/fixtures/test/utf8_magic.html.erb", "test/fixtures/topic.rb", "test/fixtures/topics", "test/fixtures/topics/_topic.html.erb", "test/fixtures/topics.yml", "test/html-scanner", "test/html-scanner/cdata_node_test.rb", "test/html-scanner/document_test.rb", "test/html-scanner/node_test.rb", "test/html-scanner/sanitizer_test.rb", "test/html-scanner/tag_node_test.rb", "test/html-scanner/text_node_test.rb", "test/html-scanner/tokenizer_test.rb", "test/javascript", "test/javascript/ajax_test.rb", "test/lib", "test/lib/active_record_unit.rb", "test/lib/controller", "test/lib/controller/fake_controllers.rb", "test/lib/controller/fake_models.rb", "test/lib/fixture_template.rb", "test/lib/testing_sandbox.rb", "test/new_base", "test/new_base/base_test.rb", "test/new_base/content_type_test.rb", "test/new_base/etag_test.rb", "test/new_base/metal_test.rb", "test/new_base/redirect_test.rb", "test/new_base/render_action_test.rb", "test/new_base/render_file_test.rb", "test/new_base/render_implicit_action_test.rb", "test/new_base/render_layout_test.rb", "test/new_base/render_partial_test.rb", "test/new_base/render_rjs_test.rb", "test/new_base/render_template_test.rb", "test/new_base/render_test.rb", "test/new_base/render_text_test.rb", "test/new_base/render_xml_test.rb", "test/new_base/test_helper.rb", "test/old_base", "test/old_base/abstract_unit.rb", "test/runner", "test/template", "test/template/active_record_helper_i18n_test.rb", "test/template/active_record_helper_test.rb", "test/template/asset_tag_helper_test.rb", "test/template/atom_feed_helper_test.rb", "test/template/benchmark_helper_test.rb", "test/template/body_parts_test.rb", "test/template/capture_helper_test.rb", "test/template/compiled_templates_test.rb", "test/template/date_helper_i18n_test.rb", "test/template/date_helper_test.rb", "test/template/erb_util_test.rb", "test/template/form_helper_test.rb", "test/template/form_options_helper_i18n_test.rb", "test/template/form_options_helper_test.rb", "test/template/form_tag_helper_test.rb", "test/template/javascript_helper_test.rb", "test/template/number_helper_i18n_test.rb", "test/template/number_helper_test.rb", "test/template/output_buffer_test.rb", "test/template/prototype_helper_test.rb", "test/template/record_tag_helper_test.rb", "test/template/render_test.rb", "test/template/sanitize_helper_test.rb", "test/template/scriptaculous_helper_test.rb", "test/template/tag_helper_test.rb", "test/template/test_test.rb", "test/template/text_helper_test.rb", "test/template/translation_helper_test.rb", "test/template/url_helper_test.rb", "test/tmp", "test/view", "test/view/test_case_test.rb"]
s.homepage = %q{http://www.rubyonrails.org}
s.require_paths = ["lib"]
s.requirements = ["none"]
@@ -24,15 +24,18 @@ Gem::Specification.new do |s|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<activesupport>, ["= 3.0.pre"])
+ s.add_runtime_dependency(%q<activemodel>, ["= 3.0.pre"])
s.add_runtime_dependency(%q<rack>, ["~> 1.0.0"])
s.add_runtime_dependency(%q<rack-test>, ["~> 0.4.2"])
else
s.add_dependency(%q<activesupport>, ["= 3.0.pre"])
+ s.add_dependency(%q<activemodel>, ["= 3.0.pre"])
s.add_dependency(%q<rack>, ["~> 1.0.0"])
s.add_dependency(%q<rack-test>, ["~> 0.4.2"])
end
else
s.add_dependency(%q<activesupport>, ["= 3.0.pre"])
+ s.add_dependency(%q<activemodel>, ["= 3.0.pre"])
s.add_dependency(%q<rack>, ["~> 1.0.0"])
s.add_dependency(%q<rack-test>, ["~> 0.4.2"])
end
diff --git a/actionpack/lib/abstract_controller/layouts.rb b/actionpack/lib/abstract_controller/layouts.rb
index ef66b24dd6..796ef40584 100644
--- a/actionpack/lib/abstract_controller/layouts.rb
+++ b/actionpack/lib/abstract_controller/layouts.rb
@@ -119,17 +119,17 @@ module AbstractController
when true
raise ArgumentError, "Layouts must be specified as a String, Symbol, false, or nil"
when nil
- self.class_eval <<-ruby_eval, __FILE__, __LINE__ + 1
+ self.class_eval <<-RUBY, __FILE__, __LINE__ + 1
def _layout(details)
self.class.cache_layout(details) do
- if view_paths.exists?("#{_implied_layout_name}", details, "layouts")
+ if template_exists?("#{_implied_layout_name}", details, :_prefix => "layouts")
"#{_implied_layout_name}"
else
super
end
end
end
- ruby_eval
+ RUBY
end
self.class_eval { private :_layout }
end
@@ -167,7 +167,7 @@ module AbstractController
# details<Hash{Symbol => Object}>:: A list of details to restrict
# the lookup to. By default, layout lookup is limited to the
# formats specified for the current request.
- def _layout_for_name(name, details = {:formats => formats})
+ def _layout_for_name(name, details)
name && _find_layout(name, details)
end
@@ -183,7 +183,7 @@ module AbstractController
def _find_layout(name, details)
# TODO: Make prefix actually part of details in ViewPath#find_by_parts
prefix = details.key?(:prefix) ? details.delete(:prefix) : "layouts"
- view_paths.find(name, details, prefix)
+ find_template(name, details, :_prefix => prefix)
end
# Returns the default layout for this controller and a given set of details.
diff --git a/actionpack/lib/abstract_controller/rendering_controller.rb b/actionpack/lib/abstract_controller/rendering_controller.rb
index feca1bc4b7..bbf941aa32 100644
--- a/actionpack/lib/abstract_controller/rendering_controller.rb
+++ b/actionpack/lib/abstract_controller/rendering_controller.rb
@@ -112,12 +112,18 @@ module AbstractController
name = (options[:_template_name] || action_name).to_s
options[:_template] ||= with_template_cache(name) do
- view_paths.find(
- name, { :formats => formats }, options[:_prefix], options[:_partial]
- )
+ find_template(name, { :formats => formats }, options)
end
end
-
+
+ def find_template(name, details, options)
+ view_paths.find(name, details, options[:_prefix], options[:_partial])
+ end
+
+ def template_exists?(name, details, options)
+ view_paths.exists?(name, details, options[:_prefix], options[:_partial])
+ end
+
def with_template_cache(name)
yield
end
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 698189bd46..0dae68c7b7 100644
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -51,7 +51,7 @@ module ActionController
def method_for_action(action_name)
super || begin
- if view_paths.exists?(action_name.to_s, {:formats => formats, :locales => [I18n.locale]}, controller_path)
+ if template_exists?(action_name.to_s, {:formats => formats}, :_prefix => controller_path)
"default_render"
end
end
diff --git a/actionpack/lib/action_controller/legacy/layout.rb b/actionpack/lib/action_controller/legacy/layout.rb
index 43aea0eba2..53762158fc 100644
--- a/actionpack/lib/action_controller/legacy/layout.rb
+++ b/actionpack/lib/action_controller/legacy/layout.rb
@@ -191,7 +191,7 @@ module ActionController #:nodoc:
def memoized_find_layout(layout, formats) #:nodoc:
return layout if layout.nil? || layout.respond_to?(:render)
prefix = layout.to_s =~ /layouts\// ? nil : "layouts"
- view_paths.find(layout.to_s, {:formats => formats}, prefix)
+ find_template(layout.to_s, {:formats => formats}, :_prefix => prefix)
end
def find_layout(*args)
@@ -200,7 +200,7 @@ module ActionController #:nodoc:
end
def layout_list #:nodoc:
- Array(view_paths).sum([]) { |path| Dir["#{path.to_str}/layouts/**/*"] }
+ Array(view_paths).sum([]) { |path| Dir["#{path}/layouts/**/*"] }
end
memoize :layout_list
diff --git a/actionpack/lib/action_controller/testing/process.rb b/actionpack/lib/action_controller/testing/process.rb
index 5fb244e3eb..2fccf01040 100644
--- a/actionpack/lib/action_controller/testing/process.rb
+++ b/actionpack/lib/action_controller/testing/process.rb
@@ -133,7 +133,7 @@ module ActionController #:nodoc:
@request.env['REQUEST_METHOD'] = http_method
parameters ||= {}
- @request.assign_parameters(@controller.class.controller_path, action.to_s, parameters)
+ @request.assign_parameters(@controller.class.name.underscore.sub(/_controller$/, ''), action.to_s, parameters)
@request.session = ActionController::TestSession.new(session) unless session.nil?
@request.session["flash"] = ActionController::Flash::FlashHash.new.update(flash) if flash
diff --git a/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb b/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb
index 9cfd6956d0..bd552b458a 100644
--- a/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb
+++ b/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb
@@ -49,7 +49,18 @@ module ActionDispatch
:expire_after => nil,
:httponly => true
}.freeze
+
+ class OptionsHash < Hash
+ def initialize(by, env, default_options)
+ @session_data = env[CookieStore::ENV_SESSION_KEY]
+ default_options.each { |key, value| self[key] = value }
+ end
+ def [](key)
+ key == :id ? @session_data[:session_id] : super(key)
+ end
+ end
+
ENV_SESSION_KEY = "rack.session".freeze
ENV_SESSION_OPTIONS_KEY = "rack.session.options".freeze
HTTP_SET_COOKIE = "Set-Cookie".freeze
@@ -90,8 +101,8 @@ module ActionDispatch
def call(env)
env[ENV_SESSION_KEY] = AbstractStore::SessionHash.new(self, env)
- env[ENV_SESSION_OPTIONS_KEY] = @default_options.dup
-
+ env[ENV_SESSION_OPTIONS_KEY] = OptionsHash.new(self, env, @default_options)
+
status, headers, body = @app.call(env)
session_data = env[ENV_SESSION_KEY]
diff --git a/actionpack/lib/action_view.rb b/actionpack/lib/action_view.rb
index 70176a0ea4..d90afb1913 100644
--- a/actionpack/lib/action_view.rb
+++ b/actionpack/lib/action_view.rb
@@ -40,6 +40,7 @@ module ActionView
autoload :MissingTemplate, 'action_view/base'
autoload :Partials, 'action_view/render/partials'
autoload :Resolver, 'action_view/template/resolver'
+ autoload :PathResolver, 'action_view/template/resolver'
autoload :PathSet, 'action_view/paths'
autoload :Rendering, 'action_view/render/rendering'
autoload :Renderable, 'action_view/template/renderable'
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
index c71840d41f..6b00e7afb5 100644
--- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -286,7 +286,9 @@ module ActionView
end
javascript_src_tag(joined_javascript_name, options)
else
- ensure_javascript_sources!(expand_javascript_sources(sources, recursive)).collect { |source| javascript_src_tag(source, options) }.join("\n")
+ sources = expand_javascript_sources(sources, recursive)
+ ensure_javascript_sources!(sources) if cache
+ sources.collect { |source| javascript_src_tag(source, options) }.join("\n")
end
end
@@ -435,7 +437,9 @@ module ActionView
end
stylesheet_tag(joined_stylesheet_name, options)
else
- ensure_stylesheet_sources!(expand_stylesheet_sources(sources, recursive)).collect { |source| stylesheet_tag(source, options) }.join("\n")
+ sources = expand_stylesheet_sources(sources, recursive)
+ ensure_stylesheet_sources!(sources) if cache
+ sources.collect { |source| stylesheet_tag(source, options) }.join("\n")
end
end
diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb
index ff5a2134ff..7fae0f6b8d 100644
--- a/actionpack/lib/action_view/helpers/tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/tag_helper.rb
@@ -106,7 +106,7 @@ module ActionView
# escape_once("&lt;&lt; Accept & Checkout")
# # => "&lt;&lt; Accept &amp; Checkout"
def escape_once(html)
- html.to_s.gsub(/[\"><]|&(?!([a-zA-Z]+|(#\d+));)/) { |special| ERB::Util::HTML_ESCAPE[special] }
+ ActiveSupport::Multibyte.clean(html.to_s).gsub(/[\"><]|&(?!([a-zA-Z]+|(#\d+));)/) { |special| ERB::Util::HTML_ESCAPE[special] }
end
private
diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb
index 0b4c62d4d0..f5591ead09 100644
--- a/actionpack/lib/action_view/template/resolver.rb
+++ b/actionpack/lib/action_view/template/resolver.rb
@@ -1,9 +1,28 @@
require "pathname"
+require "active_support/core_ext/class"
require "action_view/template/template"
module ActionView
# Abstract superclass
class Resolver
+
+ class_inheritable_accessor(:registered_details)
+ self.registered_details = {}
+
+ def self.register_detail(name, options = {})
+ registered_details[name] = lambda do |val|
+ val ||= yield
+ val |= [nil] unless options[:allow_nil] == false
+ val
+ end
+ end
+
+ register_detail(:locale) { [I18n.locale] }
+ register_detail(:formats) { Mime::SET.symbols }
+ register_detail(:handlers, :allow_nil => false) do
+ TemplateHandlers.extensions
+ end
+
def initialize(options = {})
@cache = options[:cache]
@cached = {}
@@ -11,15 +30,18 @@ module ActionView
# Normalizes the arguments and passes it on to find_template
def find(*args)
- find_all_by_parts(*args).first
+ find_all(*args).first
end
-
- def find_all_by_parts(name, details = {}, prefix = nil, partial = nil)
- details[:locales] = [I18n.locale]
- name = name.to_s.gsub(handler_matcher, '').split("/")
- find_templates(name.pop, details, [prefix, *name].compact.join("/"), partial)
+
+ def find_all(name, details = {}, prefix = nil, partial = nil)
+ details = normalize_details(details)
+ name, prefix = normalize_name(name, prefix)
+
+ cached([name, details, prefix, partial]) do
+ find_templates(name, details, prefix, partial)
+ end
end
-
+
private
# This is what child classes implement. No defaults are needed
@@ -28,29 +50,26 @@ module ActionView
def find_templates(name, details, prefix, partial)
raise NotImplementedError
end
-
- def valid_handlers
- @valid_handlers ||= TemplateHandlers.extensions
- end
- def handler_matcher
- @handler_matcher ||= begin
- e = valid_handlers.join('|')
- /\.(?:#{e})$/
+ def normalize_details(details)
+ details = details.dup
+ # TODO: Refactor this concern out of the resolver
+ details.delete(:formats) if details[:formats] == [:"*/*"]
+ registered_details.each do |k, v|
+ details[k] = v.call(details[k])
end
+ details
end
- def handler_glob
- @handler_glob ||= begin
- e = TemplateHandlers.extensions.map{|h| ".#{h}"}.join(",")
- "{#{e}}"
- end
- end
-
- def formats_glob
- @formats_glob ||= begin
- '{' + Mime::SET.symbols.map { |l| ".#{l}," }.join + '}'
- end
+ # Support legacy foo.erb names even though we now ignore .erb
+ # as well as incorrectly putting part of the path in the template
+ # name instead of the prefix.
+ def normalize_name(name, prefix)
+ handlers = TemplateHandlers.extensions.join('|')
+ name = name.to_s.gsub(/\.(?:#{handlers})$/, '')
+
+ parts = name.split('/')
+ return parts.pop, [prefix, *parts].compact.join("/")
end
def cached(key)
@@ -60,80 +79,49 @@ module ActionView
end
end
- class FileSystemResolver < Resolver
-
- def self.cached_glob
- @@cached_glob ||= {}
- end
-
- def initialize(path, options = {})
- raise ArgumentError, "path already is a Resolver class" if path.is_a?(Resolver)
- super(options)
- @path = Pathname.new(path).expand_path
- end
+ class PathResolver < Resolver
- # TODO: This is the currently needed API. Make this suck less
- # ==== <suck>
- attr_reader :path
+ EXTENSION_ORDER = [:locale, :formats, :handlers]
def to_s
- path.to_s
+ @path.to_s
end
+ alias to_path to_s
- def to_str
- path.to_s
+ def find_templates(name, details, prefix, partial)
+ path = build_path(name, details, prefix, partial)
+ query(path, EXTENSION_ORDER.map { |ext| details[ext] })
end
- def ==(path)
- to_str == path.to_str
- end
+ private
- def eql?(path)
- to_str == path.to_str
+ def build_path(name, details, prefix, partial)
+ path = ""
+ path << "#{prefix}/" unless prefix.empty?
+ path << (partial ? "_#{name}" : name)
+ path
end
- # ==== </suck>
-
- def find_templates(name, details, prefix, partial, root = "#{@path}/")
- if glob = details_to_glob(name, details, prefix, partial, root)
- cached(glob) do
- Dir[glob].map do |path|
- next if File.directory?(path)
- source = File.read(path)
- identifier = Pathname.new(path).expand_path.to_s
- Template.new(source, identifier, *path_to_details(path))
- end.compact
- end
+ def query(path, exts)
+ query = "#{@path}/#{path}"
+ exts.each do |ext|
+ query << '{' << ext.map {|e| e && ".#{e}" }.join(',') << '}'
end
- end
-
- private
- # :api: plugin
- def details_to_glob(name, details, prefix, partial, root)
- self.class.cached_glob[[name, prefix, partial, details, root]] ||= begin
- path = ""
- path << "#{prefix}/" unless prefix.empty?
- path << (partial ? "_#{name}" : name)
-
- extensions = ""
- [:locales, :formats].each do |k|
- extensions << if exts = details[k]
- '{' + exts.map {|e| ".#{e},"}.join + '}'
- else
- k == :formats ? formats_glob : ''
- end
- end
-
- "#{root}#{path}#{extensions}#{handler_glob}"
- end
+ Dir[query].map do |path|
+ next if File.directory?(path)
+ source = File.read(path)
+ identifier = Pathname.new(path).expand_path.to_s
+
+ Template.new(source, identifier, *path_to_details(path))
+ end.compact
end
- # TODO: fix me
- # :api: plugin
+ # # TODO: fix me
+ # # :api: plugin
def path_to_details(path)
# [:erb, :format => :html, :locale => :en, :partial => true/false]
- if m = path.match(%r'/(_)?[\w-]+(\.[\w-]+)*\.(\w+)$')
+ if m = path.match(%r'(?:^|/)(_)?[\w-]+(\.[\w-]+)*\.(\w+)$')
partial = m[1] == '_'
details = (m[2]||"").split('.').reject { |e| e.empty? }
handler = Template.handler_class_for_extension(m[3])
@@ -146,13 +134,32 @@ module ActionView
end
end
- class FileSystemResolverWithFallback < FileSystemResolver
+ class FileSystemResolver < PathResolver
+ def initialize(path, options = {})
+ raise ArgumentError, "path already is a Resolver class" if path.is_a?(Resolver)
+ super(options)
+ @path = Pathname.new(path).expand_path
+ end
+ end
- def find_templates(name, details, prefix, partial)
- templates = super
- return super(name, details, prefix, partial, '') if templates.empty?
- templates
+ # OMG HAX
+ # TODO: remove hax
+ class FileSystemResolverWithFallback < Resolver
+ def initialize(path, options = {})
+ super(options)
+ @paths = [FileSystemResolver.new(path, options), FileSystemResolver.new("", options), FileSystemResolver.new("/", options)]
end
+ def find_templates(*args)
+ @paths.each do |p|
+ template = p.find_templates(*args)
+ return template unless template.empty?
+ end
+ []
+ end
+
+ def to_s
+ @paths.first.to_s
+ end
end
end \ No newline at end of file
diff --git a/actionpack/test/abstract_controller/abstract_controller_test.rb b/actionpack/test/abstract_controller/abstract_controller_test.rb
index 7991436703..3b4046a424 100644
--- a/actionpack/test/abstract_controller/abstract_controller_test.rb
+++ b/actionpack/test/abstract_controller/abstract_controller_test.rb
@@ -148,10 +148,10 @@ module AbstractController
private
def self.layout(formats)
begin
- view_paths.find(name.underscore, {:formats => formats}, "layouts")
+ find_template(name.underscore, {:formats => formats}, :_prefix => "layouts")
rescue ActionView::MissingTemplate
begin
- view_paths.find("application", {:formats => formats}, "layouts")
+ find_template("application", {:formats => formats}, :_prefix => "layouts")
rescue ActionView::MissingTemplate
end
end
diff --git a/actionpack/test/activerecord/active_record_store_test.rb b/actionpack/test/activerecord/active_record_store_test.rb
index a46ce7a0aa..19d9c955a5 100644
--- a/actionpack/test/activerecord/active_record_store_test.rb
+++ b/actionpack/test/activerecord/active_record_store_test.rb
@@ -176,6 +176,7 @@ class ActiveRecordStoreTest < ActionController::IntegrationTest
c.connect "/:action"
end
end
+ reset_app!
yield
end
end
diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb
index 453812c128..901cb940ea 100644
--- a/actionpack/test/controller/action_pack_assertions_test.rb
+++ b/actionpack/test/controller/action_pack_assertions_test.rb
@@ -1,5 +1,6 @@
require 'abstract_unit'
require 'action_controller/vendor/html-scanner'
+require 'controller/fake_controllers'
# a controller class to facilitate the tests
class ActionPackAssertionsController < ActionController::Base
diff --git a/actionpack/test/controller/addresses_render_test.rb b/actionpack/test/controller/addresses_render_test.rb
index 2d2a2745b0..c1cd22113d 100644
--- a/actionpack/test/controller/addresses_render_test.rb
+++ b/actionpack/test/controller/addresses_render_test.rb
@@ -1,5 +1,6 @@
require 'abstract_unit'
require 'logger'
+require 'controller/fake_controllers'
class Address
def Address.count(conditions = nil, join = nil)
@@ -15,13 +16,8 @@ class Address
end
end
-class AddressesTestController < ActionController::Base
- def self.controller_name; "addresses"; end
- def self.controller_path; "addresses"; end
-end
-
class AddressesTest < ActionController::TestCase
- tests AddressesTestController
+ tests AddressesController
def setup
super
diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb
index 197ba0c69c..93f5bfa272 100644
--- a/actionpack/test/controller/integration_test.rb
+++ b/actionpack/test/controller/integration_test.rb
@@ -371,6 +371,7 @@ class IntegrationProcessTest < ActionController::IntegrationTest
c.connect "/:action"
end
end
+ reset!
yield
end
end
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index d20684296f..1aabf71cad 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -232,14 +232,18 @@ class LegacyRouteSetTests < Test::Unit::TestCase
end
def test_basic_named_route
- rs.add_named_route :home, '', :controller => 'content', :action => 'list'
+ rs.draw do |map|
+ map.home '', :controller => 'content', :action => 'list'
+ end
x = setup_for_named_route
assert_equal("http://test.host/",
x.send(:home_url))
end
def test_basic_named_route_with_relative_url_root
- rs.add_named_route :home, '', :controller => 'content', :action => 'list'
+ rs.draw do |map|
+ map.home '', :controller => 'content', :action => 'list'
+ end
x = setup_for_named_route
ActionController::Base.relative_url_root = "/foo"
assert_equal("http://test.host/foo/",
@@ -249,14 +253,18 @@ class LegacyRouteSetTests < Test::Unit::TestCase
end
def test_named_route_with_option
- rs.add_named_route :page, 'page/:title', :controller => 'content', :action => 'show_page'
+ rs.draw do |map|
+ map.page 'page/:title', :controller => 'content', :action => 'show_page'
+ end
x = setup_for_named_route
assert_equal("http://test.host/page/new%20stuff",
x.send(:page_url, :title => 'new stuff'))
end
def test_named_route_with_default
- rs.add_named_route :page, 'page/:title', :controller => 'content', :action => 'show_page', :title => 'AboutPage'
+ rs.draw do |map|
+ map.page 'page/:title', :controller => 'content', :action => 'show_page', :title => 'AboutPage'
+ end
x = setup_for_named_route
assert_equal("http://test.host/page/AboutRails",
x.send(:page_url, :title => "AboutRails"))
@@ -264,36 +272,46 @@ class LegacyRouteSetTests < Test::Unit::TestCase
end
def test_named_route_with_name_prefix
- rs.add_named_route :page, 'page', :controller => 'content', :action => 'show_page', :name_prefix => 'my_'
+ rs.draw do |map|
+ map.page 'page', :controller => 'content', :action => 'show_page', :name_prefix => 'my_'
+ end
x = setup_for_named_route
assert_equal("http://test.host/page",
x.send(:my_page_url))
end
def test_named_route_with_path_prefix
- rs.add_named_route :page, 'page', :controller => 'content', :action => 'show_page', :path_prefix => 'my'
+ rs.draw do |map|
+ map.page 'page', :controller => 'content', :action => 'show_page', :path_prefix => 'my'
+ end
x = setup_for_named_route
assert_equal("http://test.host/my/page",
x.send(:page_url))
end
def test_named_route_with_blank_path_prefix
- rs.add_named_route :page, 'page', :controller => 'content', :action => 'show_page', :path_prefix => ''
+ rs.draw do |map|
+ map.page 'page', :controller => 'content', :action => 'show_page', :path_prefix => ''
+ end
x = setup_for_named_route
assert_equal("http://test.host/page",
x.send(:page_url))
end
def test_named_route_with_nested_controller
- rs.add_named_route :users, 'admin/user', :controller => 'admin/user', :action => 'index'
+ rs.draw do |map|
+ map.users 'admin/user', :controller => 'admin/user', :action => 'index'
+ end
x = setup_for_named_route
assert_equal("http://test.host/admin/user",
x.send(:users_url))
end
def test_optimised_named_route_call_never_uses_url_for
- rs.add_named_route :users, 'admin/user', :controller => '/admin/user', :action => 'index'
- rs.add_named_route :user, 'admin/user/:id', :controller=>'/admin/user', :action=>'show'
+ rs.draw do |map|
+ map.users 'admin/user', :controller => '/admin/user', :action => 'index'
+ map.user 'admin/user/:id', :controller=>'/admin/user', :action=>'show'
+ end
x = setup_for_named_route
x.expects(:url_for).never
x.send(:users_url)
@@ -303,7 +321,9 @@ class LegacyRouteSetTests < Test::Unit::TestCase
end
def test_optimised_named_route_with_host
- rs.add_named_route :pages, 'pages', :controller => 'content', :action => 'show_page', :host => 'foo.com'
+ rs.draw do |map|
+ map.pages 'pages', :controller => 'content', :action => 'show_page', :host => 'foo.com'
+ end
x = setup_for_named_route
x.expects(:url_for).with(:host => 'foo.com', :only_path => false, :controller => 'content', :action => 'show_page', :use_route => :pages).once
x.send(:pages_url)
@@ -378,7 +398,9 @@ class LegacyRouteSetTests < Test::Unit::TestCase
end
def test_paths_slashes_unescaped_with_ordered_parameters
- rs.add_named_route :path, '/file/*path', :controller => 'content'
+ rs.draw do |map|
+ map.path '/file/*path', :controller => 'content'
+ end
# No / to %2F in URI, only for query params.
x = setup_for_named_route
@@ -1781,23 +1803,23 @@ class RouteSetTest < ActiveSupport::TestCase
end
def test_default_route_recognition
- expected = {:controller => 'accounts', :action => 'show', :id => '10'}
- assert_equal expected, default_route_set.recognize_path('/accounts/show/10')
- assert_equal expected, default_route_set.recognize_path('/accounts/show/10/')
+ expected = {:controller => 'pages', :action => 'show', :id => '10'}
+ assert_equal expected, default_route_set.recognize_path('/pages/show/10')
+ assert_equal expected, default_route_set.recognize_path('/pages/show/10/')
expected[:id] = 'jamis'
- assert_equal expected, default_route_set.recognize_path('/accounts/show/jamis/')
+ assert_equal expected, default_route_set.recognize_path('/pages/show/jamis/')
expected.delete :id
- assert_equal expected, default_route_set.recognize_path('/accounts/show')
- assert_equal expected, default_route_set.recognize_path('/accounts/show/')
+ assert_equal expected, default_route_set.recognize_path('/pages/show')
+ assert_equal expected, default_route_set.recognize_path('/pages/show/')
expected[:action] = 'index'
- assert_equal expected, default_route_set.recognize_path('/accounts/')
- assert_equal expected, default_route_set.recognize_path('/accounts')
+ assert_equal expected, default_route_set.recognize_path('/pages/')
+ assert_equal expected, default_route_set.recognize_path('/pages')
assert_raise(ActionController::RoutingError) { default_route_set.recognize_path('/') }
- assert_raise(ActionController::RoutingError) { default_route_set.recognize_path('/accounts/how/goood/it/is/to/be/free') }
+ assert_raise(ActionController::RoutingError) { default_route_set.recognize_path('/pages/how/goood/it/is/to/be/free') }
end
def test_default_route_should_omit_default_action
@@ -1813,15 +1835,15 @@ class RouteSetTest < ActiveSupport::TestCase
end
def test_default_route_should_uri_escape_pluses
- expected = { :controller => 'accounts', :action => 'show', :id => 'hello world' }
- assert_equal expected, default_route_set.recognize_path('/accounts/show/hello world')
- assert_equal expected, default_route_set.recognize_path('/accounts/show/hello%20world')
- assert_equal '/accounts/show/hello%20world', default_route_set.generate(expected, expected)
+ expected = { :controller => 'pages', :action => 'show', :id => 'hello world' }
+ assert_equal expected, default_route_set.recognize_path('/pages/show/hello world')
+ assert_equal expected, default_route_set.recognize_path('/pages/show/hello%20world')
+ assert_equal '/pages/show/hello%20world', default_route_set.generate(expected, expected)
expected[:id] = 'hello+world'
- assert_equal expected, default_route_set.recognize_path('/accounts/show/hello+world')
- assert_equal expected, default_route_set.recognize_path('/accounts/show/hello%2Bworld')
- assert_equal '/accounts/show/hello+world', default_route_set.generate(expected, expected)
+ assert_equal expected, default_route_set.recognize_path('/pages/show/hello+world')
+ assert_equal expected, default_route_set.recognize_path('/pages/show/hello%2Bworld')
+ assert_equal '/pages/show/hello+world', default_route_set.generate(expected, expected)
end
def test_parameter_shell
diff --git a/actionpack/test/controller/url_rewriter_test.rb b/actionpack/test/controller/url_rewriter_test.rb
index 9b8d07222b..4c4bf9ade4 100644
--- a/actionpack/test/controller/url_rewriter_test.rb
+++ b/actionpack/test/controller/url_rewriter_test.rb
@@ -1,4 +1,5 @@
require 'abstract_unit'
+require 'controller/fake_controllers'
ActionController::UrlRewriter
diff --git a/actionpack/test/controller/view_paths_test.rb b/actionpack/test/controller/view_paths_test.rb
index c732d1c910..05d2c8407c 100644
--- a/actionpack/test/controller/view_paths_test.rb
+++ b/actionpack/test/controller/view_paths_test.rb
@@ -43,7 +43,7 @@ class ViewLoadPathsTest < ActionController::TestCase
end
def expand(array)
- array.map {|x| File.expand_path(x)}
+ array.map {|x| File.expand_path(x.to_s)}
end
def assert_paths(*paths)
diff --git a/actionpack/test/dispatch/session/cookie_store_test.rb b/actionpack/test/dispatch/session/cookie_store_test.rb
index 0723a76d2b..d695be0be4 100644
--- a/actionpack/test/dispatch/session/cookie_store_test.rb
+++ b/actionpack/test/dispatch/session/cookie_store_test.rb
@@ -30,7 +30,7 @@ class CookieStoreTest < ActionController::IntegrationTest
end
def get_session_id
- render :text => "foo: #{session[:foo].inspect}; id: #{request.session_options[:id]}"
+ render :text => "id: #{request.session_options[:id]}"
end
def call_reset_session
@@ -119,7 +119,7 @@ class CookieStoreTest < ActionController::IntegrationTest
get '/get_session_id'
assert_response :success
- assert_equal "foo: \"bar\"; id: #{session_id}", response.body
+ assert_equal "id: #{session_id}", response.body
end
end
diff --git a/actionpack/test/lib/controller/fake_controllers.rb b/actionpack/test/lib/controller/fake_controllers.rb
index 6e02e2d21b..22729188a2 100644
--- a/actionpack/test/lib/controller/fake_controllers.rb
+++ b/actionpack/test/lib/controller/fake_controllers.rb
@@ -9,7 +9,14 @@ module Admin
class UserController < ActionController::Base; end
class NewsFeedController < ActionController::Base; end
end
-
+class ElsewhereController < ActionController::Base; end
+class AddressesController < ActionController::Base; end
+class SessionsController < ActionController::Base; end
+class FooController < ActionController::Base; end
+class CController < ActionController::Base; end
+class HiController < ActionController::Base; end
+class BraveController < ActionController::Base; end
+class ImageController < ActionController::Base; end
# For speed test
class SpeedController < ActionController::Base; end
@@ -24,7 +31,6 @@ class UsersController < SpeedController; end
class SettingsController < SpeedController; end
class ChannelsController < SpeedController; end
class ChannelVideosController < SpeedController; end
-class SessionsController < SpeedController; end
class LostPasswordsController < SpeedController; end
class PagesController < SpeedController; end
diff --git a/actionpack/test/lib/fixture_template.rb b/actionpack/test/lib/fixture_template.rb
index 8da92180d1..6b9e7c5270 100644
--- a/actionpack/test/lib/fixture_template.rb
+++ b/actionpack/test/lib/fixture_template.rb
@@ -1,67 +1,24 @@
module ActionView #:nodoc:
- class FixtureResolver < Resolver
+ class FixtureResolver < PathResolver
def initialize(hash = {}, options = {})
super(options)
@hash = hash
end
- def find_templates(name, details, prefix, partial)
- if regexp = details_to_regexp(name, details, prefix, partial)
- cached(regexp) do
- templates = []
- @hash.select { |k,v| k =~ regexp }.each do |path, source|
- templates << Template.new(source, path, *path_to_details(path))
- end
- templates.sort_by {|t| -t.details.values.compact.size }
- end
- end
- end
-
private
- def formats_regexp
- @formats_regexp ||= begin
- formats = Mime::SET.symbols
- '(?:' + formats.map { |l| "\\.#{Regexp.escape(l.to_s)}" }.join('|') + ')?'
+ def query(path, exts)
+ query = Regexp.escape(path)
+ exts.each do |ext|
+ query << '(?:' << ext.map {|e| e && Regexp.escape(".#{e}") }.join('|') << ')'
end
- end
-
- def handler_regexp
- e = TemplateHandlers.extensions.map{|h| "\\.#{Regexp.escape(h.to_s)}"}.join("|")
- "(?:#{e})"
- end
- def details_to_regexp(name, details, prefix, partial)
- path = ""
- path << "#{prefix}/" unless prefix.empty?
- path << (partial ? "_#{name}" : name)
-
- extensions = ""
- [:locales, :formats].each do |k|
- extensions << if exts = details[k]
- '(?:' + exts.map {|e| "\\.#{Regexp.escape(e.to_s)}"}.join('|') + ')?'
- else
- k == :formats ? formats_regexp : ''
- end
+ templates = []
+ @hash.select { |k,v| k =~ /^#{query}$/ }.each do |path, source|
+ templates << Template.new(source, path, *path_to_details(path))
end
-
- %r'^#{Regexp.escape(path)}#{extensions}#{handler_regexp}$'
+ templates.sort_by {|t| -t.details.values.compact.size }
end
- # TODO: fix me
- # :api: plugin
- def path_to_details(path)
- # [:erb, :format => :html, :locale => :en, :partial => true/false]
- if m = path.match(%r'(_)?[\w-]+((?:\.[\w-]+)*)\.(\w+)$')
- partial = m[1] == '_'
- details = (m[2]||"").split('.').reject { |e| e.empty? }
- handler = Template.handler_class_for_extension(m[3])
-
- format = Mime[details.last] && details.pop.to_sym
- locale = details.last && details.pop.to_sym
-
- return handler, :format => format, :locale => locale, :partial => partial
- end
- end
end
end \ No newline at end of file
diff --git a/actionpack/test/new_base/content_negotiation_test.rb b/actionpack/test/new_base/content_negotiation_test.rb
new file mode 100644
index 0000000000..d2f732738d
--- /dev/null
+++ b/actionpack/test/new_base/content_negotiation_test.rb
@@ -0,0 +1,18 @@
+require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+
+module ContentNegotiation
+
+ # This has no layout and it works
+ class BasicController < ActionController::Base
+ self.view_paths = [ActionView::FixtureResolver.new(
+ "content_negotiation/basic/hello.html.erb" => "Hello world <%= request.formats %>!"
+ )]
+ end
+
+ class TestContentNegotiation < SimpleRouteCase
+ test "A */* Accept header will return HTML" do
+ get "/content_negotiation/basic/hello", {}, "HTTP_ACCEPT" => "*/*"
+ assert_body "Hello world */*!"
+ end
+ end
+end \ No newline at end of file
diff --git a/actionpack/test/new_base/render_file_test.rb b/actionpack/test/new_base/render_file_test.rb
index 769949be0c..8d7f49dbc2 100644
--- a/actionpack/test/new_base/render_file_test.rb
+++ b/actionpack/test/new_base/render_file_test.rb
@@ -3,7 +3,7 @@ require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
module RenderFile
class BasicController < ActionController::Base
- self.view_paths = "."
+ self.view_paths = File.dirname(__FILE__)
def index
render :file => File.join(File.dirname(__FILE__), *%w[.. fixtures test hello_world])
diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb
index 28f9d48671..83fc6a282c 100644
--- a/actionpack/test/template/asset_tag_helper_test.rb
+++ b/actionpack/test/template/asset_tag_helper_test.rb
@@ -213,11 +213,11 @@ class AssetTagHelperTest < ActionView::TestCase
end
def test_javascript_include_tag_with_missing_source
- assert_raise(Errno::ENOENT) {
+ assert_nothing_raised {
javascript_include_tag('missing_security_guard')
}
- assert_raise(Errno::ENOENT) {
+ assert_nothing_raised {
javascript_include_tag(:defaults, 'missing_security_guard')
}
@@ -276,7 +276,7 @@ class AssetTagHelperTest < ActionView::TestCase
end
def test_stylesheet_link_tag_with_missing_source
- assert_raise(Errno::ENOENT) {
+ assert_nothing_raised {
stylesheet_link_tag('missing_security_guard')
}
@@ -639,6 +639,40 @@ class AssetTagHelperTest < ActionView::TestCase
assert !File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js'))
end
+ def test_caching_javascript_include_tag_when_caching_on_and_missing_javascript_file
+ ENV["RAILS_ASSET_ID"] = ""
+ ActionController::Base.perform_caching = true
+
+ assert_raise(Errno::ENOENT) {
+ javascript_include_tag('bank', 'robber', 'missing_security_guard', :cache => true)
+ }
+
+ assert !File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js'))
+
+ assert_raise(Errno::ENOENT) {
+ javascript_include_tag('bank', 'robber', 'missing_security_guard', :cache => "money")
+ }
+
+ assert !File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js'))
+ end
+
+ def test_caching_javascript_include_tag_when_caching_off_and_missing_javascript_file
+ ENV["RAILS_ASSET_ID"] = ""
+ ActionController::Base.perform_caching = false
+
+ assert_raise(Errno::ENOENT) {
+ javascript_include_tag('bank', 'robber', 'missing_security_guard', :cache => true)
+ }
+
+ assert !File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js'))
+
+ assert_raise(Errno::ENOENT) {
+ javascript_include_tag('bank', 'robber', 'missing_security_guard', :cache => "money")
+ }
+
+ assert !File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js'))
+ end
+
def test_caching_stylesheet_link_tag_when_caching_on
ENV["RAILS_ASSET_ID"] = ""
ActionController::Base.asset_host = 'http://a0.example.com'
@@ -709,7 +743,6 @@ class AssetTagHelperTest < ActionView::TestCase
def test_caching_stylesheet_link_tag_when_caching_on_and_missing_css_file
ENV["RAILS_ASSET_ID"] = ""
- ActionController::Base.asset_host = 'http://a0.example.com'
ActionController::Base.perform_caching = true
assert_raise(Errno::ENOENT) {
@@ -729,6 +762,27 @@ class AssetTagHelperTest < ActionView::TestCase
FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
end
+ def test_caching_stylesheet_link_tag_when_caching_off_and_missing_css_file
+ ENV["RAILS_ASSET_ID"] = ""
+ ActionController::Base.perform_caching = false
+
+ assert_raise(Errno::ENOENT) {
+ stylesheet_link_tag('bank', 'robber', 'missing_security_guard', :cache => true)
+ }
+
+ assert ! File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
+
+ assert_raise(Errno::ENOENT) {
+ stylesheet_link_tag('bank', 'robber', 'missing_security_guard', :cache => "money")
+ }
+
+ assert ! File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
+
+ ensure
+ FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
+ FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
+ end
+
def test_caching_stylesheet_link_tag_when_caching_on_with_proc_asset_host
ENV["RAILS_ASSET_ID"] = ""
ActionController::Base.asset_host = Proc.new { |source| "http://a#{source.length}.example.com" }
diff --git a/actionpack/test/template/compiled_templates_test.rb b/actionpack/test/template/compiled_templates_test.rb
index 7734e6da73..632988bb2e 100644
--- a/actionpack/test/template/compiled_templates_test.rb
+++ b/actionpack/test/template/compiled_templates_test.rb
@@ -14,6 +14,9 @@ class CompiledTemplatesTest < Test::Unit::TestCase
assert_equal "two", render(:file => "test/render_file_with_locals_and_default.erb", :locals => { :secret => "two" })
end
+ # This is broken in 1.8.6 (not supported in Rails 3.0) because the cache uses a Hash
+ # key. Since Ruby 1.8.6 implements Hash#hash using the hash's object_id, it will never
+ # successfully get a cache hit here.
def test_template_changes_are_not_reflected_with_cached_templates
assert_equal "Hello world!", render(:file => "test/hello_world.erb")
modify_template "test/hello_world.erb", "Goodbye world!" do
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb
index 0e24fbd24d..44f1925653 100644
--- a/actionpack/test/template/url_helper_test.rb
+++ b/actionpack/test/template/url_helper_test.rb
@@ -367,25 +367,25 @@ class UrlHelperTest < ActionView::TestCase
end
end
-class UrlHelperWithControllerTest < ActionView::TestCase
- class UrlHelperController < ActionController::Base
- def self.controller_path; 'url_helper_with_controller' end
-
- def show_url_for
- render :inline => "<%= url_for :controller => 'url_helper_with_controller', :action => 'show_url_for' %>"
- end
+class UrlHelperController < ActionController::Base
+ def self.controller_path; 'url_helper_with_controller' end
- def show_named_route
- render :inline => "<%= show_named_route_#{params[:kind]} %>"
- end
+ def show_url_for
+ render :inline => "<%= url_for :controller => 'url_helper_with_controller', :action => 'show_url_for' %>"
+ end
- def nil_url_for
- render :inline => '<%= url_for(nil) %>'
- end
+ def show_named_route
+ render :inline => "<%= show_named_route_#{params[:kind]} %>"
+ end
- def rescue_action(e) raise e end
+ def nil_url_for
+ render :inline => '<%= url_for(nil) %>'
end
+ def rescue_action(e) raise e end
+end
+
+class UrlHelperWithControllerTest < ActionView::TestCase
tests ActionView::Helpers::UrlHelper
def setup
@@ -416,7 +416,7 @@ class UrlHelperWithControllerTest < ActionView::TestCase
def test_url_for_nil_returns_current_path
get :nil_url_for
- assert_equal '/url_helper_with_controller/nil_url_for', @response.body
+ assert_equal '/url_helper/nil_url_for', @response.body
end
def test_named_route_should_show_host_and_path_using_controller_default_url_options
@@ -436,35 +436,33 @@ class UrlHelperWithControllerTest < ActionView::TestCase
def with_url_helper_routing
with_routing do |set|
set.draw do |map|
- map.show_named_route 'url_helper_with_controller/show_named_route', :controller => 'url_helper_with_controller', :action => 'show_named_route'
+ map.show_named_route 'url_helper_with_controller/show_named_route', :controller => 'url_helper', :action => 'show_named_route'
end
yield
end
end
end
-class LinkToUnlessCurrentWithControllerTest < ActionView::TestCase
- class TasksController < ActionController::Base
- def self.controller_path; 'tasks' end
-
- def index
- render_default
- end
+class TasksController < ActionController::Base
+ def index
+ render_default
+ end
- def show
- render_default
- end
+ def show
+ render_default
+ end
- def rescue_action(e) raise e end
+ def rescue_action(e) raise e end
- protected
- def render_default
- render :inline =>
- "<%= link_to_unless_current(\"tasks\", tasks_path) %>\n" +
- "<%= link_to_unless_current(\"tasks\", tasks_url) %>"
- end
- end
+ protected
+ def render_default
+ render :inline =>
+ "<%= link_to_unless_current(\"tasks\", tasks_path) %>\n" +
+ "<%= link_to_unless_current(\"tasks\", tasks_url) %>"
+ end
+end
+class LinkToUnlessCurrentWithControllerTest < ActionView::TestCase
tests ActionView::Helpers::UrlHelper
def setup
@@ -537,41 +535,37 @@ class Session
end
end
-class PolymorphicControllerTest < ActionView::TestCase
- class WorkshopsController < ActionController::Base
- def self.controller_path; 'workshops' end
-
- def index
- @workshop = Workshop.new(1, true)
- render :inline => "<%= url_for(@workshop) %>\n<%= link_to('Workshop', @workshop) %>"
- end
-
- def show
- @workshop = Workshop.new(params[:id], false)
- render :inline => "<%= url_for(@workshop) %>\n<%= link_to('Workshop', @workshop) %>"
- end
-
- def rescue_action(e) raise e end
+class WorkshopsController < ActionController::Base
+ def index
+ @workshop = Workshop.new(1, true)
+ render :inline => "<%= url_for(@workshop) %>\n<%= link_to('Workshop', @workshop) %>"
end
- class SessionsController < ActionController::Base
- def self.controller_path; 'sessions' end
+ def show
+ @workshop = Workshop.new(params[:id], false)
+ render :inline => "<%= url_for(@workshop) %>\n<%= link_to('Workshop', @workshop) %>"
+ end
- def index
- @workshop = Workshop.new(params[:workshop_id], false)
- @session = Session.new(1, true)
- render :inline => "<%= url_for([@workshop, @session]) %>\n<%= link_to('Session', [@workshop, @session]) %>"
- end
+ def rescue_action(e) raise e end
+end
- def show
- @workshop = Workshop.new(params[:workshop_id], false)
- @session = Session.new(params[:id], false)
- render :inline => "<%= url_for([@workshop, @session]) %>\n<%= link_to('Session', [@workshop, @session]) %>"
- end
+class SessionsController < ActionController::Base
+ def index
+ @workshop = Workshop.new(params[:workshop_id], false)
+ @session = Session.new(1, true)
+ render :inline => "<%= url_for([@workshop, @session]) %>\n<%= link_to('Session', [@workshop, @session]) %>"
+ end
- def rescue_action(e) raise e end
+ def show
+ @workshop = Workshop.new(params[:workshop_id], false)
+ @session = Session.new(params[:id], false)
+ render :inline => "<%= url_for([@workshop, @session]) %>\n<%= link_to('Session', [@workshop, @session]) %>"
end
+ def rescue_action(e) raise e end
+end
+
+class PolymorphicControllerTest < ActionView::TestCase
tests ActionView::Helpers::UrlHelper
def setup