vibes-bj 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +83 -0
- data/LICENSE +1 -0
- data/README +318 -0
- data/Rakefile +21 -0
- data/TODO +53 -0
- data/VERSION +1 -0
- data/bin/bj +692 -0
- data/gemspec.rb +30 -0
- data/init.rb +1 -0
- data/install.rb +214 -0
- data/lib/bj.rb +85 -0
- data/lib/bj/api.rb +164 -0
- data/lib/bj/bj.rb +72 -0
- data/lib/bj/errors.rb +4 -0
- data/lib/bj/joblist.rb +112 -0
- data/lib/bj/logger.rb +50 -0
- data/lib/bj/runner.rb +369 -0
- data/lib/bj/stdext.rb +86 -0
- data/lib/bj/table.rb +426 -0
- data/lib/bj/util.rb +133 -0
- data/plugin/HISTORY +3 -0
- data/plugin/README +142 -0
- data/plugin/Rakefile +22 -0
- data/plugin/init.rb +33 -0
- data/plugin/install.rb +95 -0
- data/plugin/script/bj +55 -0
- data/plugin/tasks/bj_tasks.rake +4 -0
- data/plugin/test/bj_test.rb +8 -0
- data/plugin/uninstall.rb +1 -0
- data/spec/bj.rb +80 -0
- data/spec/helper.rb +85 -0
- data/spec/rails_root/README +256 -0
- data/spec/rails_root/Rakefile +10 -0
- data/spec/rails_root/app/controllers/application.rb +15 -0
- data/spec/rails_root/app/helpers/application_helper.rb +3 -0
- data/spec/rails_root/config/boot.rb +109 -0
- data/spec/rails_root/config/database.yml +23 -0
- data/spec/rails_root/config/environment.rb +67 -0
- data/spec/rails_root/config/environments/development.rb +17 -0
- data/spec/rails_root/config/environments/production.rb +22 -0
- data/spec/rails_root/config/environments/test.rb +22 -0
- data/spec/rails_root/config/initializers/inflections.rb +10 -0
- data/spec/rails_root/config/initializers/mime_types.rb +5 -0
- data/spec/rails_root/config/initializers/new_rails_defaults.rb +15 -0
- data/spec/rails_root/config/routes.rb +41 -0
- data/spec/rails_root/db/development.sqlite3 +0 -0
- data/spec/rails_root/db/migrate/20080909151517_bj_migration0.rb +8 -0
- data/spec/rails_root/db/schema.rb +62 -0
- data/spec/rails_root/doc/README_FOR_APP +2 -0
- data/spec/rails_root/log/development.log +141 -0
- data/spec/rails_root/log/production.log +0 -0
- data/spec/rails_root/log/server.log +0 -0
- data/spec/rails_root/log/test.log +0 -0
- data/spec/rails_root/public/404.html +30 -0
- data/spec/rails_root/public/422.html +30 -0
- data/spec/rails_root/public/500.html +30 -0
- data/spec/rails_root/public/dispatch.cgi +10 -0
- data/spec/rails_root/public/dispatch.fcgi +24 -0
- data/spec/rails_root/public/dispatch.rb +10 -0
- data/spec/rails_root/public/favicon.ico +0 -0
- data/spec/rails_root/public/images/rails.png +0 -0
- data/spec/rails_root/public/index.html +274 -0
- data/spec/rails_root/public/javascripts/application.js +2 -0
- data/spec/rails_root/public/javascripts/controls.js +963 -0
- data/spec/rails_root/public/javascripts/dragdrop.js +972 -0
- data/spec/rails_root/public/javascripts/effects.js +1120 -0
- data/spec/rails_root/public/javascripts/prototype.js +4225 -0
- data/spec/rails_root/public/robots.txt +5 -0
- data/spec/rails_root/script/about +3 -0
- data/spec/rails_root/script/bj +679 -0
- data/spec/rails_root/script/console +3 -0
- data/spec/rails_root/script/dbconsole +3 -0
- data/spec/rails_root/script/destroy +3 -0
- data/spec/rails_root/script/generate +3 -0
- data/spec/rails_root/script/performance/benchmarker +3 -0
- data/spec/rails_root/script/performance/profiler +3 -0
- data/spec/rails_root/script/performance/request +3 -0
- data/spec/rails_root/script/plugin +3 -0
- data/spec/rails_root/script/process/inspector +3 -0
- data/spec/rails_root/script/process/reaper +3 -0
- data/spec/rails_root/script/process/spawner +3 -0
- data/spec/rails_root/script/runner +3 -0
- data/spec/rails_root/script/server +3 -0
- data/spec/rails_root/test/test_helper.rb +38 -0
- data/spec/rails_root/vendor/plugins/bj/HISTORY +3 -0
- data/spec/rails_root/vendor/plugins/bj/README +142 -0
- data/spec/rails_root/vendor/plugins/bj/Rakefile +22 -0
- data/spec/rails_root/vendor/plugins/bj/bin/bj +679 -0
- data/spec/rails_root/vendor/plugins/bj/init.rb +33 -0
- data/spec/rails_root/vendor/plugins/bj/install.rb +95 -0
- data/spec/rails_root/vendor/plugins/bj/lib/arrayfields.rb +435 -0
- data/spec/rails_root/vendor/plugins/bj/lib/attributes.rb +118 -0
- data/spec/rails_root/vendor/plugins/bj/lib/bj.rb +87 -0
- data/spec/rails_root/vendor/plugins/bj/lib/bj/api.rb +161 -0
- data/spec/rails_root/vendor/plugins/bj/lib/bj/attributes.rb +120 -0
- data/spec/rails_root/vendor/plugins/bj/lib/bj/bj.rb +72 -0
- data/spec/rails_root/vendor/plugins/bj/lib/bj/errors.rb +4 -0
- data/spec/rails_root/vendor/plugins/bj/lib/bj/joblist.rb +112 -0
- data/spec/rails_root/vendor/plugins/bj/lib/bj/logger.rb +50 -0
- data/spec/rails_root/vendor/plugins/bj/lib/bj/runner.rb +357 -0
- data/spec/rails_root/vendor/plugins/bj/lib/bj/stdext.rb +86 -0
- data/spec/rails_root/vendor/plugins/bj/lib/bj/table.rb +384 -0
- data/spec/rails_root/vendor/plugins/bj/lib/bj/util.rb +111 -0
- data/spec/rails_root/vendor/plugins/bj/lib/fattr.rb +153 -0
- data/spec/rails_root/vendor/plugins/bj/lib/main.rb +60 -0
- data/spec/rails_root/vendor/plugins/bj/lib/main/base.rb +515 -0
- data/spec/rails_root/vendor/plugins/bj/lib/main/cast.rb +100 -0
- data/spec/rails_root/vendor/plugins/bj/lib/main/factories.rb +20 -0
- data/spec/rails_root/vendor/plugins/bj/lib/main/getoptlong.rb +470 -0
- data/spec/rails_root/vendor/plugins/bj/lib/main/logger.rb +51 -0
- data/spec/rails_root/vendor/plugins/bj/lib/main/mode.rb +42 -0
- data/spec/rails_root/vendor/plugins/bj/lib/main/parameter.rb +685 -0
- data/spec/rails_root/vendor/plugins/bj/lib/main/softspoken.rb +12 -0
- data/spec/rails_root/vendor/plugins/bj/lib/main/stdext.rb +38 -0
- data/spec/rails_root/vendor/plugins/bj/lib/main/usage.rb +211 -0
- data/spec/rails_root/vendor/plugins/bj/lib/main/util.rb +91 -0
- data/spec/rails_root/vendor/plugins/bj/lib/orderedautohash.rb +25 -0
- data/spec/rails_root/vendor/plugins/bj/lib/orderedhash.rb +189 -0
- data/spec/rails_root/vendor/plugins/bj/lib/systemu.rb +299 -0
- data/spec/rails_root/vendor/plugins/bj/script/bj +55 -0
- data/spec/rails_root/vendor/plugins/bj/tasks/bj_tasks.rake +4 -0
- data/spec/rails_root/vendor/plugins/bj/test/bj_test.rb +8 -0
- data/spec/rails_root/vendor/plugins/bj/uninstall.rb +1 -0
- data/spec/rails_root/vendor/rails/actionmailer/CHANGELOG +336 -0
- data/spec/rails_root/vendor/rails/actionmailer/MIT-LICENSE +21 -0
- data/spec/rails_root/vendor/rails/actionmailer/README +149 -0
- data/spec/rails_root/vendor/rails/actionmailer/Rakefile +97 -0
- data/spec/rails_root/vendor/rails/actionmailer/install.rb +30 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer.rb +52 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/adv_attr_accessor.rb +30 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/base.rb +646 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/helpers.rb +111 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/mail_helper.rb +19 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/part.rb +110 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/part_container.rb +51 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/quoting.rb +61 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/test_case.rb +64 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/test_helper.rb +67 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/utils.rb +8 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor.rb +14 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/text-format-0.6.3/text/format.rb +1466 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail.rb +5 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb +426 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/attachments.rb +46 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/base64.rb +46 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/compat.rb +41 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/config.rb +67 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/core_extensions.rb +63 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/encode.rb +581 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/header.rb +960 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/index.rb +9 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb +1130 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/loader.rb +3 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mail.rb +578 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mailbox.rb +495 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/main.rb +6 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mbox.rb +3 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/net.rb +248 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/obsolete.rb +132 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/parser.rb +1476 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/port.rb +379 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/quoting.rb +118 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/require_arch.rb +58 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner.rb +49 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner_r.rb +261 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/stringio.rb +280 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/utils.rb +337 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/version.rb +39 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/action_mailer/version.rb +9 -0
- data/spec/rails_root/vendor/rails/actionmailer/lib/actionmailer.rb +1 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/abstract_unit.rb +49 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/delivery_method_test.rb +51 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/first_mailer/share.erb +1 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb +1 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.erb +1 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb +1 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb +5 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/helpers/example_helper.rb +5 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb +1 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/raw_email +14 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/raw_email10 +20 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/raw_email12 +32 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/raw_email13 +29 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/raw_email2 +114 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/raw_email3 +70 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/raw_email4 +59 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/raw_email5 +19 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/raw_email6 +20 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/raw_email7 +66 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/raw_email8 +47 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/raw_email9 +28 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/raw_email_quoted_with_0d0a +14 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/raw_email_with_invalid_characters_in_content_type +104 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/raw_email_with_nested_attachment +100 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/raw_email_with_partially_quoted_subject +14 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/second_mailer/share.erb +1 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/templates/signed_up.erb +3 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/test_mailer/_subtemplate.text.plain.erb +1 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.html.haml +6 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.plain.haml +6 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb +1 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb +10 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb +2 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb +1 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/test_mailer/included_subtemplate.text.plain.erb +1 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.builder +2 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.rxml +2 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.erb +3 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb +5 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/mail_helper_test.rb +95 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/mail_render_test.rb +122 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/mail_service_test.rb +979 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/quoting_test.rb +98 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/test_helper_test.rb +129 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/tmail_test.rb +22 -0
- data/spec/rails_root/vendor/rails/actionmailer/test/url_test.rb +76 -0
- data/spec/rails_root/vendor/rails/actionpack/CHANGELOG +4798 -0
- data/spec/rails_root/vendor/rails/actionpack/MIT-LICENSE +21 -0
- data/spec/rails_root/vendor/rails/actionpack/README +469 -0
- data/spec/rails_root/vendor/rails/actionpack/RUNNING_UNIT_TESTS +24 -0
- data/spec/rails_root/vendor/rails/actionpack/Rakefile +154 -0
- data/spec/rails_root/vendor/rails/actionpack/install.rb +30 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller.rb +79 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/assertions.rb +69 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/assertions/dom_assertions.rb +39 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/assertions/model_assertions.rb +20 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb +172 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/assertions/routing_assertions.rb +146 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb +643 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/assertions/tag_assertions.rb +130 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/base.rb +1270 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/benchmarking.rb +94 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/caching.rb +72 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/caching/actions.rb +144 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/caching/fragments.rb +138 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/caching/pages.rb +154 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb +18 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/caching/sweeping.rb +97 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/cgi_ext.rb +16 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/cgi_ext/cookie.rb +110 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/cgi_ext/query_extension.rb +22 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/cgi_ext/session.rb +73 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/cgi_ext/stdinput.rb +24 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/cgi_process.rb +223 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/components.rb +166 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/cookies.rb +96 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/dispatcher.rb +162 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/filters.rb +643 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/flash.rb +172 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/headers.rb +31 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/helpers.rb +221 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/http_authentication.rb +124 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/integration.rb +634 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/layout.rb +310 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/mime_responds.rb +174 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/mime_type.rb +182 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/mime_types.rb +20 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb +178 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/record_identifier.rb +97 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/request.rb +761 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/request_forgery_protection.rb +140 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/request_profiler.rb +169 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/rescue.rb +258 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/resources.rb +572 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/response.rb +76 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/routing.rb +383 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/routing/builder.rb +204 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/routing/optimisations.rb +120 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/routing/recognition_optimisation.rb +158 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/routing/route.rb +240 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb +435 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/routing/routing_ext.rb +46 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/routing/segments.rb +283 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb +340 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb +166 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/session/drb_server.rb +32 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/session/drb_store.rb +35 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/session/mem_cache_store.rb +98 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/session_management.rb +158 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/status_codes.rb +88 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/streaming.rb +155 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/templates/rescues/_request_and_response.erb +24 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/templates/rescues/_trace.erb +26 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/templates/rescues/diagnostics.erb +11 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.erb +29 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/templates/rescues/missing_template.erb +2 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/templates/rescues/routing_error.erb +10 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/templates/rescues/template_error.erb +21 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/templates/rescues/unknown_action.erb +2 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/test_case.rb +83 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/test_process.rb +524 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb +142 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/document.rb +68 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb +530 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb +173 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb +828 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/tokenizer.rb +105 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/version.rb +11 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_controller/verification.rb +130 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_pack.rb +24 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_pack/version.rb +9 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view.rb +45 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/base.rb +343 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb +276 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb +611 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb +143 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/benchmark_helper.rb +33 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/cache_helper.rb +40 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb +161 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb +711 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/debug_helper.rb +31 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb +763 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb +457 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb +459 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb +217 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/javascripts/controls.js +963 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/javascripts/dragdrop.js +972 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/javascripts/effects.js +1120 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/javascripts/prototype.js +4225 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/number_helper.rb +186 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb +1300 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/record_identification_helper.rb +20 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/record_tag_helper.rb +59 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/sanitize_helper.rb +229 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/scriptaculous_helper.rb +225 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb +133 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb +507 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb +575 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/inline_template.rb +20 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/partial_template.rb +70 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/partials.rb +158 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/template.rb +127 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/template_error.rb +110 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/template_finder.rb +177 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/template_handler.rb +34 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/template_handlers/builder.rb +27 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/template_handlers/compilable.rb +128 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb +56 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/template_handlers/rjs.rb +27 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/action_view/test_case.rb +58 -0
- data/spec/rails_root/vendor/rails/actionpack/lib/actionpack.rb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/abstract_unit.rb +36 -0
- data/spec/rails_root/vendor/rails/actionpack/test/active_record_unit.rb +105 -0
- data/spec/rails_root/vendor/rails/actionpack/test/activerecord/active_record_store_test.rb +141 -0
- data/spec/rails_root/vendor/rails/actionpack/test/activerecord/render_partial_with_record_identification_test.rb +191 -0
- data/spec/rails_root/vendor/rails/actionpack/test/adv_attr_test.rb +20 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +524 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/addresses_render_test.rb +43 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/assert_select_test.rb +689 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/base_test.rb +183 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/benchmark_test.rb +32 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/caching_test.rb +610 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/capture_test.rb +89 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/cgi_test.rb +116 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/components_test.rb +140 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/content_type_test.rb +139 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/admin/user_controller.rb +0 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/user_controller.rb +0 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb +0 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/cookie_test.rb +146 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/custom_handler_test.rb +45 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb +37 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/dispatcher_test.rb +105 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/fake_controllers.rb +33 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/fake_models.rb +11 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/filter_params_test.rb +49 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/filters_test.rb +881 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/flash_test.rb +146 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/header_test.rb +14 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/helper_test.rb +210 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/html-scanner/document_test.rb +123 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/html-scanner/node_test.rb +68 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/html-scanner/sanitizer_test.rb +259 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/html-scanner/tag_node_test.rb +238 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/html-scanner/text_node_test.rb +50 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/html-scanner/tokenizer_test.rb +131 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/http_authentication_test.rb +54 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/integration_test.rb +252 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/integration_upload_test.rb +43 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/layout_test.rb +259 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/mime_responds_test.rb +538 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/mime_type_test.rb +84 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/new_render_test.rb +926 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/polymorphic_routes_test.rb +141 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/record_identifier_test.rb +139 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/redirect_test.rb +289 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/render_test.rb +527 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/request_forgery_protection_test.rb +313 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/request_test.rb +922 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/rescue_test.rb +517 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/resources_test.rb +875 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/routing_test.rb +2415 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/selector_test.rb +628 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/send_file_test.rb +138 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/session/cookie_store_test.rb +258 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/session/mem_cache_store_test.rb +181 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/session_fixation_test.rb +89 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/session_management_test.rb +178 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/test_test.rb +686 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +310 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/verification_test.rb +253 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/view_paths_test.rb +140 -0
- data/spec/rails_root/vendor/rails/actionpack/test/controller/webservice_test.rb +229 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/addresses/list.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/bad_customers/_bad_customer.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/companies.yml +24 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/company.rb +10 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/content_type/render_default_content_types_for_respond_to.rhtml +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/content_type/render_default_for_rhtml.rhtml +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/content_type/render_default_for_rjs.rjs +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/content_type/render_default_for_rxml.rxml +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/customers/_customer.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/db_definitions/sqlite.sql +49 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/developer.rb +9 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/developers.yml +21 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/developers_projects.yml +13 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/fun/games/hello_world.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/functional_caching/_partial.erb +3 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached.html.erb +2 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/functional_caching/html_fragment_cached_with_partial.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/functional_caching/js_fragment_cached_with_partial.js.rjs +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/good_customers/_good_customer.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/helpers/abc_helper.rb +5 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/helpers/fun/games_helper.rb +3 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/helpers/fun/pdf_helper.rb +3 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/layout_tests/alt/hello.rhtml +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/controller_name_space/nested.rhtml +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/item.rhtml +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/layout_test.rhtml +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/multiple_extensions.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/third_party_template_library.mab +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/layout_tests/views/hello.rhtml +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/layouts/block_with_layout.erb +3 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/layouts/builder.builder +3 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/layouts/partial_with_layout.erb +3 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/layouts/standard.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/layouts/talk_from_action.erb +2 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/layouts/yield.erb +2 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/mascot.rb +3 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/mascots.yml +4 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/mascots/_mascot.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/multipart/binary_file +0 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/multipart/boundary_problem_file +10 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/multipart/bracketed_param +5 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/multipart/large_text_file +10 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/multipart/mixed_files +0 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/multipart/mona_lisa.jpg +0 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/multipart/single_parameter +5 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/multipart/text_file +10 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/override/test/hello_world.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/override2/layouts/test/sub.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/post_test/layouts/post.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/post_test/layouts/super_post.iphone.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/post_test/post/index.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/post_test/post/index.iphone.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.iphone.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/project.rb +3 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/projects.yml +7 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/public/404.html +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/public/500.html +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/public/images/rails.png +0 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/public/javascripts/application.js +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/public/javascripts/bank.js +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/public/javascripts/controls.js +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/public/javascripts/dragdrop.js +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/public/javascripts/effects.js +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/public/javascripts/prototype.js +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/public/javascripts/robber.js +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/public/javascripts/version.1.0.js +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/public/stylesheets/bank.css +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/public/stylesheets/robber.css +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/public/stylesheets/version.1.0.css +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/replies.yml +15 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/reply.rb +7 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/respond_to/all_types_with_layout.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/respond_to/all_types_with_layout.js.rjs +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/respond_to/custom_constant_handling_without_block.mobile.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.iphone.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/respond_to/layouts/missing.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.iphone.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.js.rjs +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.xml.builder +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.js.rjs +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/scope/test/modgreet.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/shared.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/symlink_parent/symlinked_layout.erb +5 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/_customer.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/_customer_counter.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/_customer_greeting.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/_form.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/_hash_greeting.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/_hash_object.erb +2 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/_hello.builder +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/_labelling_form.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/_layout_for_partial.html.erb +3 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/_partial.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/_partial.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/_partial.js.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/_partial_for_use_in_layout.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/_partial_only.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/_person.erb +2 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/_raise.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/action_talk_to_layout.erb +2 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/block_content_for.erb +2 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/calling_partial_with_layout.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/capturing.erb +4 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/content_for.erb +2 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/content_for_concatenated.erb +3 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/content_for_with_parameter.erb +2 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/delete_with_js.rjs +2 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/enum_rjs_test.rjs +6 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/erb_content_for.erb +2 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/formatted_html_erb.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.builder +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.xml.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/greeting.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/greeting.js.rjs +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/hello.builder +4 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/hello_world.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/hello_world_container.builder +3 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/hello_world_from_rxml.builder +4 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/hello_world_with_layout_false.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/hello_xml_world.builder +11 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/list.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/non_erb_block_content_for.builder +4 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/potential_conflicts.erb +4 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/render_file_with_ivar.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/render_file_with_locals.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/render_to_string_test.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/update_element_with_capture.erb +9 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/test/using_layout_around_block.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/topic.rb +3 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/topics.yml +22 -0
- data/spec/rails_root/vendor/rails/actionpack/test/fixtures/topics/_topic.html.erb +1 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/active_record_helper_test.rb +268 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/asset_tag_helper_test.rb +525 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/atom_feed_helper_test.rb +179 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/benchmark_helper_test.rb +60 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/date_helper_test.rb +1740 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/erb_util_test.rb +24 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/form_helper_test.rb +918 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/form_options_helper_test.rb +1336 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/form_tag_helper_test.rb +259 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/javascript_helper_test.rb +109 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/number_helper_test.rb +97 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/prototype_helper_test.rb +614 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/record_tag_helper_test.rb +54 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/sanitize_helper_test.rb +48 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/scriptaculous_helper_test.rb +90 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/tag_helper_test.rb +77 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/template_finder_test.rb +73 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/template_object_test.rb +95 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/test_test.rb +56 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/text_helper_test.rb +366 -0
- data/spec/rails_root/vendor/rails/actionpack/test/template/url_helper_test.rb +534 -0
- data/spec/rails_root/vendor/rails/actionpack/test/testing_sandbox.rb +15 -0
- data/spec/rails_root/vendor/rails/activerecord/CHANGELOG +5719 -0
- data/spec/rails_root/vendor/rails/activerecord/README +351 -0
- data/spec/rails_root/vendor/rails/activerecord/RUNNING_UNIT_TESTS +36 -0
- data/spec/rails_root/vendor/rails/activerecord/Rakefile +247 -0
- data/spec/rails_root/vendor/rails/activerecord/examples/associations.png +0 -0
- data/spec/rails_root/vendor/rails/activerecord/install.rb +30 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record.rb +82 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/aggregations.rb +189 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/association_preload.rb +277 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/associations.rb +1994 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb +365 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb +224 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb +58 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb +49 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +112 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb +109 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb +254 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/associations/has_one_association.rb +98 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/associations/has_one_through_association.rb +28 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/attribute_methods.rb +379 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/base.rb +2726 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/calculations.rb +275 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/callbacks.rb +312 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +309 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +176 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb +93 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +69 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +661 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +421 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +169 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +530 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +948 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +34 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +406 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/dirty.rb +158 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/fixtures.rb +997 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb +147 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/locking/pessimistic.rb +77 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/migration.rb +496 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/named_scope.rb +163 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/observer.rb +195 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/query_cache.rb +21 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/reflection.rb +239 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/schema.rb +51 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/schema_dumper.rb +171 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/serialization.rb +98 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/serializers/json_serializer.rb +80 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/serializers/xml_serializer.rb +338 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/test_case.rb +36 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/timestamp.rb +41 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/transactions.rb +130 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/validations.rb +961 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/vendor/db2.rb +362 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/vendor/mysql.rb +1214 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/active_record/version.rb +9 -0
- data/spec/rails_root/vendor/rails/activerecord/lib/activerecord.rb +1 -0
- data/spec/rails_root/vendor/rails/activerecord/test/assets/example.log +1 -0
- data/spec/rails_root/vendor/rails/activerecord/test/assets/flowers.jpg +0 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/aaa_create_tables_test.rb +24 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/active_schema_test_mysql.rb +95 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb +24 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/adapter_test.rb +127 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/adapter_test_sqlserver.rb +95 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/aggregations_test.rb +128 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/ar_schema_test.rb +33 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/associations/belongs_to_associations_test.rb +412 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/associations/callbacks_test.rb +161 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/associations/cascaded_eager_loading_test.rb +111 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/associations/eager_load_nested_include_test.rb +83 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/associations/eager_singularization_test.rb +145 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/associations/eager_test.rb +612 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/associations/extension_test.rb +47 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb +684 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/associations/has_many_associations_test.rb +932 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/associations/has_many_through_associations_test.rb +190 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/associations/has_one_associations_test.rb +323 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/associations/has_one_through_associations_test.rb +74 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/associations/inner_join_association_test.rb +88 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/associations/join_model_test.rb +707 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/associations_test.rb +262 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/attribute_methods_test.rb +238 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/base_test.rb +1974 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/binary_test.rb +34 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/calculations_test.rb +271 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/callbacks_test.rb +400 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/class_inheritable_attributes_test.rb +32 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/column_alias_test.rb +17 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/connection_test_firebird.rb +8 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/connection_test_mysql.rb +30 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/copy_table_test_sqlite.rb +69 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/datatype_test_postgresql.rb +203 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/date_time_test.rb +37 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/default_test_firebird.rb +16 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/defaults_test.rb +69 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/deprecated_finder_test.rb +30 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/dirty_test.rb +163 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/finder_respond_to_test.rb +76 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/finder_test.rb +883 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/fixtures_test.rb +626 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/helper.rb +47 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/inheritance_test.rb +255 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/invalid_date_test.rb +24 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/json_serialization_test.rb +205 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/lifecycle_test.rb +140 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/locking_test.rb +289 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/method_scoping_test.rb +452 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/migration_test.rb +1319 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/migration_test_firebird.rb +124 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/mixin_test.rb +96 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/modules_test.rb +39 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/multiple_db_test.rb +60 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/named_scope_test.rb +157 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/pk_test.rb +101 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/query_cache_test.rb +126 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/readonly_test.rb +107 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/reflection_test.rb +176 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/reserved_word_test_mysql.rb +176 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/schema_authorization_test_postgresql.rb +75 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/schema_dumper_test.rb +138 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/schema_test_postgresql.rb +102 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/serialization_test.rb +47 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/synonym_test_oracle.rb +17 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/table_name_test_sqlserver.rb +23 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/threaded_connections_test.rb +48 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/transactions_test.rb +307 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/unconnected_test.rb +32 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/validations_test.rb +1509 -0
- data/spec/rails_root/vendor/rails/activerecord/test/cases/xml_serialization_test.rb +202 -0
- data/spec/rails_root/vendor/rails/activerecord/test/config.rb +5 -0
- data/spec/rails_root/vendor/rails/activerecord/test/connections/native_db2/connection.rb +25 -0
- data/spec/rails_root/vendor/rails/activerecord/test/connections/native_firebird/connection.rb +26 -0
- data/spec/rails_root/vendor/rails/activerecord/test/connections/native_frontbase/connection.rb +27 -0
- data/spec/rails_root/vendor/rails/activerecord/test/connections/native_mysql/connection.rb +27 -0
- data/spec/rails_root/vendor/rails/activerecord/test/connections/native_openbase/connection.rb +21 -0
- data/spec/rails_root/vendor/rails/activerecord/test/connections/native_oracle/connection.rb +27 -0
- data/spec/rails_root/vendor/rails/activerecord/test/connections/native_postgresql/connection.rb +21 -0
- data/spec/rails_root/vendor/rails/activerecord/test/connections/native_sqlite/connection.rb +25 -0
- data/spec/rails_root/vendor/rails/activerecord/test/connections/native_sqlite3/connection.rb +25 -0
- data/spec/rails_root/vendor/rails/activerecord/test/connections/native_sqlite3/in_memory_connection.rb +18 -0
- data/spec/rails_root/vendor/rails/activerecord/test/connections/native_sybase/connection.rb +23 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/accounts.yml +28 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/all/developers.yml +0 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/all/people.csv +0 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/all/tasks.yml +0 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/author_addresses.yml +5 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/author_favorites.yml +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/authors.yml +9 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/binaries.yml +132 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/books.yml +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/categories.yml +14 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/categories/special_categories.yml +9 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/categories/subsubdir/arbitrary_filename.yml +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/categories_ordered.yml +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/categories_posts.yml +23 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/categorizations.yml +17 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/clubs.yml +6 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/comments.yml +59 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/companies.yml +55 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/computers.yml +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/courses.yml +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/customers.yml +17 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/developers.yml +21 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/developers_projects.yml +17 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/edges.yml +6 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/entrants.yml +14 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/fk_test_has_fk.yml +3 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/fk_test_has_pk.yml +2 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/funny_jokes.yml +10 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/items.yml +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/jobs.yml +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/legacy_things.yml +3 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/mateys.yml +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/members.yml +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/memberships.yml +20 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/minimalistics.yml +2 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/mixed_case_monkeys.yml +6 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/mixins.yml +29 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/movies.yml +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/naked/csv/accounts.csv +1 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/naked/yml/accounts.yml +1 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/naked/yml/companies.yml +1 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/naked/yml/courses.yml +1 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/owners.yml +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/parrots.yml +27 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/parrots_pirates.yml +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/people.yml +6 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/pets.yml +14 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/pirates.yml +9 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/posts.yml +49 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/price_estimates.yml +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/projects.yml +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/readers.yml +9 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/references.yml +17 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/reserved_words/distinct.yml +5 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/reserved_words/distincts_selects.yml +11 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/reserved_words/group.yml +14 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/reserved_words/select.yml +8 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/reserved_words/values.yml +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/ships.yml +5 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/sponsors.yml +9 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/subscribers.yml +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/subscriptions.yml +12 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/taggings.yml +28 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/tags.yml +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/tasks.yml +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/topics.yml +42 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/treasures.yml +10 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/vertices.yml +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/fixtures/warehouse-things.yml +3 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/decimal/1_give_me_big_numbers.rb +15 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/duplicate/1_people_have_last_names.rb +9 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/duplicate/2_we_need_reminders.rb +12 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/duplicate/3_foo.rb +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/duplicate/3_innocent_jointable.rb +12 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/duplicate_names/20080507052938_chunky.rb +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/duplicate_names/20080507053028_chunky.rb +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/interleaved/pass_1/3_innocent_jointable.rb +12 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/interleaved/pass_2/1_people_have_last_names.rb +9 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/interleaved/pass_2/3_innocent_jointable.rb +12 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/interleaved/pass_3/1_people_have_last_names.rb +9 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/interleaved/pass_3/2_i_raise_on_down.rb +8 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/interleaved/pass_3/3_innocent_jointable.rb +12 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/missing/1000_people_have_middle_names.rb +9 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/missing/1_people_have_last_names.rb +9 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/missing/3_we_need_reminders.rb +12 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/missing/4_innocent_jointable.rb +12 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/valid/1_people_have_last_names.rb +9 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/valid/2_we_need_reminders.rb +12 -0
- data/spec/rails_root/vendor/rails/activerecord/test/migrations/valid/3_innocent_jointable.rb +12 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/author.rb +133 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/auto_id.rb +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/binary.rb +2 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/book.rb +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/categorization.rb +5 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/category.rb +29 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/citation.rb +6 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/club.rb +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/column_name.rb +3 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/comment.rb +25 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/company.rb +123 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/company_in_module.rb +61 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/computer.rb +3 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/contact.rb +16 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/course.rb +3 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/customer.rb +55 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/default.rb +2 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/developer.rb +76 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/edge.rb +5 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/entrant.rb +3 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/guid.rb +2 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/item.rb +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/job.rb +5 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/joke.rb +3 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/keyboard.rb +3 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/legacy_thing.rb +3 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/matey.rb +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/member.rb +9 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/membership.rb +9 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/minimalistic.rb +2 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/mixed_case_monkey.rb +3 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/movie.rb +5 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/order.rb +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/owner.rb +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/parrot.rb +13 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/person.rb +10 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/pet.rb +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/pirate.rb +9 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/post.rb +80 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/price_estimate.rb +3 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/project.rb +29 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/reader.rb +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/reference.rb +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/reply.rb +39 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/ship.rb +3 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/sponsor.rb +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/subject.rb +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/subscriber.rb +8 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/subscription.rb +4 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/tag.rb +7 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/tagging.rb +10 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/task.rb +3 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/topic.rb +65 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/treasure.rb +6 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/vertex.rb +9 -0
- data/spec/rails_root/vendor/rails/activerecord/test/models/warehouse_thing.rb +5 -0
- data/spec/rails_root/vendor/rails/activerecord/test/schema/mysql_specific_schema.rb +12 -0
- data/spec/rails_root/vendor/rails/activerecord/test/schema/postgresql_specific_schema.rb +103 -0
- data/spec/rails_root/vendor/rails/activerecord/test/schema/schema.rb +421 -0
- data/spec/rails_root/vendor/rails/activerecord/test/schema/schema2.rb +6 -0
- data/spec/rails_root/vendor/rails/activerecord/test/schema/sqlite_specific_schema.rb +25 -0
- data/spec/rails_root/vendor/rails/activerecord/test/schema/sqlserver_specific_schema.rb +5 -0
- data/spec/rails_root/vendor/rails/activeresource/CHANGELOG +246 -0
- data/spec/rails_root/vendor/rails/activeresource/README +165 -0
- data/spec/rails_root/vendor/rails/activeresource/Rakefile +135 -0
- data/spec/rails_root/vendor/rails/activeresource/lib/active_resource.rb +47 -0
- data/spec/rails_root/vendor/rails/activeresource/lib/active_resource/base.rb +1014 -0
- data/spec/rails_root/vendor/rails/activeresource/lib/active_resource/connection.rb +207 -0
- data/spec/rails_root/vendor/rails/activeresource/lib/active_resource/custom_methods.rb +119 -0
- data/spec/rails_root/vendor/rails/activeresource/lib/active_resource/formats.rb +14 -0
- data/spec/rails_root/vendor/rails/activeresource/lib/active_resource/formats/json_format.rb +23 -0
- data/spec/rails_root/vendor/rails/activeresource/lib/active_resource/formats/xml_format.rb +34 -0
- data/spec/rails_root/vendor/rails/activeresource/lib/active_resource/http_mock.rb +217 -0
- data/spec/rails_root/vendor/rails/activeresource/lib/active_resource/validations.rb +288 -0
- data/spec/rails_root/vendor/rails/activeresource/lib/active_resource/version.rb +9 -0
- data/spec/rails_root/vendor/rails/activeresource/lib/activeresource.rb +1 -0
- data/spec/rails_root/vendor/rails/activeresource/test/abstract_unit.rb +22 -0
- data/spec/rails_root/vendor/rails/activeresource/test/authorization_test.rb +122 -0
- data/spec/rails_root/vendor/rails/activeresource/test/base/custom_methods_test.rb +99 -0
- data/spec/rails_root/vendor/rails/activeresource/test/base/equality_test.rb +43 -0
- data/spec/rails_root/vendor/rails/activeresource/test/base/load_test.rb +146 -0
- data/spec/rails_root/vendor/rails/activeresource/test/base_errors_test.rb +48 -0
- data/spec/rails_root/vendor/rails/activeresource/test/base_test.rb +791 -0
- data/spec/rails_root/vendor/rails/activeresource/test/connection_test.rb +190 -0
- data/spec/rails_root/vendor/rails/activeresource/test/fixtures/beast.rb +14 -0
- data/spec/rails_root/vendor/rails/activeresource/test/fixtures/person.rb +3 -0
- data/spec/rails_root/vendor/rails/activeresource/test/fixtures/street_address.rb +4 -0
- data/spec/rails_root/vendor/rails/activeresource/test/format_test.rb +83 -0
- data/spec/rails_root/vendor/rails/activeresource/test/setter_trap.rb +27 -0
- data/spec/rails_root/vendor/rails/activesupport/CHANGELOG +1181 -0
- data/spec/rails_root/vendor/rails/activesupport/README +43 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support.rb +55 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/base64.rb +22 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/basic_object.rb +24 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/buffered_logger.rb +121 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/cache.rb +145 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb +15 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/cache/drb_store.rb +15 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/cache/file_store.rb +70 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/cache/mem_cache_store.rb +100 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/cache/memory_store.rb +38 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/callbacks.rb +275 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/clean_logger.rb +127 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext.rb +4 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/array.rb +13 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/array/access.rb +26 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/array/conversions.rb +178 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/array/extract_options.rb +20 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/array/grouping.rb +63 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb +12 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/base64.rb +4 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/base64/encoding.rb +13 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb +12 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal.rb +6 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal/conversions.rb +41 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/blank.rb +53 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/cgi.rb +5 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/cgi/escape_skipping_slashes.rb +14 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/class.rb +4 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb +54 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb +46 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb +140 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/class/removal.rb +50 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/date.rb +10 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/date/behavior.rb +13 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/date/calculations.rb +215 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb +107 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/date_time.rb +12 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/date_time/calculations.rb +112 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb +96 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/duplicable.rb +37 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/enumerable.rb +69 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb +41 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/file.rb +21 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/float.rb +5 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/float/rounding.rb +24 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/hash.rb +13 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb +259 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/hash/diff.rb +19 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/hash/except.rb +24 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb +137 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/hash/keys.rb +52 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb +28 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/hash/slice.rb +28 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/integer.rb +7 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb +29 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/integer/inflections.rb +20 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/kernel.rb +5 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/kernel/agnostics.rb +11 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/kernel/daemonizing.rb +7 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/kernel/debugger.rb +13 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb +59 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/kernel/requires.rb +24 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/load_error.rb +38 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/logger.rb +16 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/module.rb +8 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/module/aliasing.rb +70 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb +31 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/module/attr_internal.rb +32 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb +58 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/module/delegation.rb +64 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb +30 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/module/introspection.rb +75 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/module/loading.rb +23 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/name_error.rb +17 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/numeric.rb +9 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb +44 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/numeric/conversions.rb +19 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/numeric/time.rb +91 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/object.rb +4 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/object/conversions.rb +14 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/object/extending.rb +58 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/object/instance_variables.rb +74 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb +59 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/pathname.rb +7 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/pathname/clean_within.rb +14 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/proc.rb +12 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/process.rb +1 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/process/daemon.rb +25 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/range.rb +11 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb +32 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/range/conversions.rb +27 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/range/include_range.rb +30 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/range/overlaps.rb +15 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/string.rb +18 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/string/access.rb +82 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/string/conversions.rb +28 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/string/filters.rb +26 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb +148 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/string/iterators.rb +21 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb +35 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/string/unicode.rb +68 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/string/xchar.rb +11 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb +14 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/test.rb +1 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/test/unit/assertions.rb +64 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/time.rb +21 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/time/behavior.rb +13 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb +276 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/time/conversions.rb +89 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/time/zones.rb +86 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/dependencies.rb +552 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/deprecation.rb +205 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/duration.rb +96 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/gzip.rb +25 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/inflections.rb +53 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/inflector.rb +308 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/json.rb +23 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/json/decoding.rb +63 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/json/encoders/date.rb +14 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/json/encoders/date_time.rb +14 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb +12 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/json/encoders/false_class.rb +5 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/json/encoders/hash.rb +47 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/json/encoders/nil_class.rb +5 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/json/encoders/numeric.rb +5 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/json/encoders/object.rb +6 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/json/encoders/regexp.rb +5 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/json/encoders/string.rb +36 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/json/encoders/symbol.rb +5 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/json/encoders/time.rb +14 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/json/encoders/true_class.rb +5 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/json/encoding.rb +37 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/json/variable.rb +10 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/multibyte.rb +9 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/multibyte/chars.rb +137 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/multibyte/generators/generate_tables.rb +149 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/multibyte/handlers/passthru_handler.rb +9 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb +564 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/multibyte/handlers/utf8_handler_proc.rb +43 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/option_merger.rb +25 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/ordered_hash.rb +43 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/ordered_options.rb +17 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/test_case.rb +13 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/testing/default.rb +9 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb +93 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/time_with_zone.rb +283 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/values/time_zone.rb +394 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/values/unicode_tables.dat +0 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor.rb +26 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/blankslate.rb +113 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder.rb +13 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/blankslate.rb +20 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/css.rb +250 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xchar.rb +115 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlbase.rb +139 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlevents.rb +63 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlmarkup.rb +328 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/memcache-client-1.5.0/memcache.rb +849 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo.rb +33 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/data_timezone.rb +47 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/data_timezone_info.rb +226 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Algiers.rb +55 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Cairo.rb +219 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Casablanca.rb +38 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Harare.rb +18 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Johannesburg.rb +25 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Monrovia.rb +22 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Nairobi.rb +23 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +166 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Argentina/San_Juan.rb +170 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Bogota.rb +23 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Caracas.rb +23 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Chicago.rb +283 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Chihuahua.rb +136 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Denver.rb +204 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Godthab.rb +161 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Guatemala.rb +27 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Halifax.rb +274 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Indiana/Indianapolis.rb +149 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Juneau.rb +194 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/La_Paz.rb +22 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Lima.rb +35 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Los_Angeles.rb +232 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Mazatlan.rb +139 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Mexico_City.rb +144 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Monterrey.rb +131 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/New_York.rb +282 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Phoenix.rb +30 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Regina.rb +74 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Santiago.rb +205 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/St_Johns.rb +288 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Tijuana.rb +196 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Almaty.rb +67 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Baghdad.rb +73 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Baku.rb +161 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Bangkok.rb +20 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Chongqing.rb +33 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Dhaka.rb +27 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Hong_Kong.rb +87 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Irkutsk.rb +165 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Jakarta.rb +30 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Jerusalem.rb +163 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kabul.rb +20 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kamchatka.rb +163 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Karachi.rb +28 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Katmandu.rb +20 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kolkata.rb +25 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Krasnoyarsk.rb +163 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kuala_Lumpur.rb +31 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kuwait.rb +18 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Magadan.rb +163 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Muscat.rb +18 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Novosibirsk.rb +164 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Rangoon.rb +24 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Riyadh.rb +18 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Seoul.rb +34 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Shanghai.rb +35 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Singapore.rb +33 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Taipei.rb +59 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tashkent.rb +47 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tbilisi.rb +78 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tehran.rb +121 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tokyo.rb +30 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Ulaanbaatar.rb +65 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Urumqi.rb +33 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Vladivostok.rb +164 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Yakutsk.rb +163 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Yekaterinburg.rb +165 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Yerevan.rb +165 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Atlantic/Azores.rb +270 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Atlantic/Cape_Verde.rb +23 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Atlantic/South_Georgia.rb +18 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Adelaide.rb +187 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Brisbane.rb +35 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Darwin.rb +29 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Hobart.rb +193 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Melbourne.rb +185 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Perth.rb +37 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Sydney.rb +185 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Etc/UTC.rb +16 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Amsterdam.rb +228 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Athens.rb +185 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Belgrade.rb +163 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Berlin.rb +188 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Bratislava.rb +13 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Brussels.rb +232 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Bucharest.rb +181 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Budapest.rb +197 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Copenhagen.rb +179 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Dublin.rb +276 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Helsinki.rb +163 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Istanbul.rb +218 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Kiev.rb +168 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Lisbon.rb +268 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Ljubljana.rb +13 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/London.rb +288 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Madrid.rb +211 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Minsk.rb +170 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Moscow.rb +181 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Paris.rb +232 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Prague.rb +187 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Riga.rb +176 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Rome.rb +215 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Sarajevo.rb +13 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Skopje.rb +13 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Sofia.rb +173 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Stockholm.rb +165 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Tallinn.rb +172 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Vienna.rb +183 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Vilnius.rb +170 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Warsaw.rb +212 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Zagreb.rb +13 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Auckland.rb +202 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Fiji.rb +23 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Guam.rb +22 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Honolulu.rb +28 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Majuro.rb +20 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Midway.rb +25 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Noumea.rb +25 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Pago_Pago.rb +26 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Port_Moresby.rb +20 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Tongatapu.rb +27 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/info_timezone.rb +52 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/linked_timezone.rb +51 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/linked_timezone_info.rb +44 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/offset_rationals.rb +95 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/time_or_datetime.rb +292 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone.rb +508 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_definition.rb +56 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_info.rb +40 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_offset_info.rb +94 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_period.rb +198 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_transition_info.rb +138 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/vendor/xml-simple-1.0.11/xmlsimple.rb +1021 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/version.rb +9 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/active_support/whiny_nil.rb +58 -0
- data/spec/rails_root/vendor/rails/activesupport/lib/activesupport.rb +1 -0
- data/spec/rails_root/vendor/rails/railties/CHANGELOG +2027 -0
- data/spec/rails_root/vendor/rails/railties/MIT-LICENSE +20 -0
- data/spec/rails_root/vendor/rails/railties/README +256 -0
- data/spec/rails_root/vendor/rails/railties/Rakefile +349 -0
- data/spec/rails_root/vendor/rails/railties/bin/about +3 -0
- data/spec/rails_root/vendor/rails/railties/bin/console +3 -0
- data/spec/rails_root/vendor/rails/railties/bin/dbconsole +3 -0
- data/spec/rails_root/vendor/rails/railties/bin/destroy +3 -0
- data/spec/rails_root/vendor/rails/railties/bin/generate +3 -0
- data/spec/rails_root/vendor/rails/railties/bin/performance/benchmarker +3 -0
- data/spec/rails_root/vendor/rails/railties/bin/performance/profiler +3 -0
- data/spec/rails_root/vendor/rails/railties/bin/performance/request +3 -0
- data/spec/rails_root/vendor/rails/railties/bin/plugin +3 -0
- data/spec/rails_root/vendor/rails/railties/bin/process/inspector +3 -0
- data/spec/rails_root/vendor/rails/railties/bin/process/reaper +3 -0
- data/spec/rails_root/vendor/rails/railties/bin/process/spawner +3 -0
- data/spec/rails_root/vendor/rails/railties/bin/rails +19 -0
- data/spec/rails_root/vendor/rails/railties/bin/runner +3 -0
- data/spec/rails_root/vendor/rails/railties/bin/server +3 -0
- data/spec/rails_root/vendor/rails/railties/builtin/rails_info/rails/info.rb +125 -0
- data/spec/rails_root/vendor/rails/railties/builtin/rails_info/rails/info_controller.rb +9 -0
- data/spec/rails_root/vendor/rails/railties/builtin/rails_info/rails/info_helper.rb +2 -0
- data/spec/rails_root/vendor/rails/railties/builtin/rails_info/rails_info_controller.rb +2 -0
- data/spec/rails_root/vendor/rails/railties/configs/apache.conf +40 -0
- data/spec/rails_root/vendor/rails/railties/configs/databases/frontbase.yml +28 -0
- data/spec/rails_root/vendor/rails/railties/configs/databases/mysql.yml +54 -0
- data/spec/rails_root/vendor/rails/railties/configs/databases/oracle.yml +39 -0
- data/spec/rails_root/vendor/rails/railties/configs/databases/postgresql.yml +48 -0
- data/spec/rails_root/vendor/rails/railties/configs/databases/sqlite2.yml +16 -0
- data/spec/rails_root/vendor/rails/railties/configs/databases/sqlite3.yml +19 -0
- data/spec/rails_root/vendor/rails/railties/configs/empty.log +0 -0
- data/spec/rails_root/vendor/rails/railties/configs/initializers/inflections.rb +10 -0
- data/spec/rails_root/vendor/rails/railties/configs/initializers/mime_types.rb +5 -0
- data/spec/rails_root/vendor/rails/railties/configs/initializers/new_rails_defaults.rb +15 -0
- data/spec/rails_root/vendor/rails/railties/configs/lighttpd.conf +54 -0
- data/spec/rails_root/vendor/rails/railties/configs/routes.rb +41 -0
- data/spec/rails_root/vendor/rails/railties/dispatches/dispatch.fcgi +24 -0
- data/spec/rails_root/vendor/rails/railties/dispatches/dispatch.rb +10 -0
- data/spec/rails_root/vendor/rails/railties/dispatches/gateway.cgi +97 -0
- data/spec/rails_root/vendor/rails/railties/doc/README_FOR_APP +2 -0
- data/spec/rails_root/vendor/rails/railties/environments/boot.rb +109 -0
- data/spec/rails_root/vendor/rails/railties/environments/development.rb +17 -0
- data/spec/rails_root/vendor/rails/railties/environments/environment.rb +67 -0
- data/spec/rails_root/vendor/rails/railties/environments/production.rb +22 -0
- data/spec/rails_root/vendor/rails/railties/environments/test.rb +22 -0
- data/spec/rails_root/vendor/rails/railties/fresh_rakefile +10 -0
- data/spec/rails_root/vendor/rails/railties/helpers/application.rb +15 -0
- data/spec/rails_root/vendor/rails/railties/helpers/application_helper.rb +3 -0
- data/spec/rails_root/vendor/rails/railties/helpers/test_helper.rb +38 -0
- data/spec/rails_root/vendor/rails/railties/html/404.html +30 -0
- data/spec/rails_root/vendor/rails/railties/html/422.html +30 -0
- data/spec/rails_root/vendor/rails/railties/html/500.html +30 -0
- data/spec/rails_root/vendor/rails/railties/html/favicon.ico +0 -0
- data/spec/rails_root/vendor/rails/railties/html/images/rails.png +0 -0
- data/spec/rails_root/vendor/rails/railties/html/index.html +274 -0
- data/spec/rails_root/vendor/rails/railties/html/javascripts/application.js +2 -0
- data/spec/rails_root/vendor/rails/railties/html/javascripts/controls.js +963 -0
- data/spec/rails_root/vendor/rails/railties/html/javascripts/dragdrop.js +972 -0
- data/spec/rails_root/vendor/rails/railties/html/javascripts/effects.js +1120 -0
- data/spec/rails_root/vendor/rails/railties/html/javascripts/prototype.js +4225 -0
- data/spec/rails_root/vendor/rails/railties/html/robots.txt +5 -0
- data/spec/rails_root/vendor/rails/railties/lib/code_statistics.rb +107 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands.rb +17 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/about.rb +2 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/console.rb +32 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/dbconsole.rb +65 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/destroy.rb +6 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/generate.rb +6 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/ncgi/listener +86 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/ncgi/tracker +69 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/performance/benchmarker.rb +24 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/performance/profiler.rb +50 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/performance/request.rb +6 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/plugin.rb +950 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/process/inspector.rb +68 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/process/reaper.rb +149 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/process/spawner.rb +219 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/process/spinner.rb +57 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/runner.rb +48 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/server.rb +39 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/servers/base.rb +31 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/servers/lighttpd.rb +94 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/servers/mongrel.rb +69 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/servers/new_mongrel.rb +16 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/servers/webrick.rb +66 -0
- data/spec/rails_root/vendor/rails/railties/lib/commands/update.rb +4 -0
- data/spec/rails_root/vendor/rails/railties/lib/console_app.rb +30 -0
- data/spec/rails_root/vendor/rails/railties/lib/console_sandbox.rb +6 -0
- data/spec/rails_root/vendor/rails/railties/lib/console_with_helpers.rb +26 -0
- data/spec/rails_root/vendor/rails/railties/lib/dispatcher.rb +24 -0
- data/spec/rails_root/vendor/rails/railties/lib/fcgi_handler.rb +239 -0
- data/spec/rails_root/vendor/rails/railties/lib/initializer.rb +900 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails/gem_builder.rb +21 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails/gem_dependency.rb +124 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails/mongrel_server/commands.rb +342 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails/mongrel_server/handler.rb +55 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails/plugin.rb +115 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails/plugin/loader.rb +152 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails/plugin/locator.rb +99 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails/version.rb +9 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator.rb +43 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/base.rb +263 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/commands.rb +607 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generated_attribute.rb +42 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/applications/app/USAGE +9 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/applications/app/app_generator.rb +178 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/controller/USAGE +29 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/controller/controller_generator.rb +37 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/controller.rb +7 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/functional_test.rb +8 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/helper.rb +2 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/view.html.erb +2 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/USAGE +8 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/integration_test_generator.rb +16 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb +10 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/mailer/USAGE +16 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb +30 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/fixture.erb +3 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/fixture.rhtml +0 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb +15 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +21 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/view.erb +3 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/view.rhtml +0 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/migration/USAGE +29 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/migration/migration_generator.rb +20 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/migration/templates/migration.rb +11 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/model/USAGE +27 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/model/model_generator.rb +45 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml +19 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/migration.rb +16 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/model.rb +2 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/unit_test.rb +8 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/observer/USAGE +13 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/observer/observer_generator.rb +16 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/observer/templates/observer.rb +2 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/observer/templates/unit_test.rb +8 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/plugin/USAGE +25 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/plugin/plugin_generator.rb +39 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/MIT-LICENSE +20 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/README +13 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/Rakefile +22 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/USAGE +8 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/generator.rb +8 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/init.rb +1 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/install.rb +1 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/plugin.rb +1 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/tasks.rake +4 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/uninstall.rb +1 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/unit_test.rb +8 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE +23 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/resource/resource_generator.rb +74 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/controller.rb +2 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb +8 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/helper.rb +2 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/USAGE +25 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +93 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb +85 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +45 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/helper.rb +2 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/layout.html.erb +17 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/style.css +54 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.html.erb +18 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_index.html.erb +24 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.html.erb +17 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.html.erb +10 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/USAGE +10 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/session_migration_generator.rb +18 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/templates/migration.rb +16 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/lookup.rb +248 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/manifest.rb +53 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/options.rb +150 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/scripts.rb +89 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/scripts/destroy.rb +30 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/scripts/generate.rb +7 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/scripts/update.rb +12 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/secret_key_generator.rb +164 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/simple_logger.rb +46 -0
- data/spec/rails_root/vendor/rails/railties/lib/rails_generator/spec.rb +44 -0
- data/spec/rails_root/vendor/rails/railties/lib/railties_path.rb +1 -0
- data/spec/rails_root/vendor/rails/railties/lib/ruby_version_check.rb +17 -0
- data/spec/rails_root/vendor/rails/railties/lib/rubyprof_ext.rb +35 -0
- data/spec/rails_root/vendor/rails/railties/lib/source_annotation_extractor.rb +102 -0
- data/spec/rails_root/vendor/rails/railties/lib/tasks/annotations.rake +23 -0
- data/spec/rails_root/vendor/rails/railties/lib/tasks/databases.rake +387 -0
- data/spec/rails_root/vendor/rails/railties/lib/tasks/documentation.rake +80 -0
- data/spec/rails_root/vendor/rails/railties/lib/tasks/framework.rake +114 -0
- data/spec/rails_root/vendor/rails/railties/lib/tasks/gems.rake +64 -0
- data/spec/rails_root/vendor/rails/railties/lib/tasks/log.rake +9 -0
- data/spec/rails_root/vendor/rails/railties/lib/tasks/misc.rake +57 -0
- data/spec/rails_root/vendor/rails/railties/lib/tasks/rails.rb +8 -0
- data/spec/rails_root/vendor/rails/railties/lib/tasks/routes.rake +17 -0
- data/spec/rails_root/vendor/rails/railties/lib/tasks/statistics.rake +18 -0
- data/spec/rails_root/vendor/rails/railties/lib/tasks/testing.rake +118 -0
- data/spec/rails_root/vendor/rails/railties/lib/tasks/tmp.rake +37 -0
- data/spec/rails_root/vendor/rails/railties/lib/test_help.rb +28 -0
- data/spec/rails_root/vendor/rails/railties/lib/webrick_server.rb +165 -0
- data/todo.yml +23 -0
- metadata +2443 -0
@@ -0,0 +1,2415 @@
|
|
1
|
+
require 'abstract_unit'
|
2
|
+
require 'controller/fake_controllers'
|
3
|
+
require 'action_controller/routing'
|
4
|
+
|
5
|
+
class MilestonesController < ActionController::Base
|
6
|
+
def index() head :ok end
|
7
|
+
alias_method :show, :index
|
8
|
+
def rescue_action(e) raise e end
|
9
|
+
end
|
10
|
+
|
11
|
+
RunTimeTests = ARGV.include? 'time'
|
12
|
+
ROUTING = ActionController::Routing
|
13
|
+
|
14
|
+
class ROUTING::RouteBuilder
|
15
|
+
attr_reader :warn_output
|
16
|
+
|
17
|
+
def warn(msg)
|
18
|
+
(@warn_output ||= []) << msg
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# See RFC 3986, section 3.3 for allowed path characters.
|
23
|
+
class UriReservedCharactersRoutingTest < Test::Unit::TestCase
|
24
|
+
def setup
|
25
|
+
ActionController::Routing.use_controllers! ['controller']
|
26
|
+
@set = ActionController::Routing::RouteSet.new
|
27
|
+
@set.draw do |map|
|
28
|
+
map.connect ':controller/:action/:variable/*additional'
|
29
|
+
end
|
30
|
+
|
31
|
+
safe, unsafe = %w(: @ & = + $ , ;), %w(^ / ? # [ ])
|
32
|
+
hex = unsafe.map { |char| '%' + char.unpack('H2').first.upcase }
|
33
|
+
|
34
|
+
@segment = "#{safe.join}#{unsafe.join}".freeze
|
35
|
+
@escaped = "#{safe.join}#{hex.join}".freeze
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_route_generation_escapes_unsafe_path_characters
|
39
|
+
assert_equal "/contr#{@segment}oller/act#{@escaped}ion/var#{@escaped}iable/add#{@escaped}itional-1/add#{@escaped}itional-2",
|
40
|
+
@set.generate(:controller => "contr#{@segment}oller",
|
41
|
+
:action => "act#{@segment}ion",
|
42
|
+
:variable => "var#{@segment}iable",
|
43
|
+
:additional => ["add#{@segment}itional-1", "add#{@segment}itional-2"])
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_route_recognition_unescapes_path_components
|
47
|
+
options = { :controller => "controller",
|
48
|
+
:action => "act#{@segment}ion",
|
49
|
+
:variable => "var#{@segment}iable",
|
50
|
+
:additional => ["add#{@segment}itional-1", "add#{@segment}itional-2"] }
|
51
|
+
assert_equal options, @set.recognize_path("/controller/act#{@escaped}ion/var#{@escaped}iable/add#{@escaped}itional-1/add#{@escaped}itional-2")
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_route_generation_allows_passing_non_string_values_to_generated_helper
|
55
|
+
assert_equal "/controller/action/variable/1/2", @set.generate(:controller => "controller",
|
56
|
+
:action => "action",
|
57
|
+
:variable => "variable",
|
58
|
+
:additional => [1, 2])
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
class LegacyRouteSetTests < Test::Unit::TestCase
|
63
|
+
attr_reader :rs
|
64
|
+
def setup
|
65
|
+
# These tests assume optimisation is on, so re-enable it.
|
66
|
+
ActionController::Base.optimise_named_routes = true
|
67
|
+
|
68
|
+
@rs = ::ActionController::Routing::RouteSet.new
|
69
|
+
@rs.draw {|m| m.connect ':controller/:action/:id' }
|
70
|
+
|
71
|
+
ActionController::Routing.use_controllers! %w(content admin/user admin/news_feed)
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_default_setup
|
75
|
+
assert_equal({:controller => "content", :action => 'index'}, rs.recognize_path("/content"))
|
76
|
+
assert_equal({:controller => "content", :action => 'list'}, rs.recognize_path("/content/list"))
|
77
|
+
assert_equal({:controller => "content", :action => 'show', :id => '10'}, rs.recognize_path("/content/show/10"))
|
78
|
+
|
79
|
+
assert_equal({:controller => "admin/user", :action => 'show', :id => '10'}, rs.recognize_path("/admin/user/show/10"))
|
80
|
+
|
81
|
+
assert_equal '/admin/user/show/10', rs.generate(:controller => 'admin/user', :action => 'show', :id => 10)
|
82
|
+
|
83
|
+
assert_equal '/admin/user/show', rs.generate({:action => 'show'}, {:controller => 'admin/user', :action => 'list', :id => '10'})
|
84
|
+
assert_equal '/admin/user/list/10', rs.generate({}, {:controller => 'admin/user', :action => 'list', :id => '10'})
|
85
|
+
|
86
|
+
assert_equal '/admin/stuff', rs.generate({:controller => 'stuff'}, {:controller => 'admin/user', :action => 'list', :id => '10'})
|
87
|
+
assert_equal '/stuff', rs.generate({:controller => '/stuff'}, {:controller => 'admin/user', :action => 'list', :id => '10'})
|
88
|
+
end
|
89
|
+
|
90
|
+
def test_ignores_leading_slash
|
91
|
+
@rs.draw {|m| m.connect '/:controller/:action/:id'}
|
92
|
+
test_default_setup
|
93
|
+
end
|
94
|
+
|
95
|
+
def test_time_recognition
|
96
|
+
# We create many routes to make situation more realistic
|
97
|
+
@rs = ::ActionController::Routing::RouteSet.new
|
98
|
+
@rs.draw { |map|
|
99
|
+
map.frontpage '', :controller => 'search', :action => 'new'
|
100
|
+
map.resources :videos do |video|
|
101
|
+
video.resources :comments
|
102
|
+
video.resource :file, :controller => 'video_file'
|
103
|
+
video.resource :share, :controller => 'video_shares'
|
104
|
+
video.resource :abuse, :controller => 'video_abuses'
|
105
|
+
end
|
106
|
+
map.resources :abuses, :controller => 'video_abuses'
|
107
|
+
map.resources :video_uploads
|
108
|
+
map.resources :video_visits
|
109
|
+
|
110
|
+
map.resources :users do |user|
|
111
|
+
user.resource :settings
|
112
|
+
user.resources :videos
|
113
|
+
end
|
114
|
+
map.resources :channels do |channel|
|
115
|
+
channel.resources :videos, :controller => 'channel_videos'
|
116
|
+
end
|
117
|
+
map.resource :session
|
118
|
+
map.resource :lost_password
|
119
|
+
map.search 'search', :controller => 'search'
|
120
|
+
map.resources :pages
|
121
|
+
map.connect ':controller/:action/:id'
|
122
|
+
}
|
123
|
+
n = 1000
|
124
|
+
if RunTimeTests
|
125
|
+
GC.start
|
126
|
+
rectime = Benchmark.realtime do
|
127
|
+
n.times do
|
128
|
+
rs.recognize_path("/videos/1234567", {:method => :get})
|
129
|
+
rs.recognize_path("/videos/1234567/abuse", {:method => :get})
|
130
|
+
rs.recognize_path("/users/1234567/settings", {:method => :get})
|
131
|
+
rs.recognize_path("/channels/1234567", {:method => :get})
|
132
|
+
rs.recognize_path("/session/new", {:method => :get})
|
133
|
+
rs.recognize_path("/admin/user/show/10", {:method => :get})
|
134
|
+
end
|
135
|
+
end
|
136
|
+
puts "\n\nRecognition (#{rs.routes.size} routes):"
|
137
|
+
per_url = rectime / (n * 6)
|
138
|
+
puts "#{per_url * 1000} ms/url"
|
139
|
+
puts "#{1 / per_url} url/s\n\n"
|
140
|
+
end
|
141
|
+
end
|
142
|
+
def test_time_generation
|
143
|
+
n = 5000
|
144
|
+
if RunTimeTests
|
145
|
+
GC.start
|
146
|
+
pairs = [
|
147
|
+
[{:controller => 'content', :action => 'index'}, {:controller => 'content', :action => 'show'}],
|
148
|
+
[{:controller => 'content'}, {:controller => 'content', :action => 'index'}],
|
149
|
+
[{:controller => 'content', :action => 'list'}, {:controller => 'content', :action => 'index'}],
|
150
|
+
[{:controller => 'content', :action => 'show', :id => '10'}, {:controller => 'content', :action => 'list'}],
|
151
|
+
[{:controller => 'admin/user', :action => 'index'}, {:controller => 'admin/user', :action => 'show'}],
|
152
|
+
[{:controller => 'admin/user'}, {:controller => 'admin/user', :action => 'index'}],
|
153
|
+
[{:controller => 'admin/user', :action => 'list'}, {:controller => 'admin/user', :action => 'index'}],
|
154
|
+
[{:controller => 'admin/user', :action => 'show', :id => '10'}, {:controller => 'admin/user', :action => 'list'}],
|
155
|
+
]
|
156
|
+
p = nil
|
157
|
+
gentime = Benchmark.realtime do
|
158
|
+
n.times do
|
159
|
+
pairs.each {|(a, b)| rs.generate(a, b)}
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
puts "\n\nGeneration (RouteSet): (#{(n * 8)} urls)"
|
164
|
+
per_url = gentime / (n * 8)
|
165
|
+
puts "#{per_url * 1000} ms/url"
|
166
|
+
puts "#{1 / per_url} url/s\n\n"
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
def test_route_with_colon_first
|
171
|
+
rs.draw do |map|
|
172
|
+
map.connect '/:controller/:action/:id', :action => 'index', :id => nil
|
173
|
+
map.connect ':url', :controller => 'tiny_url', :action => 'translate'
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
def test_route_with_regexp_for_controller
|
178
|
+
rs.draw do |map|
|
179
|
+
map.connect ':controller/:admintoken/:action/:id', :controller => /admin\/.+/
|
180
|
+
map.connect ':controller/:action/:id'
|
181
|
+
end
|
182
|
+
assert_equal({:controller => "admin/user", :admintoken => "foo", :action => "index"},
|
183
|
+
rs.recognize_path("/admin/user/foo"))
|
184
|
+
assert_equal({:controller => "content", :action => "foo"}, rs.recognize_path("/content/foo"))
|
185
|
+
assert_equal '/admin/user/foo', rs.generate(:controller => "admin/user", :admintoken => "foo", :action => "index")
|
186
|
+
assert_equal '/content/foo', rs.generate(:controller => "content", :action => "foo")
|
187
|
+
end
|
188
|
+
|
189
|
+
def test_route_with_regexp_and_dot
|
190
|
+
rs.draw do |map|
|
191
|
+
map.connect ':controller/:action/:file',
|
192
|
+
:controller => /admin|user/,
|
193
|
+
:action => /upload|download/,
|
194
|
+
:defaults => {:file => nil},
|
195
|
+
:requirements => {:file => %r{[^/]+(\.[^/]+)?}}
|
196
|
+
end
|
197
|
+
# Without a file extension
|
198
|
+
assert_equal '/user/download/file',
|
199
|
+
rs.generate(:controller => "user", :action => "download", :file => "file")
|
200
|
+
assert_equal(
|
201
|
+
{:controller => "user", :action => "download", :file => "file"},
|
202
|
+
rs.recognize_path("/user/download/file"))
|
203
|
+
|
204
|
+
# Now, let's try a file with an extension, really a dot (.)
|
205
|
+
assert_equal '/user/download/file.jpg',
|
206
|
+
rs.generate(
|
207
|
+
:controller => "user", :action => "download", :file => "file.jpg")
|
208
|
+
assert_equal(
|
209
|
+
{:controller => "user", :action => "download", :file => "file.jpg"},
|
210
|
+
rs.recognize_path("/user/download/file.jpg"))
|
211
|
+
end
|
212
|
+
|
213
|
+
def test_basic_named_route
|
214
|
+
rs.add_named_route :home, '', :controller => 'content', :action => 'list'
|
215
|
+
x = setup_for_named_route
|
216
|
+
assert_equal("http://named.route.test/",
|
217
|
+
x.send(:home_url))
|
218
|
+
end
|
219
|
+
|
220
|
+
def test_basic_named_route_with_relative_url_root
|
221
|
+
rs.add_named_route :home, '', :controller => 'content', :action => 'list'
|
222
|
+
x = setup_for_named_route
|
223
|
+
x.relative_url_root="/foo"
|
224
|
+
assert_equal("http://named.route.test/foo/",
|
225
|
+
x.send(:home_url))
|
226
|
+
assert_equal "/foo/", x.send(:home_path)
|
227
|
+
end
|
228
|
+
|
229
|
+
def test_named_route_with_option
|
230
|
+
rs.add_named_route :page, 'page/:title', :controller => 'content', :action => 'show_page'
|
231
|
+
x = setup_for_named_route
|
232
|
+
assert_equal("http://named.route.test/page/new%20stuff",
|
233
|
+
x.send(:page_url, :title => 'new stuff'))
|
234
|
+
end
|
235
|
+
|
236
|
+
def test_named_route_with_default
|
237
|
+
rs.add_named_route :page, 'page/:title', :controller => 'content', :action => 'show_page', :title => 'AboutPage'
|
238
|
+
x = setup_for_named_route
|
239
|
+
assert_equal("http://named.route.test/page/AboutRails",
|
240
|
+
x.send(:page_url, :title => "AboutRails"))
|
241
|
+
|
242
|
+
end
|
243
|
+
|
244
|
+
def test_named_route_with_nested_controller
|
245
|
+
rs.add_named_route :users, 'admin/user', :controller => 'admin/user', :action => 'index'
|
246
|
+
x = setup_for_named_route
|
247
|
+
assert_equal("http://named.route.test/admin/user",
|
248
|
+
x.send(:users_url))
|
249
|
+
end
|
250
|
+
|
251
|
+
uses_mocha "named route optimisation" do
|
252
|
+
def test_optimised_named_route_call_never_uses_url_for
|
253
|
+
rs.add_named_route :users, 'admin/user', :controller => '/admin/user', :action => 'index'
|
254
|
+
rs.add_named_route :user, 'admin/user/:id', :controller=>'/admin/user', :action=>'show'
|
255
|
+
x = setup_for_named_route
|
256
|
+
x.expects(:url_for).never
|
257
|
+
x.send(:users_url)
|
258
|
+
x.send(:users_path)
|
259
|
+
x.send(:user_url, 2, :foo=>"bar")
|
260
|
+
x.send(:user_path, 3, :bar=>"foo")
|
261
|
+
end
|
262
|
+
|
263
|
+
def test_optimised_named_route_with_host
|
264
|
+
rs.add_named_route :pages, 'pages', :controller => 'content', :action => 'show_page', :host => 'foo.com'
|
265
|
+
x = setup_for_named_route
|
266
|
+
x.expects(:url_for).with(:host => 'foo.com', :only_path => false, :controller => 'content', :action => 'show_page', :use_route => :pages).once
|
267
|
+
x.send(:pages_url)
|
268
|
+
end
|
269
|
+
end
|
270
|
+
|
271
|
+
def setup_for_named_route
|
272
|
+
klass = Class.new(MockController)
|
273
|
+
rs.install_helpers(klass)
|
274
|
+
klass.new(rs)
|
275
|
+
end
|
276
|
+
|
277
|
+
def test_named_route_without_hash
|
278
|
+
rs.draw do |map|
|
279
|
+
map.normal ':controller/:action/:id'
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
def test_named_route_root
|
284
|
+
rs.draw do |map|
|
285
|
+
map.root :controller => "hello"
|
286
|
+
end
|
287
|
+
x = setup_for_named_route
|
288
|
+
assert_equal("http://named.route.test/", x.send(:root_url))
|
289
|
+
assert_equal("/", x.send(:root_path))
|
290
|
+
end
|
291
|
+
|
292
|
+
def test_named_route_with_regexps
|
293
|
+
rs.draw do |map|
|
294
|
+
map.article 'page/:year/:month/:day/:title', :controller => 'page', :action => 'show',
|
295
|
+
:year => /\d+/, :month => /\d+/, :day => /\d+/
|
296
|
+
map.connect ':controller/:action/:id'
|
297
|
+
end
|
298
|
+
x = setup_for_named_route
|
299
|
+
# assert_equal(
|
300
|
+
# {:controller => 'page', :action => 'show', :title => 'hi', :use_route => :article, :only_path => false},
|
301
|
+
# x.send(:article_url, :title => 'hi')
|
302
|
+
# )
|
303
|
+
assert_equal(
|
304
|
+
"http://named.route.test/page/2005/6/10/hi",
|
305
|
+
x.send(:article_url, :title => 'hi', :day => 10, :year => 2005, :month => 6)
|
306
|
+
)
|
307
|
+
end
|
308
|
+
|
309
|
+
def test_changing_controller
|
310
|
+
assert_equal '/admin/stuff/show/10', rs.generate(
|
311
|
+
{:controller => 'stuff', :action => 'show', :id => 10},
|
312
|
+
{:controller => 'admin/user', :action => 'index'}
|
313
|
+
)
|
314
|
+
end
|
315
|
+
|
316
|
+
def test_paths_escaped
|
317
|
+
rs.draw do |map|
|
318
|
+
map.path 'file/*path', :controller => 'content', :action => 'show_file'
|
319
|
+
map.connect ':controller/:action/:id'
|
320
|
+
end
|
321
|
+
|
322
|
+
# No + to space in URI escaping, only for query params.
|
323
|
+
results = rs.recognize_path "/file/hello+world/how+are+you%3F"
|
324
|
+
assert results, "Recognition should have succeeded"
|
325
|
+
assert_equal ['hello+world', 'how+are+you?'], results[:path]
|
326
|
+
|
327
|
+
# Use %20 for space instead.
|
328
|
+
results = rs.recognize_path "/file/hello%20world/how%20are%20you%3F"
|
329
|
+
assert results, "Recognition should have succeeded"
|
330
|
+
assert_equal ['hello world', 'how are you?'], results[:path]
|
331
|
+
|
332
|
+
results = rs.recognize_path "/file"
|
333
|
+
assert results, "Recognition should have succeeded"
|
334
|
+
assert_equal [], results[:path]
|
335
|
+
end
|
336
|
+
|
337
|
+
def test_paths_slashes_unescaped_with_ordered_parameters
|
338
|
+
rs.add_named_route :path, '/file/*path', :controller => 'content'
|
339
|
+
|
340
|
+
# No / to %2F in URI, only for query params.
|
341
|
+
x = setup_for_named_route
|
342
|
+
assert_equal("/file/hello/world", x.send(:path_path, 'hello/world'))
|
343
|
+
end
|
344
|
+
|
345
|
+
def test_non_controllers_cannot_be_matched
|
346
|
+
rs.draw do |map|
|
347
|
+
map.connect ':controller/:action/:id'
|
348
|
+
end
|
349
|
+
assert_raises(ActionController::RoutingError) { rs.recognize_path("/not_a/show/10") }
|
350
|
+
end
|
351
|
+
|
352
|
+
def test_paths_do_not_accept_defaults
|
353
|
+
assert_raises(ActionController::RoutingError) do
|
354
|
+
rs.draw do |map|
|
355
|
+
map.path 'file/*path', :controller => 'content', :action => 'show_file', :path => %w(fake default)
|
356
|
+
map.connect ':controller/:action/:id'
|
357
|
+
end
|
358
|
+
end
|
359
|
+
|
360
|
+
rs.draw do |map|
|
361
|
+
map.path 'file/*path', :controller => 'content', :action => 'show_file', :path => []
|
362
|
+
map.connect ':controller/:action/:id'
|
363
|
+
end
|
364
|
+
end
|
365
|
+
|
366
|
+
def test_should_list_options_diff_when_routing_requirements_dont_match
|
367
|
+
rs.draw do |map|
|
368
|
+
map.post 'post/:id', :controller=> 'post', :action=> 'show', :requirements => {:id => /\d+/}
|
369
|
+
end
|
370
|
+
exception = assert_raise(ActionController::RoutingError) { rs.generate(:controller => 'post', :action => 'show', :bad_param => "foo", :use_route => "post") }
|
371
|
+
assert_match /^post_url failed to generate/, exception.message
|
372
|
+
from_match = exception.message.match(/from \{[^\}]+\}/).to_s
|
373
|
+
assert_match /:bad_param=>"foo"/, from_match
|
374
|
+
assert_match /:action=>"show"/, from_match
|
375
|
+
assert_match /:controller=>"post"/, from_match
|
376
|
+
|
377
|
+
expected_match = exception.message.match(/expected: \{[^\}]+\}/).to_s
|
378
|
+
assert_no_match /:bad_param=>"foo"/, expected_match
|
379
|
+
assert_match /:action=>"show"/, expected_match
|
380
|
+
assert_match /:controller=>"post"/, expected_match
|
381
|
+
|
382
|
+
diff_match = exception.message.match(/diff: \{[^\}]+\}/).to_s
|
383
|
+
assert_match /:bad_param=>"foo"/, diff_match
|
384
|
+
assert_no_match /:action=>"show"/, diff_match
|
385
|
+
assert_no_match /:controller=>"post"/, diff_match
|
386
|
+
end
|
387
|
+
|
388
|
+
# this specifies the case where your formerly would get a very confusing error message with an empty diff
|
389
|
+
def test_should_have_better_error_message_when_options_diff_is_empty
|
390
|
+
rs.draw do |map|
|
391
|
+
map.content '/content/:query', :controller => 'content', :action => 'show'
|
392
|
+
end
|
393
|
+
|
394
|
+
exception = assert_raise(ActionController::RoutingError) { rs.generate(:controller => 'content', :action => 'show', :use_route => "content") }
|
395
|
+
assert_match %r[:action=>"show"], exception.message
|
396
|
+
assert_match %r[:controller=>"content"], exception.message
|
397
|
+
assert_match %r[you may have ambiguous routes, or you may need to supply additional parameters for this route], exception.message
|
398
|
+
assert_match %r[content_url has the following required parameters: \["content", :query\] - are they all satisfied?], exception.message
|
399
|
+
end
|
400
|
+
|
401
|
+
def test_dynamic_path_allowed
|
402
|
+
rs.draw do |map|
|
403
|
+
map.connect '*path', :controller => 'content', :action => 'show_file'
|
404
|
+
end
|
405
|
+
|
406
|
+
assert_equal '/pages/boo', rs.generate(:controller => 'content', :action => 'show_file', :path => %w(pages boo))
|
407
|
+
end
|
408
|
+
|
409
|
+
def test_dynamic_recall_paths_allowed
|
410
|
+
rs.draw do |map|
|
411
|
+
map.connect '*path', :controller => 'content', :action => 'show_file'
|
412
|
+
end
|
413
|
+
|
414
|
+
recall_path = ActionController::Routing::PathSegment::Result.new(%w(pages boo))
|
415
|
+
assert_equal '/pages/boo', rs.generate({}, :controller => 'content', :action => 'show_file', :path => recall_path)
|
416
|
+
end
|
417
|
+
|
418
|
+
def test_backwards
|
419
|
+
rs.draw do |map|
|
420
|
+
map.connect 'page/:id/:action', :controller => 'pages', :action => 'show'
|
421
|
+
map.connect ':controller/:action/:id'
|
422
|
+
end
|
423
|
+
|
424
|
+
assert_equal '/page/20', rs.generate({:id => 20}, {:controller => 'pages', :action => 'show'})
|
425
|
+
assert_equal '/page/20', rs.generate(:controller => 'pages', :id => 20, :action => 'show')
|
426
|
+
assert_equal '/pages/boo', rs.generate(:controller => 'pages', :action => 'boo')
|
427
|
+
end
|
428
|
+
|
429
|
+
def test_route_with_fixnum_default
|
430
|
+
rs.draw do |map|
|
431
|
+
map.connect 'page/:id', :controller => 'content', :action => 'show_page', :id => 1
|
432
|
+
map.connect ':controller/:action/:id'
|
433
|
+
end
|
434
|
+
|
435
|
+
assert_equal '/page', rs.generate(:controller => 'content', :action => 'show_page')
|
436
|
+
assert_equal '/page', rs.generate(:controller => 'content', :action => 'show_page', :id => 1)
|
437
|
+
assert_equal '/page', rs.generate(:controller => 'content', :action => 'show_page', :id => '1')
|
438
|
+
assert_equal '/page/10', rs.generate(:controller => 'content', :action => 'show_page', :id => 10)
|
439
|
+
|
440
|
+
assert_equal({:controller => "content", :action => 'show_page', :id => '1'}, rs.recognize_path("/page"))
|
441
|
+
assert_equal({:controller => "content", :action => 'show_page', :id => '1'}, rs.recognize_path("/page/1"))
|
442
|
+
assert_equal({:controller => "content", :action => 'show_page', :id => '10'}, rs.recognize_path("/page/10"))
|
443
|
+
end
|
444
|
+
|
445
|
+
# For newer revision
|
446
|
+
def test_route_with_text_default
|
447
|
+
rs.draw do |map|
|
448
|
+
map.connect 'page/:id', :controller => 'content', :action => 'show_page', :id => 1
|
449
|
+
map.connect ':controller/:action/:id'
|
450
|
+
end
|
451
|
+
|
452
|
+
assert_equal '/page/foo', rs.generate(:controller => 'content', :action => 'show_page', :id => 'foo')
|
453
|
+
assert_equal({:controller => "content", :action => 'show_page', :id => 'foo'}, rs.recognize_path("/page/foo"))
|
454
|
+
|
455
|
+
token = "\321\202\320\265\320\272\321\201\321\202" # 'text' in russian
|
456
|
+
escaped_token = CGI::escape(token)
|
457
|
+
|
458
|
+
assert_equal '/page/' + escaped_token, rs.generate(:controller => 'content', :action => 'show_page', :id => token)
|
459
|
+
assert_equal({:controller => "content", :action => 'show_page', :id => token}, rs.recognize_path("/page/#{escaped_token}"))
|
460
|
+
end
|
461
|
+
|
462
|
+
def test_action_expiry
|
463
|
+
assert_equal '/content', rs.generate({:controller => 'content'}, {:controller => 'content', :action => 'show'})
|
464
|
+
end
|
465
|
+
|
466
|
+
def test_recognition_with_uppercase_controller_name
|
467
|
+
assert_equal({:controller => "content", :action => 'index'}, rs.recognize_path("/Content"))
|
468
|
+
assert_equal({:controller => "content", :action => 'list'}, rs.recognize_path("/ConTent/list"))
|
469
|
+
assert_equal({:controller => "content", :action => 'show', :id => '10'}, rs.recognize_path("/CONTENT/show/10"))
|
470
|
+
|
471
|
+
# these used to work, before the routes rewrite, but support for this was pulled in the new version...
|
472
|
+
#assert_equal({'controller' => "admin/news_feed", 'action' => 'index'}, rs.recognize_path("Admin/NewsFeed"))
|
473
|
+
#assert_equal({'controller' => "admin/news_feed", 'action' => 'index'}, rs.recognize_path("Admin/News_Feed"))
|
474
|
+
end
|
475
|
+
|
476
|
+
def test_requirement_should_prevent_optional_id
|
477
|
+
rs.draw do |map|
|
478
|
+
map.post 'post/:id', :controller=> 'post', :action=> 'show', :requirements => {:id => /\d+/}
|
479
|
+
end
|
480
|
+
|
481
|
+
assert_equal '/post/10', rs.generate(:controller => 'post', :action => 'show', :id => 10)
|
482
|
+
|
483
|
+
assert_raises ActionController::RoutingError do
|
484
|
+
rs.generate(:controller => 'post', :action => 'show')
|
485
|
+
end
|
486
|
+
end
|
487
|
+
|
488
|
+
def test_both_requirement_and_optional
|
489
|
+
rs.draw do |map|
|
490
|
+
map.blog('test/:year', :controller => 'post', :action => 'show',
|
491
|
+
:defaults => { :year => nil },
|
492
|
+
:requirements => { :year => /\d{4}/ }
|
493
|
+
)
|
494
|
+
map.connect ':controller/:action/:id'
|
495
|
+
end
|
496
|
+
|
497
|
+
assert_equal '/test', rs.generate(:controller => 'post', :action => 'show')
|
498
|
+
assert_equal '/test', rs.generate(:controller => 'post', :action => 'show', :year => nil)
|
499
|
+
|
500
|
+
x = setup_for_named_route
|
501
|
+
assert_equal("http://named.route.test/test",
|
502
|
+
x.send(:blog_url))
|
503
|
+
end
|
504
|
+
|
505
|
+
def test_set_to_nil_forgets
|
506
|
+
rs.draw do |map|
|
507
|
+
map.connect 'pages/:year/:month/:day', :controller => 'content', :action => 'list_pages', :month => nil, :day => nil
|
508
|
+
map.connect ':controller/:action/:id'
|
509
|
+
end
|
510
|
+
|
511
|
+
assert_equal '/pages/2005',
|
512
|
+
rs.generate(:controller => 'content', :action => 'list_pages', :year => 2005)
|
513
|
+
assert_equal '/pages/2005/6',
|
514
|
+
rs.generate(:controller => 'content', :action => 'list_pages', :year => 2005, :month => 6)
|
515
|
+
assert_equal '/pages/2005/6/12',
|
516
|
+
rs.generate(:controller => 'content', :action => 'list_pages', :year => 2005, :month => 6, :day => 12)
|
517
|
+
|
518
|
+
assert_equal '/pages/2005/6/4',
|
519
|
+
rs.generate({:day => 4}, {:controller => 'content', :action => 'list_pages', :year => '2005', :month => '6', :day => '12'})
|
520
|
+
|
521
|
+
assert_equal '/pages/2005/6',
|
522
|
+
rs.generate({:day => nil}, {:controller => 'content', :action => 'list_pages', :year => '2005', :month => '6', :day => '12'})
|
523
|
+
|
524
|
+
assert_equal '/pages/2005',
|
525
|
+
rs.generate({:day => nil, :month => nil}, {:controller => 'content', :action => 'list_pages', :year => '2005', :month => '6', :day => '12'})
|
526
|
+
end
|
527
|
+
|
528
|
+
def test_url_with_no_action_specified
|
529
|
+
rs.draw do |map|
|
530
|
+
map.connect '', :controller => 'content'
|
531
|
+
map.connect ':controller/:action/:id'
|
532
|
+
end
|
533
|
+
|
534
|
+
assert_equal '/', rs.generate(:controller => 'content', :action => 'index')
|
535
|
+
assert_equal '/', rs.generate(:controller => 'content')
|
536
|
+
end
|
537
|
+
|
538
|
+
def test_named_url_with_no_action_specified
|
539
|
+
rs.draw do |map|
|
540
|
+
map.home '', :controller => 'content'
|
541
|
+
map.connect ':controller/:action/:id'
|
542
|
+
end
|
543
|
+
|
544
|
+
assert_equal '/', rs.generate(:controller => 'content', :action => 'index')
|
545
|
+
assert_equal '/', rs.generate(:controller => 'content')
|
546
|
+
|
547
|
+
x = setup_for_named_route
|
548
|
+
assert_equal("http://named.route.test/",
|
549
|
+
x.send(:home_url))
|
550
|
+
end
|
551
|
+
|
552
|
+
def test_url_generated_when_forgetting_action
|
553
|
+
[{:controller => 'content', :action => 'index'}, {:controller => 'content'}].each do |hash|
|
554
|
+
rs.draw do |map|
|
555
|
+
map.home '', hash
|
556
|
+
map.connect ':controller/:action/:id'
|
557
|
+
end
|
558
|
+
assert_equal '/', rs.generate({:action => nil}, {:controller => 'content', :action => 'hello'})
|
559
|
+
assert_equal '/', rs.generate({:controller => 'content'})
|
560
|
+
assert_equal '/content/hi', rs.generate({:controller => 'content', :action => 'hi'})
|
561
|
+
end
|
562
|
+
end
|
563
|
+
|
564
|
+
def test_named_route_method
|
565
|
+
rs.draw do |map|
|
566
|
+
map.categories 'categories', :controller => 'content', :action => 'categories'
|
567
|
+
map.connect ':controller/:action/:id'
|
568
|
+
end
|
569
|
+
|
570
|
+
assert_equal '/categories', rs.generate(:controller => 'content', :action => 'categories')
|
571
|
+
assert_equal '/content/hi', rs.generate({:controller => 'content', :action => 'hi'})
|
572
|
+
end
|
573
|
+
|
574
|
+
def test_named_routes_array
|
575
|
+
test_named_route_method
|
576
|
+
assert_equal [:categories], rs.named_routes.names
|
577
|
+
end
|
578
|
+
|
579
|
+
def test_nil_defaults
|
580
|
+
rs.draw do |map|
|
581
|
+
map.connect 'journal',
|
582
|
+
:controller => 'content',
|
583
|
+
:action => 'list_journal',
|
584
|
+
:date => nil, :user_id => nil
|
585
|
+
map.connect ':controller/:action/:id'
|
586
|
+
end
|
587
|
+
|
588
|
+
assert_equal '/journal', rs.generate(:controller => 'content', :action => 'list_journal', :date => nil, :user_id => nil)
|
589
|
+
end
|
590
|
+
|
591
|
+
def setup_request_method_routes_for(method)
|
592
|
+
@request = ActionController::TestRequest.new
|
593
|
+
@request.env["REQUEST_METHOD"] = method
|
594
|
+
@request.request_uri = "/match"
|
595
|
+
|
596
|
+
rs.draw do |r|
|
597
|
+
r.connect '/match', :controller => 'books', :action => 'get', :conditions => { :method => :get }
|
598
|
+
r.connect '/match', :controller => 'books', :action => 'post', :conditions => { :method => :post }
|
599
|
+
r.connect '/match', :controller => 'books', :action => 'put', :conditions => { :method => :put }
|
600
|
+
r.connect '/match', :controller => 'books', :action => 'delete', :conditions => { :method => :delete }
|
601
|
+
end
|
602
|
+
end
|
603
|
+
|
604
|
+
%w(GET POST PUT DELETE).each do |request_method|
|
605
|
+
define_method("test_request_method_recognized_with_#{request_method}") do
|
606
|
+
begin
|
607
|
+
Object.const_set(:BooksController, Class.new(ActionController::Base))
|
608
|
+
|
609
|
+
setup_request_method_routes_for(request_method)
|
610
|
+
|
611
|
+
assert_nothing_raised { rs.recognize(@request) }
|
612
|
+
assert_equal request_method.downcase, @request.path_parameters[:action]
|
613
|
+
ensure
|
614
|
+
Object.send(:remove_const, :BooksController) rescue nil
|
615
|
+
end
|
616
|
+
end
|
617
|
+
end
|
618
|
+
|
619
|
+
def test_subpath_recognized
|
620
|
+
Object.const_set(:SubpathBooksController, Class.new(ActionController::Base))
|
621
|
+
|
622
|
+
rs.draw do |r|
|
623
|
+
r.connect '/books/:id/edit', :controller => 'subpath_books', :action => 'edit'
|
624
|
+
r.connect '/items/:id/:action', :controller => 'subpath_books'
|
625
|
+
r.connect '/posts/new/:action', :controller => 'subpath_books'
|
626
|
+
r.connect '/posts/:id', :controller => 'subpath_books', :action => "show"
|
627
|
+
end
|
628
|
+
|
629
|
+
hash = rs.recognize_path "/books/17/edit"
|
630
|
+
assert_not_nil hash
|
631
|
+
assert_equal %w(subpath_books 17 edit), [hash[:controller], hash[:id], hash[:action]]
|
632
|
+
|
633
|
+
hash = rs.recognize_path "/items/3/complete"
|
634
|
+
assert_not_nil hash
|
635
|
+
assert_equal %w(subpath_books 3 complete), [hash[:controller], hash[:id], hash[:action]]
|
636
|
+
|
637
|
+
hash = rs.recognize_path "/posts/new/preview"
|
638
|
+
assert_not_nil hash
|
639
|
+
assert_equal %w(subpath_books preview), [hash[:controller], hash[:action]]
|
640
|
+
|
641
|
+
hash = rs.recognize_path "/posts/7"
|
642
|
+
assert_not_nil hash
|
643
|
+
assert_equal %w(subpath_books show 7), [hash[:controller], hash[:action], hash[:id]]
|
644
|
+
ensure
|
645
|
+
Object.send(:remove_const, :SubpathBooksController) rescue nil
|
646
|
+
end
|
647
|
+
|
648
|
+
def test_subpath_generated
|
649
|
+
Object.const_set(:SubpathBooksController, Class.new(ActionController::Base))
|
650
|
+
|
651
|
+
rs.draw do |r|
|
652
|
+
r.connect '/books/:id/edit', :controller => 'subpath_books', :action => 'edit'
|
653
|
+
r.connect '/items/:id/:action', :controller => 'subpath_books'
|
654
|
+
r.connect '/posts/new/:action', :controller => 'subpath_books'
|
655
|
+
end
|
656
|
+
|
657
|
+
assert_equal "/books/7/edit", rs.generate(:controller => "subpath_books", :id => 7, :action => "edit")
|
658
|
+
assert_equal "/items/15/complete", rs.generate(:controller => "subpath_books", :id => 15, :action => "complete")
|
659
|
+
assert_equal "/posts/new/preview", rs.generate(:controller => "subpath_books", :action => "preview")
|
660
|
+
ensure
|
661
|
+
Object.send(:remove_const, :SubpathBooksController) rescue nil
|
662
|
+
end
|
663
|
+
|
664
|
+
def test_failed_requirements_raises_exception_with_violated_requirements
|
665
|
+
rs.draw do |r|
|
666
|
+
r.foo_with_requirement 'foos/:id', :controller=>'foos', :requirements=>{:id=>/\d+/}
|
667
|
+
end
|
668
|
+
|
669
|
+
x = setup_for_named_route
|
670
|
+
assert_raises(ActionController::RoutingError) do
|
671
|
+
x.send(:foo_with_requirement_url, "I am Against the requirements")
|
672
|
+
end
|
673
|
+
end
|
674
|
+
end
|
675
|
+
|
676
|
+
class SegmentTest < Test::Unit::TestCase
|
677
|
+
|
678
|
+
def test_first_segment_should_interpolate_for_structure
|
679
|
+
s = ROUTING::Segment.new
|
680
|
+
def s.interpolation_statement(array) 'hello' end
|
681
|
+
assert_equal 'hello', s.continue_string_structure([])
|
682
|
+
end
|
683
|
+
|
684
|
+
def test_interpolation_statement
|
685
|
+
s = ROUTING::StaticSegment.new
|
686
|
+
s.value = "Hello"
|
687
|
+
assert_equal "Hello", eval(s.interpolation_statement([]))
|
688
|
+
assert_equal "HelloHello", eval(s.interpolation_statement([s]))
|
689
|
+
|
690
|
+
s2 = ROUTING::StaticSegment.new
|
691
|
+
s2.value = "-"
|
692
|
+
assert_equal "Hello-Hello", eval(s.interpolation_statement([s, s2]))
|
693
|
+
|
694
|
+
s3 = ROUTING::StaticSegment.new
|
695
|
+
s3.value = "World"
|
696
|
+
assert_equal "Hello-World", eval(s3.interpolation_statement([s, s2]))
|
697
|
+
end
|
698
|
+
|
699
|
+
end
|
700
|
+
|
701
|
+
class StaticSegmentTest < Test::Unit::TestCase
|
702
|
+
|
703
|
+
def test_interpolation_chunk_should_respect_raw
|
704
|
+
s = ROUTING::StaticSegment.new
|
705
|
+
s.value = 'Hello World'
|
706
|
+
assert ! s.raw?
|
707
|
+
assert_equal 'Hello%20World', s.interpolation_chunk
|
708
|
+
|
709
|
+
s.raw = true
|
710
|
+
assert s.raw?
|
711
|
+
assert_equal 'Hello World', s.interpolation_chunk
|
712
|
+
end
|
713
|
+
|
714
|
+
def test_regexp_chunk_should_escape_specials
|
715
|
+
s = ROUTING::StaticSegment.new
|
716
|
+
|
717
|
+
s.value = 'Hello*World'
|
718
|
+
assert_equal 'Hello\*World', s.regexp_chunk
|
719
|
+
|
720
|
+
s.value = 'HelloWorld'
|
721
|
+
assert_equal 'HelloWorld', s.regexp_chunk
|
722
|
+
end
|
723
|
+
|
724
|
+
def test_regexp_chunk_should_add_question_mark_for_optionals
|
725
|
+
s = ROUTING::StaticSegment.new
|
726
|
+
s.value = "/"
|
727
|
+
s.is_optional = true
|
728
|
+
assert_equal "/?", s.regexp_chunk
|
729
|
+
|
730
|
+
s.value = "hello"
|
731
|
+
assert_equal "(?:hello)?", s.regexp_chunk
|
732
|
+
end
|
733
|
+
|
734
|
+
end
|
735
|
+
|
736
|
+
class DynamicSegmentTest < Test::Unit::TestCase
|
737
|
+
|
738
|
+
def segment
|
739
|
+
unless @segment
|
740
|
+
@segment = ROUTING::DynamicSegment.new
|
741
|
+
@segment.key = :a
|
742
|
+
end
|
743
|
+
@segment
|
744
|
+
end
|
745
|
+
|
746
|
+
def test_extract_value
|
747
|
+
s = ROUTING::DynamicSegment.new
|
748
|
+
s.key = :a
|
749
|
+
|
750
|
+
hash = {:a => '10', :b => '20'}
|
751
|
+
assert_equal '10', eval(s.extract_value)
|
752
|
+
|
753
|
+
hash = {:b => '20'}
|
754
|
+
assert_equal nil, eval(s.extract_value)
|
755
|
+
|
756
|
+
s.default = '20'
|
757
|
+
assert_equal '20', eval(s.extract_value)
|
758
|
+
end
|
759
|
+
|
760
|
+
def test_default_local_name
|
761
|
+
assert_equal 'a_value', segment.local_name,
|
762
|
+
"Unexpected name -- all value_check tests will fail!"
|
763
|
+
end
|
764
|
+
|
765
|
+
def test_presence_value_check
|
766
|
+
a_value = 10
|
767
|
+
assert eval(segment.value_check)
|
768
|
+
end
|
769
|
+
|
770
|
+
def test_regexp_value_check_rejects_nil
|
771
|
+
segment.regexp = /\d+/
|
772
|
+
a_value = nil
|
773
|
+
assert ! eval(segment.value_check)
|
774
|
+
end
|
775
|
+
|
776
|
+
def test_optional_regexp_value_check_should_accept_nil
|
777
|
+
segment.regexp = /\d+/
|
778
|
+
segment.is_optional = true
|
779
|
+
a_value = nil
|
780
|
+
assert eval(segment.value_check)
|
781
|
+
end
|
782
|
+
|
783
|
+
def test_regexp_value_check_rejects_no_match
|
784
|
+
segment.regexp = /\d+/
|
785
|
+
|
786
|
+
a_value = "Hello20World"
|
787
|
+
assert ! eval(segment.value_check)
|
788
|
+
|
789
|
+
a_value = "20Hi"
|
790
|
+
assert ! eval(segment.value_check)
|
791
|
+
end
|
792
|
+
|
793
|
+
def test_regexp_value_check_accepts_match
|
794
|
+
segment.regexp = /\d+/
|
795
|
+
|
796
|
+
a_value = "30"
|
797
|
+
assert eval(segment.value_check)
|
798
|
+
end
|
799
|
+
|
800
|
+
def test_value_check_fails_on_nil
|
801
|
+
a_value = nil
|
802
|
+
assert ! eval(segment.value_check)
|
803
|
+
end
|
804
|
+
|
805
|
+
def test_optional_value_needs_no_check
|
806
|
+
segment.is_optional = true
|
807
|
+
a_value = nil
|
808
|
+
assert_equal nil, segment.value_check
|
809
|
+
end
|
810
|
+
|
811
|
+
def test_regexp_value_check_should_accept_match_with_default
|
812
|
+
segment.regexp = /\d+/
|
813
|
+
segment.default = '200'
|
814
|
+
|
815
|
+
a_value = '100'
|
816
|
+
assert eval(segment.value_check)
|
817
|
+
end
|
818
|
+
|
819
|
+
def test_expiry_should_not_trigger_once_expired
|
820
|
+
expired = true
|
821
|
+
hash = merged = {:a => 2, :b => 3}
|
822
|
+
options = {:b => 3}
|
823
|
+
expire_on = Hash.new { raise 'No!!!' }
|
824
|
+
|
825
|
+
eval(segment.expiry_statement)
|
826
|
+
rescue RuntimeError
|
827
|
+
flunk "Expiry check should not have occurred!"
|
828
|
+
end
|
829
|
+
|
830
|
+
def test_expiry_should_occur_according_to_expire_on
|
831
|
+
expired = false
|
832
|
+
hash = merged = {:a => 2, :b => 3}
|
833
|
+
options = {:b => 3}
|
834
|
+
|
835
|
+
expire_on = {:b => true, :a => false}
|
836
|
+
eval(segment.expiry_statement)
|
837
|
+
assert !expired
|
838
|
+
assert_equal({:a => 2, :b => 3}, hash)
|
839
|
+
|
840
|
+
expire_on = {:b => true, :a => true}
|
841
|
+
eval(segment.expiry_statement)
|
842
|
+
assert expired
|
843
|
+
assert_equal({:b => 3}, hash)
|
844
|
+
end
|
845
|
+
|
846
|
+
def test_extraction_code_should_return_on_nil
|
847
|
+
hash = merged = {:b => 3}
|
848
|
+
options = {:b => 3}
|
849
|
+
a_value = nil
|
850
|
+
|
851
|
+
# Local jump because of return inside eval.
|
852
|
+
assert_raises(LocalJumpError) { eval(segment.extraction_code) }
|
853
|
+
end
|
854
|
+
|
855
|
+
def test_extraction_code_should_return_on_mismatch
|
856
|
+
segment.regexp = /\d+/
|
857
|
+
hash = merged = {:a => 'Hi', :b => '3'}
|
858
|
+
options = {:b => '3'}
|
859
|
+
a_value = nil
|
860
|
+
|
861
|
+
# Local jump because of return inside eval.
|
862
|
+
assert_raises(LocalJumpError) { eval(segment.extraction_code) }
|
863
|
+
end
|
864
|
+
|
865
|
+
def test_extraction_code_should_accept_value_and_set_local
|
866
|
+
hash = merged = {:a => 'Hi', :b => '3'}
|
867
|
+
options = {:b => '3'}
|
868
|
+
a_value = nil
|
869
|
+
expired = true
|
870
|
+
|
871
|
+
eval(segment.extraction_code)
|
872
|
+
assert_equal 'Hi', a_value
|
873
|
+
end
|
874
|
+
|
875
|
+
def test_extraction_should_work_without_value_check
|
876
|
+
segment.default = 'hi'
|
877
|
+
hash = merged = {:b => '3'}
|
878
|
+
options = {:b => '3'}
|
879
|
+
a_value = nil
|
880
|
+
expired = true
|
881
|
+
|
882
|
+
eval(segment.extraction_code)
|
883
|
+
assert_equal 'hi', a_value
|
884
|
+
end
|
885
|
+
|
886
|
+
def test_extraction_code_should_perform_expiry
|
887
|
+
expired = false
|
888
|
+
hash = merged = {:a => 'Hi', :b => '3'}
|
889
|
+
options = {:b => '3'}
|
890
|
+
expire_on = {:a => true}
|
891
|
+
a_value = nil
|
892
|
+
|
893
|
+
eval(segment.extraction_code)
|
894
|
+
assert_equal 'Hi', a_value
|
895
|
+
assert expired
|
896
|
+
assert_equal options, hash
|
897
|
+
end
|
898
|
+
|
899
|
+
def test_interpolation_chunk_should_replace_value
|
900
|
+
a_value = 'Hi'
|
901
|
+
assert_equal a_value, eval(%("#{segment.interpolation_chunk}"))
|
902
|
+
end
|
903
|
+
|
904
|
+
def test_interpolation_chunk_should_accept_nil
|
905
|
+
a_value = nil
|
906
|
+
assert_equal '', eval(%("#{segment.interpolation_chunk('a_value')}"))
|
907
|
+
end
|
908
|
+
|
909
|
+
def test_value_regexp_should_be_nil_without_regexp
|
910
|
+
assert_equal nil, segment.value_regexp
|
911
|
+
end
|
912
|
+
|
913
|
+
def test_value_regexp_should_match_exacly
|
914
|
+
segment.regexp = /\d+/
|
915
|
+
assert_no_match segment.value_regexp, "Hello 10 World"
|
916
|
+
assert_no_match segment.value_regexp, "Hello 10"
|
917
|
+
assert_no_match segment.value_regexp, "10 World"
|
918
|
+
assert_match segment.value_regexp, "10"
|
919
|
+
end
|
920
|
+
|
921
|
+
def test_regexp_chunk_should_return_string
|
922
|
+
segment.regexp = /\d+/
|
923
|
+
assert_kind_of String, segment.regexp_chunk
|
924
|
+
end
|
925
|
+
|
926
|
+
def test_build_pattern_non_optional_with_no_captures
|
927
|
+
# Non optional
|
928
|
+
a_segment = ROUTING::DynamicSegment.new
|
929
|
+
a_segment.regexp = /\d+/ #number_of_captures is 0
|
930
|
+
assert_equal "(\\d+)stuff", a_segment.build_pattern('stuff')
|
931
|
+
end
|
932
|
+
|
933
|
+
def test_build_pattern_non_optional_with_captures
|
934
|
+
# Non optional
|
935
|
+
a_segment = ROUTING::DynamicSegment.new
|
936
|
+
a_segment.regexp = /(\d+)(.*?)/ #number_of_captures is 2
|
937
|
+
assert_equal "((\\d+)(.*?))stuff", a_segment.build_pattern('stuff')
|
938
|
+
end
|
939
|
+
|
940
|
+
def test_optionality_implied
|
941
|
+
a_segment = ROUTING::DynamicSegment.new
|
942
|
+
a_segment.key = :id
|
943
|
+
assert a_segment.optionality_implied?
|
944
|
+
|
945
|
+
a_segment.key = :action
|
946
|
+
assert a_segment.optionality_implied?
|
947
|
+
end
|
948
|
+
|
949
|
+
def test_modifiers_must_be_handled_sensibly
|
950
|
+
a_segment = ROUTING::DynamicSegment.new
|
951
|
+
a_segment.regexp = /david|jamis/i
|
952
|
+
assert_equal "((?i-mx:david|jamis))stuff", a_segment.build_pattern('stuff')
|
953
|
+
a_segment.regexp = /david|jamis/x
|
954
|
+
assert_equal "((?x-mi:david|jamis))stuff", a_segment.build_pattern('stuff')
|
955
|
+
a_segment.regexp = /david|jamis/
|
956
|
+
assert_equal "(david|jamis)stuff", a_segment.build_pattern('stuff')
|
957
|
+
end
|
958
|
+
end
|
959
|
+
|
960
|
+
class ControllerSegmentTest < Test::Unit::TestCase
|
961
|
+
|
962
|
+
def test_regexp_should_only_match_possible_controllers
|
963
|
+
ActionController::Routing.with_controllers %w(admin/accounts admin/users account pages) do
|
964
|
+
cs = ROUTING::ControllerSegment.new :controller
|
965
|
+
regexp = %r{\A#{cs.regexp_chunk}\Z}
|
966
|
+
|
967
|
+
ActionController::Routing.possible_controllers.each do |name|
|
968
|
+
assert_match regexp, name
|
969
|
+
assert_no_match regexp, "#{name}_fake"
|
970
|
+
|
971
|
+
match = regexp.match name
|
972
|
+
assert_equal name, match[1]
|
973
|
+
end
|
974
|
+
end
|
975
|
+
end
|
976
|
+
|
977
|
+
end
|
978
|
+
|
979
|
+
uses_mocha 'RouteTest' do
|
980
|
+
|
981
|
+
class MockController
|
982
|
+
attr_accessor :routes
|
983
|
+
|
984
|
+
def initialize(routes)
|
985
|
+
self.routes = routes
|
986
|
+
end
|
987
|
+
|
988
|
+
def url_for(options)
|
989
|
+
only_path = options.delete(:only_path)
|
990
|
+
|
991
|
+
port = options.delete(:port) || 80
|
992
|
+
port_string = port == 80 ? '' : ":#{port}"
|
993
|
+
|
994
|
+
host = options.delete(:host) || "named.route.test"
|
995
|
+
anchor = "##{options.delete(:anchor)}" if options.key?(:anchor)
|
996
|
+
|
997
|
+
path = routes.generate(options)
|
998
|
+
|
999
|
+
only_path ? "#{path}#{anchor}" : "http://#{host}#{port_string}#{path}#{anchor}"
|
1000
|
+
end
|
1001
|
+
|
1002
|
+
def request
|
1003
|
+
@request ||= MockRequest.new(:host => "named.route.test", :method => :get)
|
1004
|
+
end
|
1005
|
+
|
1006
|
+
def relative_url_root=(value)
|
1007
|
+
request.relative_url_root=value
|
1008
|
+
end
|
1009
|
+
end
|
1010
|
+
|
1011
|
+
class MockRequest
|
1012
|
+
attr_accessor :path, :path_parameters, :host, :subdomains, :domain,
|
1013
|
+
:method, :relative_url_root
|
1014
|
+
|
1015
|
+
def initialize(values={})
|
1016
|
+
values.each { |key, value| send("#{key}=", value) }
|
1017
|
+
if values[:host]
|
1018
|
+
subdomain, self.domain = values[:host].split(/\./, 2)
|
1019
|
+
self.subdomains = [subdomain]
|
1020
|
+
end
|
1021
|
+
end
|
1022
|
+
|
1023
|
+
def protocol
|
1024
|
+
"http://"
|
1025
|
+
end
|
1026
|
+
|
1027
|
+
def host_with_port
|
1028
|
+
(subdomains * '.') + '.' + domain
|
1029
|
+
end
|
1030
|
+
end
|
1031
|
+
|
1032
|
+
class RouteTest < Test::Unit::TestCase
|
1033
|
+
|
1034
|
+
def setup
|
1035
|
+
@route = ROUTING::Route.new
|
1036
|
+
end
|
1037
|
+
|
1038
|
+
def slash_segment(is_optional = false)
|
1039
|
+
returning ROUTING::DividerSegment.new('/') do |s|
|
1040
|
+
s.is_optional = is_optional
|
1041
|
+
end
|
1042
|
+
end
|
1043
|
+
|
1044
|
+
def default_route
|
1045
|
+
unless defined?(@default_route)
|
1046
|
+
@default_route = ROUTING::Route.new
|
1047
|
+
|
1048
|
+
@default_route.segments << (s = ROUTING::StaticSegment.new)
|
1049
|
+
s.value = '/'
|
1050
|
+
s.raw = true
|
1051
|
+
|
1052
|
+
@default_route.segments << (s = ROUTING::DynamicSegment.new)
|
1053
|
+
s.key = :controller
|
1054
|
+
|
1055
|
+
@default_route.segments << slash_segment(:optional)
|
1056
|
+
@default_route.segments << (s = ROUTING::DynamicSegment.new)
|
1057
|
+
s.key = :action
|
1058
|
+
s.default = 'index'
|
1059
|
+
s.is_optional = true
|
1060
|
+
|
1061
|
+
@default_route.segments << slash_segment(:optional)
|
1062
|
+
@default_route.segments << (s = ROUTING::DynamicSegment.new)
|
1063
|
+
s.key = :id
|
1064
|
+
s.is_optional = true
|
1065
|
+
|
1066
|
+
@default_route.segments << slash_segment(:optional)
|
1067
|
+
end
|
1068
|
+
@default_route
|
1069
|
+
end
|
1070
|
+
|
1071
|
+
def test_default_route_recognition
|
1072
|
+
expected = {:controller => 'accounts', :action => 'show', :id => '10'}
|
1073
|
+
assert_equal expected, default_route.recognize('/accounts/show/10')
|
1074
|
+
assert_equal expected, default_route.recognize('/accounts/show/10/')
|
1075
|
+
|
1076
|
+
expected[:id] = 'jamis'
|
1077
|
+
assert_equal expected, default_route.recognize('/accounts/show/jamis/')
|
1078
|
+
|
1079
|
+
expected.delete :id
|
1080
|
+
assert_equal expected, default_route.recognize('/accounts/show')
|
1081
|
+
assert_equal expected, default_route.recognize('/accounts/show/')
|
1082
|
+
|
1083
|
+
expected[:action] = 'index'
|
1084
|
+
assert_equal expected, default_route.recognize('/accounts/')
|
1085
|
+
assert_equal expected, default_route.recognize('/accounts')
|
1086
|
+
|
1087
|
+
assert_equal nil, default_route.recognize('/')
|
1088
|
+
assert_equal nil, default_route.recognize('/accounts/how/goood/it/is/to/be/free')
|
1089
|
+
end
|
1090
|
+
|
1091
|
+
def test_default_route_should_omit_default_action
|
1092
|
+
o = {:controller => 'accounts', :action => 'index'}
|
1093
|
+
assert_equal '/accounts', default_route.generate(o, o, {})
|
1094
|
+
end
|
1095
|
+
|
1096
|
+
def test_default_route_should_include_default_action_when_id_present
|
1097
|
+
o = {:controller => 'accounts', :action => 'index', :id => '20'}
|
1098
|
+
assert_equal '/accounts/index/20', default_route.generate(o, o, {})
|
1099
|
+
end
|
1100
|
+
|
1101
|
+
def test_default_route_should_work_with_action_but_no_id
|
1102
|
+
o = {:controller => 'accounts', :action => 'list_all'}
|
1103
|
+
assert_equal '/accounts/list_all', default_route.generate(o, o, {})
|
1104
|
+
end
|
1105
|
+
|
1106
|
+
def test_default_route_should_uri_escape_pluses
|
1107
|
+
expected = { :controller => 'accounts', :action => 'show', :id => 'hello world' }
|
1108
|
+
assert_equal expected, default_route.recognize('/accounts/show/hello world')
|
1109
|
+
assert_equal expected, default_route.recognize('/accounts/show/hello%20world')
|
1110
|
+
assert_equal '/accounts/show/hello%20world', default_route.generate(expected, expected, {})
|
1111
|
+
|
1112
|
+
expected[:id] = 'hello+world'
|
1113
|
+
assert_equal expected, default_route.recognize('/accounts/show/hello+world')
|
1114
|
+
assert_equal expected, default_route.recognize('/accounts/show/hello%2Bworld')
|
1115
|
+
assert_equal '/accounts/show/hello+world', default_route.generate(expected, expected, {})
|
1116
|
+
end
|
1117
|
+
|
1118
|
+
def test_matches_controller_and_action
|
1119
|
+
# requirement_for should only be called for the action and controller _once_
|
1120
|
+
@route.expects(:requirement_for).with(:controller).times(1).returns('pages')
|
1121
|
+
@route.expects(:requirement_for).with(:action).times(1).returns('show')
|
1122
|
+
|
1123
|
+
@route.requirements = {:controller => 'pages', :action => 'show'}
|
1124
|
+
assert @route.matches_controller_and_action?('pages', 'show')
|
1125
|
+
assert !@route.matches_controller_and_action?('not_pages', 'show')
|
1126
|
+
assert !@route.matches_controller_and_action?('pages', 'not_show')
|
1127
|
+
end
|
1128
|
+
|
1129
|
+
def test_parameter_shell
|
1130
|
+
page_url = ROUTING::Route.new
|
1131
|
+
page_url.requirements = {:controller => 'pages', :action => 'show', :id => /\d+/}
|
1132
|
+
assert_equal({:controller => 'pages', :action => 'show'}, page_url.parameter_shell)
|
1133
|
+
end
|
1134
|
+
|
1135
|
+
def test_defaults
|
1136
|
+
route = ROUTING::RouteBuilder.new.build '/users/:id.:format', :controller => "users", :action => "show", :format => "html"
|
1137
|
+
assert_equal(
|
1138
|
+
{ :controller => "users", :action => "show", :format => "html" },
|
1139
|
+
route.defaults)
|
1140
|
+
end
|
1141
|
+
|
1142
|
+
def test_builder_complains_without_controller
|
1143
|
+
assert_raises(ArgumentError) do
|
1144
|
+
ROUTING::RouteBuilder.new.build '/contact', :contoller => "contact", :action => "index"
|
1145
|
+
end
|
1146
|
+
end
|
1147
|
+
|
1148
|
+
def test_significant_keys_for_default_route
|
1149
|
+
keys = default_route.significant_keys.sort_by {|k| k.to_s }
|
1150
|
+
assert_equal [:action, :controller, :id], keys
|
1151
|
+
end
|
1152
|
+
|
1153
|
+
def test_significant_keys
|
1154
|
+
user_url = ROUTING::Route.new
|
1155
|
+
user_url.segments << (s = ROUTING::StaticSegment.new)
|
1156
|
+
s.value = '/'
|
1157
|
+
s.raw = true
|
1158
|
+
|
1159
|
+
user_url.segments << (s = ROUTING::StaticSegment.new)
|
1160
|
+
s.value = 'user'
|
1161
|
+
|
1162
|
+
user_url.segments << (s = ROUTING::StaticSegment.new)
|
1163
|
+
s.value = '/'
|
1164
|
+
s.raw = true
|
1165
|
+
s.is_optional = true
|
1166
|
+
|
1167
|
+
user_url.segments << (s = ROUTING::DynamicSegment.new)
|
1168
|
+
s.key = :user
|
1169
|
+
|
1170
|
+
user_url.segments << (s = ROUTING::StaticSegment.new)
|
1171
|
+
s.value = '/'
|
1172
|
+
s.raw = true
|
1173
|
+
s.is_optional = true
|
1174
|
+
|
1175
|
+
user_url.requirements = {:controller => 'users', :action => 'show'}
|
1176
|
+
|
1177
|
+
keys = user_url.significant_keys.sort_by { |k| k.to_s }
|
1178
|
+
assert_equal [:action, :controller, :user], keys
|
1179
|
+
end
|
1180
|
+
|
1181
|
+
def test_build_empty_query_string
|
1182
|
+
assert_equal '', @route.build_query_string({})
|
1183
|
+
end
|
1184
|
+
|
1185
|
+
def test_build_query_string_with_nil_value
|
1186
|
+
assert_equal '', @route.build_query_string({:x => nil})
|
1187
|
+
end
|
1188
|
+
|
1189
|
+
def test_simple_build_query_string
|
1190
|
+
assert_equal '?x=1&y=2', order_query_string(@route.build_query_string(:x => '1', :y => '2'))
|
1191
|
+
end
|
1192
|
+
|
1193
|
+
def test_convert_ints_build_query_string
|
1194
|
+
assert_equal '?x=1&y=2', order_query_string(@route.build_query_string(:x => 1, :y => 2))
|
1195
|
+
end
|
1196
|
+
|
1197
|
+
def test_escape_spaces_build_query_string
|
1198
|
+
assert_equal '?x=hello+world&y=goodbye+world', order_query_string(@route.build_query_string(:x => 'hello world', :y => 'goodbye world'))
|
1199
|
+
end
|
1200
|
+
|
1201
|
+
def test_expand_array_build_query_string
|
1202
|
+
assert_equal '?x%5B%5D=1&x%5B%5D=2', order_query_string(@route.build_query_string(:x => [1, 2]))
|
1203
|
+
end
|
1204
|
+
|
1205
|
+
def test_escape_spaces_build_query_string_selected_keys
|
1206
|
+
assert_equal '?x=hello+world', order_query_string(@route.build_query_string({:x => 'hello world', :y => 'goodbye world'}, [:x]))
|
1207
|
+
end
|
1208
|
+
|
1209
|
+
private
|
1210
|
+
def order_query_string(qs)
|
1211
|
+
'?' + qs[1..-1].split('&').sort.join('&')
|
1212
|
+
end
|
1213
|
+
end
|
1214
|
+
|
1215
|
+
end # uses_mocha
|
1216
|
+
|
1217
|
+
class RouteBuilderTest < Test::Unit::TestCase
|
1218
|
+
|
1219
|
+
def builder
|
1220
|
+
@builder ||= ROUTING::RouteBuilder.new
|
1221
|
+
end
|
1222
|
+
|
1223
|
+
def build(path, options)
|
1224
|
+
builder.build(path, options)
|
1225
|
+
end
|
1226
|
+
|
1227
|
+
def test_options_should_not_be_modified
|
1228
|
+
requirements1 = { :id => /\w+/, :controller => /(?:[a-z](?:-?[a-z]+)*)/ }
|
1229
|
+
requirements2 = requirements1.dup
|
1230
|
+
|
1231
|
+
assert_equal requirements1, requirements2
|
1232
|
+
|
1233
|
+
with_options(:controller => 'folder',
|
1234
|
+
:requirements => requirements2) do |m|
|
1235
|
+
m.build 'folders/new', :action => 'new'
|
1236
|
+
end
|
1237
|
+
|
1238
|
+
assert_equal requirements1, requirements2
|
1239
|
+
end
|
1240
|
+
|
1241
|
+
def test_segment_for_static
|
1242
|
+
segment, rest = builder.segment_for 'ulysses'
|
1243
|
+
assert_equal '', rest
|
1244
|
+
assert_kind_of ROUTING::StaticSegment, segment
|
1245
|
+
assert_equal 'ulysses', segment.value
|
1246
|
+
end
|
1247
|
+
|
1248
|
+
def test_segment_for_action
|
1249
|
+
segment, rest = builder.segment_for ':action'
|
1250
|
+
assert_equal '', rest
|
1251
|
+
assert_kind_of ROUTING::DynamicSegment, segment
|
1252
|
+
assert_equal :action, segment.key
|
1253
|
+
assert_equal 'index', segment.default
|
1254
|
+
end
|
1255
|
+
|
1256
|
+
def test_segment_for_dynamic
|
1257
|
+
segment, rest = builder.segment_for ':login'
|
1258
|
+
assert_equal '', rest
|
1259
|
+
assert_kind_of ROUTING::DynamicSegment, segment
|
1260
|
+
assert_equal :login, segment.key
|
1261
|
+
assert_equal nil, segment.default
|
1262
|
+
assert ! segment.optional?
|
1263
|
+
end
|
1264
|
+
|
1265
|
+
def test_segment_for_with_rest
|
1266
|
+
segment, rest = builder.segment_for ':login/:action'
|
1267
|
+
assert_equal :login, segment.key
|
1268
|
+
assert_equal '/:action', rest
|
1269
|
+
segment, rest = builder.segment_for rest
|
1270
|
+
assert_equal '/', segment.value
|
1271
|
+
assert_equal ':action', rest
|
1272
|
+
segment, rest = builder.segment_for rest
|
1273
|
+
assert_equal :action, segment.key
|
1274
|
+
assert_equal '', rest
|
1275
|
+
end
|
1276
|
+
|
1277
|
+
def test_segments_for
|
1278
|
+
segments = builder.segments_for_route_path '/:controller/:action/:id'
|
1279
|
+
|
1280
|
+
assert_kind_of ROUTING::DividerSegment, segments[0]
|
1281
|
+
assert_equal '/', segments[2].value
|
1282
|
+
|
1283
|
+
assert_kind_of ROUTING::DynamicSegment, segments[1]
|
1284
|
+
assert_equal :controller, segments[1].key
|
1285
|
+
|
1286
|
+
assert_kind_of ROUTING::DividerSegment, segments[2]
|
1287
|
+
assert_equal '/', segments[2].value
|
1288
|
+
|
1289
|
+
assert_kind_of ROUTING::DynamicSegment, segments[3]
|
1290
|
+
assert_equal :action, segments[3].key
|
1291
|
+
|
1292
|
+
assert_kind_of ROUTING::DividerSegment, segments[4]
|
1293
|
+
assert_equal '/', segments[4].value
|
1294
|
+
|
1295
|
+
assert_kind_of ROUTING::DynamicSegment, segments[5]
|
1296
|
+
assert_equal :id, segments[5].key
|
1297
|
+
end
|
1298
|
+
|
1299
|
+
def test_segment_for_action
|
1300
|
+
s, r = builder.segment_for(':action/something/else')
|
1301
|
+
assert_equal '/something/else', r
|
1302
|
+
assert_equal :action, s.key
|
1303
|
+
end
|
1304
|
+
|
1305
|
+
def test_action_default_should_not_trigger_on_prefix
|
1306
|
+
s, r = builder.segment_for ':action_name/something/else'
|
1307
|
+
assert_equal '/something/else', r
|
1308
|
+
assert_equal :action_name, s.key
|
1309
|
+
assert_equal nil, s.default
|
1310
|
+
end
|
1311
|
+
|
1312
|
+
def test_divide_route_options
|
1313
|
+
segments = builder.segments_for_route_path '/cars/:action/:person/:car/'
|
1314
|
+
defaults, requirements = builder.divide_route_options(segments,
|
1315
|
+
:action => 'buy', :person => /\w+/, :car => /\w+/,
|
1316
|
+
:defaults => {:person => nil, :car => nil}
|
1317
|
+
)
|
1318
|
+
|
1319
|
+
assert_equal({:action => 'buy', :person => nil, :car => nil}, defaults)
|
1320
|
+
assert_equal({:person => /\w+/, :car => /\w+/}, requirements)
|
1321
|
+
end
|
1322
|
+
|
1323
|
+
def test_assign_route_options
|
1324
|
+
segments = builder.segments_for_route_path '/cars/:action/:person/:car/'
|
1325
|
+
defaults = {:action => 'buy', :person => nil, :car => nil}
|
1326
|
+
requirements = {:person => /\w+/, :car => /\w+/}
|
1327
|
+
|
1328
|
+
route_requirements = builder.assign_route_options(segments, defaults, requirements)
|
1329
|
+
assert_equal({}, route_requirements)
|
1330
|
+
|
1331
|
+
assert_equal :action, segments[3].key
|
1332
|
+
assert_equal 'buy', segments[3].default
|
1333
|
+
|
1334
|
+
assert_equal :person, segments[5].key
|
1335
|
+
assert_equal %r/\w+/, segments[5].regexp
|
1336
|
+
assert segments[5].optional?
|
1337
|
+
|
1338
|
+
assert_equal :car, segments[7].key
|
1339
|
+
assert_equal %r/\w+/, segments[7].regexp
|
1340
|
+
assert segments[7].optional?
|
1341
|
+
end
|
1342
|
+
|
1343
|
+
def test_assign_route_options_with_anchor_chars
|
1344
|
+
segments = builder.segments_for_route_path '/cars/:action/:person/:car/'
|
1345
|
+
defaults = {:action => 'buy', :person => nil, :car => nil}
|
1346
|
+
requirements = {:person => /\w+/, :car => /^\w+$/}
|
1347
|
+
|
1348
|
+
assert_raises ArgumentError do
|
1349
|
+
route_requirements = builder.assign_route_options(segments, defaults, requirements)
|
1350
|
+
end
|
1351
|
+
|
1352
|
+
requirements[:car] = /[^\/]+/
|
1353
|
+
route_requirements = builder.assign_route_options(segments, defaults, requirements)
|
1354
|
+
end
|
1355
|
+
|
1356
|
+
|
1357
|
+
def test_optional_segments_preceding_required_segments
|
1358
|
+
segments = builder.segments_for_route_path '/cars/:action/:person/:car/'
|
1359
|
+
defaults = {:action => 'buy', :person => nil, :car => "model-t"}
|
1360
|
+
assert builder.assign_route_options(segments, defaults, {}).empty?
|
1361
|
+
|
1362
|
+
0.upto(1) { |i| assert !segments[i].optional?, "segment #{i} is optional and it shouldn't be" }
|
1363
|
+
assert segments[2].optional?
|
1364
|
+
|
1365
|
+
assert_equal nil, builder.warn_output # should only warn on the :person segment
|
1366
|
+
end
|
1367
|
+
|
1368
|
+
def test_segmentation_of_dot_path
|
1369
|
+
segments = builder.segments_for_route_path '/books/:action.rss'
|
1370
|
+
assert builder.assign_route_options(segments, {}, {}).empty?
|
1371
|
+
assert_equal 6, segments.length # "/", "books", "/", ":action", ".", "rss"
|
1372
|
+
assert !segments.any? { |seg| seg.optional? }
|
1373
|
+
end
|
1374
|
+
|
1375
|
+
def test_segmentation_of_dynamic_dot_path
|
1376
|
+
segments = builder.segments_for_route_path '/books/:action.:format'
|
1377
|
+
assert builder.assign_route_options(segments, {}, {}).empty?
|
1378
|
+
assert_equal 6, segments.length # "/", "books", "/", ":action", ".", ":format"
|
1379
|
+
assert !segments.any? { |seg| seg.optional? }
|
1380
|
+
assert_kind_of ROUTING::DynamicSegment, segments.last
|
1381
|
+
end
|
1382
|
+
|
1383
|
+
def test_assignment_of_default_options
|
1384
|
+
segments = builder.segments_for_route_path '/:controller/:action/:id/'
|
1385
|
+
action, id = segments[-4], segments[-2]
|
1386
|
+
|
1387
|
+
assert_equal :action, action.key
|
1388
|
+
assert_equal :id, id.key
|
1389
|
+
assert ! action.optional?
|
1390
|
+
assert ! id.optional?
|
1391
|
+
|
1392
|
+
builder.assign_default_route_options(segments)
|
1393
|
+
|
1394
|
+
assert_equal 'index', action.default
|
1395
|
+
assert action.optional?
|
1396
|
+
assert id.optional?
|
1397
|
+
end
|
1398
|
+
|
1399
|
+
def test_assignment_of_default_options_respects_existing_defaults
|
1400
|
+
segments = builder.segments_for_route_path '/:controller/:action/:id/'
|
1401
|
+
action, id = segments[-4], segments[-2]
|
1402
|
+
|
1403
|
+
assert_equal :action, action.key
|
1404
|
+
assert_equal :id, id.key
|
1405
|
+
action.default = 'show'
|
1406
|
+
action.is_optional = true
|
1407
|
+
|
1408
|
+
id.default = 'Welcome'
|
1409
|
+
id.is_optional = true
|
1410
|
+
|
1411
|
+
builder.assign_default_route_options(segments)
|
1412
|
+
|
1413
|
+
assert_equal 'show', action.default
|
1414
|
+
assert action.optional?
|
1415
|
+
assert_equal 'Welcome', id.default
|
1416
|
+
assert id.optional?
|
1417
|
+
end
|
1418
|
+
|
1419
|
+
def test_assignment_of_default_options_respects_regexps
|
1420
|
+
segments = builder.segments_for_route_path '/:controller/:action/:id/'
|
1421
|
+
action = segments[-4]
|
1422
|
+
|
1423
|
+
assert_equal :action, action.key
|
1424
|
+
action.regexp = /show|in/ # Use 'in' to check partial matches
|
1425
|
+
|
1426
|
+
builder.assign_default_route_options(segments)
|
1427
|
+
|
1428
|
+
assert_equal nil, action.default
|
1429
|
+
assert ! action.optional?
|
1430
|
+
end
|
1431
|
+
|
1432
|
+
def test_assignment_of_is_optional_when_default
|
1433
|
+
segments = builder.segments_for_route_path '/books/:action.rss'
|
1434
|
+
assert_equal segments[3].key, :action
|
1435
|
+
segments[3].default = 'changes'
|
1436
|
+
builder.ensure_required_segments(segments)
|
1437
|
+
assert ! segments[3].optional?
|
1438
|
+
end
|
1439
|
+
|
1440
|
+
def test_is_optional_is_assigned_to_default_segments
|
1441
|
+
segments = builder.segments_for_route_path '/books/:action'
|
1442
|
+
builder.assign_route_options(segments, {:action => 'index'}, {})
|
1443
|
+
|
1444
|
+
assert_equal segments[3].key, :action
|
1445
|
+
assert segments[3].optional?
|
1446
|
+
assert_kind_of ROUTING::DividerSegment, segments[2]
|
1447
|
+
assert segments[2].optional?
|
1448
|
+
end
|
1449
|
+
|
1450
|
+
# XXX is optional not being set right?
|
1451
|
+
# /blah/:defaulted_segment <-- is the second slash optional? it should be.
|
1452
|
+
|
1453
|
+
def test_route_build
|
1454
|
+
ActionController::Routing.with_controllers %w(users pages) do
|
1455
|
+
r = builder.build '/:controller/:action/:id/', :action => nil
|
1456
|
+
|
1457
|
+
[0, 2, 4].each do |i|
|
1458
|
+
assert_kind_of ROUTING::DividerSegment, r.segments[i]
|
1459
|
+
assert_equal '/', r.segments[i].value
|
1460
|
+
assert r.segments[i].optional? if i > 1
|
1461
|
+
end
|
1462
|
+
|
1463
|
+
assert_kind_of ROUTING::DynamicSegment, r.segments[1]
|
1464
|
+
assert_equal :controller, r.segments[1].key
|
1465
|
+
assert_equal nil, r.segments[1].default
|
1466
|
+
|
1467
|
+
assert_kind_of ROUTING::DynamicSegment, r.segments[3]
|
1468
|
+
assert_equal :action, r.segments[3].key
|
1469
|
+
assert_equal 'index', r.segments[3].default
|
1470
|
+
|
1471
|
+
assert_kind_of ROUTING::DynamicSegment, r.segments[5]
|
1472
|
+
assert_equal :id, r.segments[5].key
|
1473
|
+
assert r.segments[5].optional?
|
1474
|
+
end
|
1475
|
+
end
|
1476
|
+
|
1477
|
+
def test_slashes_are_implied
|
1478
|
+
routes = [
|
1479
|
+
builder.build('/:controller/:action/:id/', :action => nil),
|
1480
|
+
builder.build('/:controller/:action/:id', :action => nil),
|
1481
|
+
builder.build(':controller/:action/:id', :action => nil),
|
1482
|
+
builder.build('/:controller/:action/:id/', :action => nil)
|
1483
|
+
]
|
1484
|
+
expected = routes.first.segments.length
|
1485
|
+
routes.each_with_index do |route, i|
|
1486
|
+
found = route.segments.length
|
1487
|
+
assert_equal expected, found, "Route #{i + 1} has #{found} segments, expected #{expected}"
|
1488
|
+
end
|
1489
|
+
end
|
1490
|
+
|
1491
|
+
end
|
1492
|
+
|
1493
|
+
|
1494
|
+
|
1495
|
+
|
1496
|
+
class RouteSetTest < Test::Unit::TestCase
|
1497
|
+
|
1498
|
+
def set
|
1499
|
+
@set ||= ROUTING::RouteSet.new
|
1500
|
+
end
|
1501
|
+
|
1502
|
+
def request
|
1503
|
+
@request ||= MockRequest.new(:host => "named.routes.test", :method => :get)
|
1504
|
+
end
|
1505
|
+
|
1506
|
+
def test_generate_extras
|
1507
|
+
set.draw { |m| m.connect ':controller/:action/:id' }
|
1508
|
+
path, extras = set.generate_extras(:controller => "foo", :action => "bar", :id => 15, :this => "hello", :that => "world")
|
1509
|
+
assert_equal "/foo/bar/15", path
|
1510
|
+
assert_equal %w(that this), extras.map(&:to_s).sort
|
1511
|
+
end
|
1512
|
+
|
1513
|
+
def test_extra_keys
|
1514
|
+
set.draw { |m| m.connect ':controller/:action/:id' }
|
1515
|
+
extras = set.extra_keys(:controller => "foo", :action => "bar", :id => 15, :this => "hello", :that => "world")
|
1516
|
+
assert_equal %w(that this), extras.map(&:to_s).sort
|
1517
|
+
end
|
1518
|
+
|
1519
|
+
def test_generate_extras_not_first
|
1520
|
+
set.draw do |map|
|
1521
|
+
map.connect ':controller/:action/:id.:format'
|
1522
|
+
map.connect ':controller/:action/:id'
|
1523
|
+
end
|
1524
|
+
path, extras = set.generate_extras(:controller => "foo", :action => "bar", :id => 15, :this => "hello", :that => "world")
|
1525
|
+
assert_equal "/foo/bar/15", path
|
1526
|
+
assert_equal %w(that this), extras.map(&:to_s).sort
|
1527
|
+
end
|
1528
|
+
|
1529
|
+
def test_generate_not_first
|
1530
|
+
set.draw do |map|
|
1531
|
+
map.connect ':controller/:action/:id.:format'
|
1532
|
+
map.connect ':controller/:action/:id'
|
1533
|
+
end
|
1534
|
+
assert_equal "/foo/bar/15?this=hello", set.generate(:controller => "foo", :action => "bar", :id => 15, :this => "hello")
|
1535
|
+
end
|
1536
|
+
|
1537
|
+
def test_extra_keys_not_first
|
1538
|
+
set.draw do |map|
|
1539
|
+
map.connect ':controller/:action/:id.:format'
|
1540
|
+
map.connect ':controller/:action/:id'
|
1541
|
+
end
|
1542
|
+
extras = set.extra_keys(:controller => "foo", :action => "bar", :id => 15, :this => "hello", :that => "world")
|
1543
|
+
assert_equal %w(that this), extras.map(&:to_s).sort
|
1544
|
+
end
|
1545
|
+
|
1546
|
+
def test_draw
|
1547
|
+
assert_equal 0, set.routes.size
|
1548
|
+
set.draw do |map|
|
1549
|
+
map.connect '/hello/world', :controller => 'a', :action => 'b'
|
1550
|
+
end
|
1551
|
+
assert_equal 1, set.routes.size
|
1552
|
+
end
|
1553
|
+
|
1554
|
+
def test_named_draw
|
1555
|
+
assert_equal 0, set.routes.size
|
1556
|
+
set.draw do |map|
|
1557
|
+
map.hello '/hello/world', :controller => 'a', :action => 'b'
|
1558
|
+
end
|
1559
|
+
assert_equal 1, set.routes.size
|
1560
|
+
assert_equal set.routes.first, set.named_routes[:hello]
|
1561
|
+
end
|
1562
|
+
|
1563
|
+
def test_later_named_routes_take_precedence
|
1564
|
+
set.draw do |map|
|
1565
|
+
map.hello '/hello/world', :controller => 'a', :action => 'b'
|
1566
|
+
map.hello '/hello', :controller => 'a', :action => 'b'
|
1567
|
+
end
|
1568
|
+
assert_equal set.routes.last, set.named_routes[:hello]
|
1569
|
+
end
|
1570
|
+
|
1571
|
+
def setup_named_route_test
|
1572
|
+
set.draw do |map|
|
1573
|
+
map.show '/people/:id', :controller => 'people', :action => 'show'
|
1574
|
+
map.index '/people', :controller => 'people', :action => 'index'
|
1575
|
+
map.multi '/people/go/:foo/:bar/joe/:id', :controller => 'people', :action => 'multi'
|
1576
|
+
map.users '/admin/users', :controller => 'admin/users', :action => 'index'
|
1577
|
+
end
|
1578
|
+
|
1579
|
+
klass = Class.new(MockController)
|
1580
|
+
set.install_helpers(klass)
|
1581
|
+
klass.new(set)
|
1582
|
+
end
|
1583
|
+
|
1584
|
+
def test_named_route_hash_access_method
|
1585
|
+
controller = setup_named_route_test
|
1586
|
+
|
1587
|
+
assert_equal(
|
1588
|
+
{ :controller => 'people', :action => 'show', :id => 5, :use_route => :show, :only_path => false },
|
1589
|
+
controller.send(:hash_for_show_url, :id => 5))
|
1590
|
+
|
1591
|
+
assert_equal(
|
1592
|
+
{ :controller => 'people', :action => 'index', :use_route => :index, :only_path => false },
|
1593
|
+
controller.send(:hash_for_index_url))
|
1594
|
+
|
1595
|
+
assert_equal(
|
1596
|
+
{ :controller => 'people', :action => 'show', :id => 5, :use_route => :show, :only_path => true },
|
1597
|
+
controller.send(:hash_for_show_path, :id => 5)
|
1598
|
+
)
|
1599
|
+
end
|
1600
|
+
|
1601
|
+
def test_named_route_url_method
|
1602
|
+
controller = setup_named_route_test
|
1603
|
+
|
1604
|
+
assert_equal "http://named.route.test/people/5", controller.send(:show_url, :id => 5)
|
1605
|
+
assert_equal "/people/5", controller.send(:show_path, :id => 5)
|
1606
|
+
|
1607
|
+
assert_equal "http://named.route.test/people", controller.send(:index_url)
|
1608
|
+
assert_equal "/people", controller.send(:index_path)
|
1609
|
+
|
1610
|
+
assert_equal "http://named.route.test/admin/users", controller.send(:users_url)
|
1611
|
+
assert_equal '/admin/users', controller.send(:users_path)
|
1612
|
+
assert_equal '/admin/users', set.generate(controller.send(:hash_for_users_url), {:controller => 'users', :action => 'index'})
|
1613
|
+
end
|
1614
|
+
|
1615
|
+
def test_named_route_url_method_with_anchor
|
1616
|
+
controller = setup_named_route_test
|
1617
|
+
|
1618
|
+
assert_equal "http://named.route.test/people/5#location", controller.send(:show_url, :id => 5, :anchor => 'location')
|
1619
|
+
assert_equal "/people/5#location", controller.send(:show_path, :id => 5, :anchor => 'location')
|
1620
|
+
|
1621
|
+
assert_equal "http://named.route.test/people#location", controller.send(:index_url, :anchor => 'location')
|
1622
|
+
assert_equal "/people#location", controller.send(:index_path, :anchor => 'location')
|
1623
|
+
|
1624
|
+
assert_equal "http://named.route.test/admin/users#location", controller.send(:users_url, :anchor => 'location')
|
1625
|
+
assert_equal '/admin/users#location', controller.send(:users_path, :anchor => 'location')
|
1626
|
+
|
1627
|
+
assert_equal "http://named.route.test/people/go/7/hello/joe/5#location",
|
1628
|
+
controller.send(:multi_url, 7, "hello", 5, :anchor => 'location')
|
1629
|
+
|
1630
|
+
assert_equal "http://named.route.test/people/go/7/hello/joe/5?baz=bar#location",
|
1631
|
+
controller.send(:multi_url, 7, "hello", 5, :baz => "bar", :anchor => 'location')
|
1632
|
+
|
1633
|
+
assert_equal "http://named.route.test/people?baz=bar#location",
|
1634
|
+
controller.send(:index_url, :baz => "bar", :anchor => 'location')
|
1635
|
+
end
|
1636
|
+
|
1637
|
+
def test_named_route_url_method_with_port
|
1638
|
+
controller = setup_named_route_test
|
1639
|
+
assert_equal "http://named.route.test:8080/people/5", controller.send(:show_url, 5, :port=>8080)
|
1640
|
+
end
|
1641
|
+
|
1642
|
+
def test_named_route_url_method_with_host
|
1643
|
+
controller = setup_named_route_test
|
1644
|
+
assert_equal "http://some.example.com/people/5", controller.send(:show_url, 5, :host=>"some.example.com")
|
1645
|
+
end
|
1646
|
+
|
1647
|
+
|
1648
|
+
def test_named_route_url_method_with_ordered_parameters
|
1649
|
+
controller = setup_named_route_test
|
1650
|
+
assert_equal "http://named.route.test/people/go/7/hello/joe/5",
|
1651
|
+
controller.send(:multi_url, 7, "hello", 5)
|
1652
|
+
end
|
1653
|
+
|
1654
|
+
def test_named_route_url_method_with_ordered_parameters_and_hash
|
1655
|
+
controller = setup_named_route_test
|
1656
|
+
assert_equal "http://named.route.test/people/go/7/hello/joe/5?baz=bar",
|
1657
|
+
controller.send(:multi_url, 7, "hello", 5, :baz => "bar")
|
1658
|
+
end
|
1659
|
+
|
1660
|
+
def test_named_route_url_method_with_no_positional_arguments
|
1661
|
+
controller = setup_named_route_test
|
1662
|
+
assert_equal "http://named.route.test/people?baz=bar",
|
1663
|
+
controller.send(:index_url, :baz => "bar")
|
1664
|
+
end
|
1665
|
+
|
1666
|
+
def test_draw_default_route
|
1667
|
+
ActionController::Routing.with_controllers(['users']) do
|
1668
|
+
set.draw do |map|
|
1669
|
+
map.connect '/:controller/:action/:id'
|
1670
|
+
end
|
1671
|
+
|
1672
|
+
assert_equal 1, set.routes.size
|
1673
|
+
route = set.routes.first
|
1674
|
+
|
1675
|
+
assert route.segments.last.optional?
|
1676
|
+
|
1677
|
+
assert_equal '/users/show/10', set.generate(:controller => 'users', :action => 'show', :id => 10)
|
1678
|
+
assert_equal '/users/index/10', set.generate(:controller => 'users', :id => 10)
|
1679
|
+
|
1680
|
+
assert_equal({:controller => 'users', :action => 'index', :id => '10'}, set.recognize_path('/users/index/10'))
|
1681
|
+
assert_equal({:controller => 'users', :action => 'index', :id => '10'}, set.recognize_path('/users/index/10/'))
|
1682
|
+
end
|
1683
|
+
end
|
1684
|
+
|
1685
|
+
def test_draw_default_route_with_default_controller
|
1686
|
+
ActionController::Routing.with_controllers(['users']) do
|
1687
|
+
set.draw do |map|
|
1688
|
+
map.connect '/:controller/:action/:id', :controller => 'users'
|
1689
|
+
end
|
1690
|
+
assert_equal({:controller => 'users', :action => 'index'}, set.recognize_path('/'))
|
1691
|
+
end
|
1692
|
+
end
|
1693
|
+
|
1694
|
+
def test_route_with_parameter_shell
|
1695
|
+
ActionController::Routing.with_controllers(['users', 'pages']) do
|
1696
|
+
set.draw do |map|
|
1697
|
+
map.connect 'page/:id', :controller => 'pages', :action => 'show', :id => /\d+/
|
1698
|
+
map.connect '/:controller/:action/:id'
|
1699
|
+
end
|
1700
|
+
|
1701
|
+
assert_equal({:controller => 'pages', :action => 'index'}, set.recognize_path('/pages'))
|
1702
|
+
assert_equal({:controller => 'pages', :action => 'index'}, set.recognize_path('/pages/index'))
|
1703
|
+
assert_equal({:controller => 'pages', :action => 'list'}, set.recognize_path('/pages/list'))
|
1704
|
+
|
1705
|
+
assert_equal({:controller => 'pages', :action => 'show', :id => '10'}, set.recognize_path('/pages/show/10'))
|
1706
|
+
assert_equal({:controller => 'pages', :action => 'show', :id => '10'}, set.recognize_path('/page/10'))
|
1707
|
+
end
|
1708
|
+
end
|
1709
|
+
|
1710
|
+
def test_route_requirements_with_anchor_chars_are_invalid
|
1711
|
+
assert_raises ArgumentError do
|
1712
|
+
set.draw do |map|
|
1713
|
+
map.connect 'page/:id', :controller => 'pages', :action => 'show', :id => /^\d+/
|
1714
|
+
end
|
1715
|
+
end
|
1716
|
+
assert_raises ArgumentError do
|
1717
|
+
set.draw do |map|
|
1718
|
+
map.connect 'page/:id', :controller => 'pages', :action => 'show', :id => /\A\d+/
|
1719
|
+
end
|
1720
|
+
end
|
1721
|
+
assert_raises ArgumentError do
|
1722
|
+
set.draw do |map|
|
1723
|
+
map.connect 'page/:id', :controller => 'pages', :action => 'show', :id => /\d+$/
|
1724
|
+
end
|
1725
|
+
end
|
1726
|
+
assert_raises ArgumentError do
|
1727
|
+
set.draw do |map|
|
1728
|
+
map.connect 'page/:id', :controller => 'pages', :action => 'show', :id => /\d+\Z/
|
1729
|
+
end
|
1730
|
+
end
|
1731
|
+
assert_raises ArgumentError do
|
1732
|
+
set.draw do |map|
|
1733
|
+
map.connect 'page/:id', :controller => 'pages', :action => 'show', :id => /\d+\z/
|
1734
|
+
end
|
1735
|
+
end
|
1736
|
+
assert_nothing_raised do
|
1737
|
+
set.draw do |map|
|
1738
|
+
map.connect 'page/:id', :controller => 'pages', :action => 'show', :id => /\d+/, :name => /^(david|jamis)/
|
1739
|
+
end
|
1740
|
+
assert_raises ActionController::RoutingError do
|
1741
|
+
set.generate :controller => 'pages', :action => 'show', :id => 10
|
1742
|
+
end
|
1743
|
+
end
|
1744
|
+
end
|
1745
|
+
|
1746
|
+
def test_non_path_route_requirements_match_all
|
1747
|
+
set.draw do |map|
|
1748
|
+
map.connect 'page/37s', :controller => 'pages', :action => 'show', :name => /(jamis|david)/
|
1749
|
+
end
|
1750
|
+
assert_equal '/page/37s', set.generate(:controller => 'pages', :action => 'show', :name => 'jamis')
|
1751
|
+
assert_raises ActionController::RoutingError do
|
1752
|
+
set.generate(:controller => 'pages', :action => 'show', :name => 'not_jamis')
|
1753
|
+
end
|
1754
|
+
assert_raises ActionController::RoutingError do
|
1755
|
+
set.generate(:controller => 'pages', :action => 'show', :name => 'nor_jamis_and_david')
|
1756
|
+
end
|
1757
|
+
end
|
1758
|
+
|
1759
|
+
def test_recognize_with_encoded_id_and_regex
|
1760
|
+
set.draw do |map|
|
1761
|
+
map.connect 'page/:id', :controller => 'pages', :action => 'show', :id => /[a-zA-Z0-9\+]+/
|
1762
|
+
end
|
1763
|
+
|
1764
|
+
assert_equal({:controller => 'pages', :action => 'show', :id => '10'}, set.recognize_path('/page/10'))
|
1765
|
+
assert_equal({:controller => 'pages', :action => 'show', :id => 'hello+world'}, set.recognize_path('/page/hello+world'))
|
1766
|
+
end
|
1767
|
+
|
1768
|
+
def test_recognize_with_conditions
|
1769
|
+
Object.const_set(:PeopleController, Class.new)
|
1770
|
+
|
1771
|
+
set.draw do |map|
|
1772
|
+
map.with_options(:controller => "people") do |people|
|
1773
|
+
people.people "/people", :action => "index", :conditions => { :method => :get }
|
1774
|
+
people.connect "/people", :action => "create", :conditions => { :method => :post }
|
1775
|
+
people.person "/people/:id", :action => "show", :conditions => { :method => :get }
|
1776
|
+
people.connect "/people/:id", :action => "update", :conditions => { :method => :put }
|
1777
|
+
people.connect "/people/:id", :action => "destroy", :conditions => { :method => :delete }
|
1778
|
+
end
|
1779
|
+
end
|
1780
|
+
|
1781
|
+
request.path = "/people"
|
1782
|
+
request.method = :get
|
1783
|
+
assert_nothing_raised { set.recognize(request) }
|
1784
|
+
assert_equal("index", request.path_parameters[:action])
|
1785
|
+
|
1786
|
+
request.method = :post
|
1787
|
+
assert_nothing_raised { set.recognize(request) }
|
1788
|
+
assert_equal("create", request.path_parameters[:action])
|
1789
|
+
|
1790
|
+
request.method = :put
|
1791
|
+
assert_nothing_raised { set.recognize(request) }
|
1792
|
+
assert_equal("update", request.path_parameters[:action])
|
1793
|
+
|
1794
|
+
begin
|
1795
|
+
request.method = :bacon
|
1796
|
+
set.recognize(request)
|
1797
|
+
flunk 'Should have raised NotImplemented'
|
1798
|
+
rescue ActionController::NotImplemented => e
|
1799
|
+
assert_equal [:get, :post, :put, :delete], e.allowed_methods
|
1800
|
+
end
|
1801
|
+
|
1802
|
+
request.path = "/people/5"
|
1803
|
+
request.method = :get
|
1804
|
+
assert_nothing_raised { set.recognize(request) }
|
1805
|
+
assert_equal("show", request.path_parameters[:action])
|
1806
|
+
assert_equal("5", request.path_parameters[:id])
|
1807
|
+
|
1808
|
+
request.method = :put
|
1809
|
+
assert_nothing_raised { set.recognize(request) }
|
1810
|
+
assert_equal("update", request.path_parameters[:action])
|
1811
|
+
assert_equal("5", request.path_parameters[:id])
|
1812
|
+
|
1813
|
+
request.method = :delete
|
1814
|
+
assert_nothing_raised { set.recognize(request) }
|
1815
|
+
assert_equal("destroy", request.path_parameters[:action])
|
1816
|
+
assert_equal("5", request.path_parameters[:id])
|
1817
|
+
|
1818
|
+
begin
|
1819
|
+
request.method = :post
|
1820
|
+
set.recognize(request)
|
1821
|
+
flunk 'Should have raised MethodNotAllowed'
|
1822
|
+
rescue ActionController::MethodNotAllowed => e
|
1823
|
+
assert_equal [:get, :put, :delete], e.allowed_methods
|
1824
|
+
end
|
1825
|
+
|
1826
|
+
ensure
|
1827
|
+
Object.send(:remove_const, :PeopleController)
|
1828
|
+
end
|
1829
|
+
|
1830
|
+
def test_recognize_with_alias_in_conditions
|
1831
|
+
Object.const_set(:PeopleController, Class.new)
|
1832
|
+
|
1833
|
+
set.draw do |map|
|
1834
|
+
map.people "/people", :controller => 'people', :action => "index",
|
1835
|
+
:conditions => { :method => :get }
|
1836
|
+
map.root :people
|
1837
|
+
end
|
1838
|
+
|
1839
|
+
request.path = "/people"
|
1840
|
+
request.method = :get
|
1841
|
+
assert_nothing_raised { set.recognize(request) }
|
1842
|
+
assert_equal("people", request.path_parameters[:controller])
|
1843
|
+
assert_equal("index", request.path_parameters[:action])
|
1844
|
+
|
1845
|
+
request.path = "/"
|
1846
|
+
request.method = :get
|
1847
|
+
assert_nothing_raised { set.recognize(request) }
|
1848
|
+
assert_equal("people", request.path_parameters[:controller])
|
1849
|
+
assert_equal("index", request.path_parameters[:action])
|
1850
|
+
ensure
|
1851
|
+
Object.send(:remove_const, :PeopleController)
|
1852
|
+
end
|
1853
|
+
|
1854
|
+
def test_typo_recognition
|
1855
|
+
Object.const_set(:ArticlesController, Class.new)
|
1856
|
+
|
1857
|
+
set.draw do |map|
|
1858
|
+
map.connect 'articles/:year/:month/:day/:title',
|
1859
|
+
:controller => 'articles', :action => 'permalink',
|
1860
|
+
:year => /\d{4}/, :day => /\d{1,2}/, :month => /\d{1,2}/
|
1861
|
+
end
|
1862
|
+
|
1863
|
+
request.path = "/articles/2005/11/05/a-very-interesting-article"
|
1864
|
+
request.method = :get
|
1865
|
+
assert_nothing_raised { set.recognize(request) }
|
1866
|
+
assert_equal("permalink", request.path_parameters[:action])
|
1867
|
+
assert_equal("2005", request.path_parameters[:year])
|
1868
|
+
assert_equal("11", request.path_parameters[:month])
|
1869
|
+
assert_equal("05", request.path_parameters[:day])
|
1870
|
+
assert_equal("a-very-interesting-article", request.path_parameters[:title])
|
1871
|
+
|
1872
|
+
ensure
|
1873
|
+
Object.send(:remove_const, :ArticlesController)
|
1874
|
+
end
|
1875
|
+
|
1876
|
+
def test_routing_traversal_does_not_load_extra_classes
|
1877
|
+
assert !Object.const_defined?("Profiler__"), "Profiler should not be loaded"
|
1878
|
+
set.draw do |map|
|
1879
|
+
map.connect '/profile', :controller => 'profile'
|
1880
|
+
end
|
1881
|
+
|
1882
|
+
request.path = '/profile'
|
1883
|
+
|
1884
|
+
set.recognize(request) rescue nil
|
1885
|
+
|
1886
|
+
assert !Object.const_defined?("Profiler__"), "Profiler should not be loaded"
|
1887
|
+
end
|
1888
|
+
|
1889
|
+
def test_recognize_with_conditions_and_format
|
1890
|
+
Object.const_set(:PeopleController, Class.new)
|
1891
|
+
|
1892
|
+
set.draw do |map|
|
1893
|
+
map.with_options(:controller => "people") do |people|
|
1894
|
+
people.person "/people/:id", :action => "show", :conditions => { :method => :get }
|
1895
|
+
people.connect "/people/:id", :action => "update", :conditions => { :method => :put }
|
1896
|
+
people.connect "/people/:id.:_format", :action => "show", :conditions => { :method => :get }
|
1897
|
+
end
|
1898
|
+
end
|
1899
|
+
|
1900
|
+
request.path = "/people/5"
|
1901
|
+
request.method = :get
|
1902
|
+
assert_nothing_raised { set.recognize(request) }
|
1903
|
+
assert_equal("show", request.path_parameters[:action])
|
1904
|
+
assert_equal("5", request.path_parameters[:id])
|
1905
|
+
|
1906
|
+
request.method = :put
|
1907
|
+
assert_nothing_raised { set.recognize(request) }
|
1908
|
+
assert_equal("update", request.path_parameters[:action])
|
1909
|
+
|
1910
|
+
request.path = "/people/5.png"
|
1911
|
+
request.method = :get
|
1912
|
+
assert_nothing_raised { set.recognize(request) }
|
1913
|
+
assert_equal("show", request.path_parameters[:action])
|
1914
|
+
assert_equal("5", request.path_parameters[:id])
|
1915
|
+
assert_equal("png", request.path_parameters[:_format])
|
1916
|
+
ensure
|
1917
|
+
Object.send(:remove_const, :PeopleController)
|
1918
|
+
end
|
1919
|
+
|
1920
|
+
def test_generate_with_default_action
|
1921
|
+
set.draw do |map|
|
1922
|
+
map.connect "/people", :controller => "people"
|
1923
|
+
map.connect "/people/list", :controller => "people", :action => "list"
|
1924
|
+
end
|
1925
|
+
|
1926
|
+
url = set.generate(:controller => "people", :action => "list")
|
1927
|
+
assert_equal "/people/list", url
|
1928
|
+
end
|
1929
|
+
|
1930
|
+
def test_root_map
|
1931
|
+
Object.const_set(:PeopleController, Class.new)
|
1932
|
+
|
1933
|
+
set.draw { |map| map.root :controller => "people" }
|
1934
|
+
|
1935
|
+
request.path = ""
|
1936
|
+
request.method = :get
|
1937
|
+
assert_nothing_raised { set.recognize(request) }
|
1938
|
+
assert_equal("people", request.path_parameters[:controller])
|
1939
|
+
assert_equal("index", request.path_parameters[:action])
|
1940
|
+
ensure
|
1941
|
+
Object.send(:remove_const, :PeopleController)
|
1942
|
+
end
|
1943
|
+
|
1944
|
+
|
1945
|
+
def test_namespace
|
1946
|
+
Object.const_set(:Api, Module.new { |m| m.const_set(:ProductsController, Class.new) })
|
1947
|
+
|
1948
|
+
set.draw do |map|
|
1949
|
+
|
1950
|
+
map.namespace 'api' do |api|
|
1951
|
+
api.route 'inventory', :controller => "products", :action => 'inventory'
|
1952
|
+
end
|
1953
|
+
|
1954
|
+
end
|
1955
|
+
|
1956
|
+
request.path = "/api/inventory"
|
1957
|
+
request.method = :get
|
1958
|
+
assert_nothing_raised { set.recognize(request) }
|
1959
|
+
assert_equal("api/products", request.path_parameters[:controller])
|
1960
|
+
assert_equal("inventory", request.path_parameters[:action])
|
1961
|
+
ensure
|
1962
|
+
Object.send(:remove_const, :Api)
|
1963
|
+
end
|
1964
|
+
|
1965
|
+
|
1966
|
+
def test_namespaced_root_map
|
1967
|
+
Object.const_set(:Api, Module.new { |m| m.const_set(:ProductsController, Class.new) })
|
1968
|
+
|
1969
|
+
set.draw do |map|
|
1970
|
+
|
1971
|
+
map.namespace 'api' do |api|
|
1972
|
+
api.root :controller => "products"
|
1973
|
+
end
|
1974
|
+
|
1975
|
+
end
|
1976
|
+
|
1977
|
+
request.path = "/api"
|
1978
|
+
request.method = :get
|
1979
|
+
assert_nothing_raised { set.recognize(request) }
|
1980
|
+
assert_equal("api/products", request.path_parameters[:controller])
|
1981
|
+
assert_equal("index", request.path_parameters[:action])
|
1982
|
+
ensure
|
1983
|
+
Object.send(:remove_const, :Api)
|
1984
|
+
end
|
1985
|
+
|
1986
|
+
def test_generate_finds_best_fit
|
1987
|
+
set.draw do |map|
|
1988
|
+
map.connect "/people", :controller => "people", :action => "index"
|
1989
|
+
map.connect "/ws/people", :controller => "people", :action => "index", :ws => true
|
1990
|
+
end
|
1991
|
+
|
1992
|
+
url = set.generate(:controller => "people", :action => "index", :ws => true)
|
1993
|
+
assert_equal "/ws/people", url
|
1994
|
+
end
|
1995
|
+
|
1996
|
+
def test_generate_changes_controller_module
|
1997
|
+
set.draw { |map| map.connect ':controller/:action/:id' }
|
1998
|
+
current = { :controller => "bling/bloop", :action => "bap", :id => 9 }
|
1999
|
+
url = set.generate({:controller => "foo/bar", :action => "baz", :id => 7}, current)
|
2000
|
+
assert_equal "/foo/bar/baz/7", url
|
2001
|
+
end
|
2002
|
+
|
2003
|
+
def test_id_is_not_impossibly_sticky
|
2004
|
+
set.draw do |map|
|
2005
|
+
map.connect 'foo/:number', :controller => "people", :action => "index"
|
2006
|
+
map.connect ':controller/:action/:id'
|
2007
|
+
end
|
2008
|
+
|
2009
|
+
url = set.generate({:controller => "people", :action => "index", :number => 3},
|
2010
|
+
{:controller => "people", :action => "index", :id => "21"})
|
2011
|
+
assert_equal "/foo/3", url
|
2012
|
+
end
|
2013
|
+
|
2014
|
+
def test_id_is_sticky_when_it_ought_to_be
|
2015
|
+
set.draw do |map|
|
2016
|
+
map.connect ':controller/:id/:action'
|
2017
|
+
end
|
2018
|
+
|
2019
|
+
url = set.generate({:action => "destroy"}, {:controller => "people", :action => "show", :id => "7"})
|
2020
|
+
assert_equal "/people/7/destroy", url
|
2021
|
+
end
|
2022
|
+
|
2023
|
+
def test_use_static_path_when_possible
|
2024
|
+
set.draw do |map|
|
2025
|
+
map.connect 'about', :controller => "welcome", :action => "about"
|
2026
|
+
map.connect ':controller/:action/:id'
|
2027
|
+
end
|
2028
|
+
|
2029
|
+
url = set.generate({:controller => "welcome", :action => "about"},
|
2030
|
+
{:controller => "welcome", :action => "get", :id => "7"})
|
2031
|
+
assert_equal "/about", url
|
2032
|
+
end
|
2033
|
+
|
2034
|
+
def test_generate
|
2035
|
+
set.draw { |map| map.connect ':controller/:action/:id' }
|
2036
|
+
|
2037
|
+
args = { :controller => "foo", :action => "bar", :id => "7", :x => "y" }
|
2038
|
+
assert_equal "/foo/bar/7?x=y", set.generate(args)
|
2039
|
+
assert_equal ["/foo/bar/7", [:x]], set.generate_extras(args)
|
2040
|
+
assert_equal [:x], set.extra_keys(args)
|
2041
|
+
end
|
2042
|
+
|
2043
|
+
def test_named_routes_are_never_relative_to_modules
|
2044
|
+
set.draw do |map|
|
2045
|
+
map.connect "/connection/manage/:action", :controller => 'connection/manage'
|
2046
|
+
map.connect "/connection/connection", :controller => "connection/connection"
|
2047
|
+
map.family_connection "/connection", :controller => "connection"
|
2048
|
+
end
|
2049
|
+
|
2050
|
+
url = set.generate({:controller => "connection"}, {:controller => 'connection/manage'})
|
2051
|
+
assert_equal "/connection/connection", url
|
2052
|
+
|
2053
|
+
url = set.generate({:use_route => :family_connection, :controller => "connection"}, {:controller => 'connection/manage'})
|
2054
|
+
assert_equal "/connection", url
|
2055
|
+
end
|
2056
|
+
|
2057
|
+
def test_action_left_off_when_id_is_recalled
|
2058
|
+
set.draw do |map|
|
2059
|
+
map.connect ':controller/:action/:id'
|
2060
|
+
end
|
2061
|
+
assert_equal '/post', set.generate(
|
2062
|
+
{:controller => 'post', :action => 'index'},
|
2063
|
+
{:controller => 'post', :action => 'show', :id => '10'}
|
2064
|
+
)
|
2065
|
+
end
|
2066
|
+
|
2067
|
+
def test_query_params_will_be_shown_when_recalled
|
2068
|
+
set.draw do |map|
|
2069
|
+
map.connect 'show_post/:parameter', :controller => 'post', :action => 'show'
|
2070
|
+
map.connect ':controller/:action/:id'
|
2071
|
+
end
|
2072
|
+
assert_equal '/post/edit?parameter=1', set.generate(
|
2073
|
+
{:action => 'edit', :parameter => 1},
|
2074
|
+
{:controller => 'post', :action => 'show', :parameter => 1}
|
2075
|
+
)
|
2076
|
+
end
|
2077
|
+
|
2078
|
+
def test_expiry_determination_should_consider_values_with_to_param
|
2079
|
+
set.draw { |map| map.connect 'projects/:project_id/:controller/:action' }
|
2080
|
+
assert_equal '/projects/1/post/show', set.generate(
|
2081
|
+
{:action => 'show', :project_id => 1},
|
2082
|
+
{:controller => 'post', :action => 'show', :project_id => '1'})
|
2083
|
+
end
|
2084
|
+
|
2085
|
+
def test_generate_all
|
2086
|
+
set.draw do |map|
|
2087
|
+
map.connect 'show_post/:id', :controller => 'post', :action => 'show'
|
2088
|
+
map.connect ':controller/:action/:id'
|
2089
|
+
end
|
2090
|
+
all = set.generate(
|
2091
|
+
{:action => 'show', :id => 10, :generate_all => true},
|
2092
|
+
{:controller => 'post', :action => 'show'}
|
2093
|
+
)
|
2094
|
+
assert_equal 2, all.length
|
2095
|
+
assert_equal '/show_post/10', all.first
|
2096
|
+
assert_equal '/post/show/10', all.last
|
2097
|
+
end
|
2098
|
+
|
2099
|
+
def test_named_route_in_nested_resource
|
2100
|
+
set.draw do |map|
|
2101
|
+
map.resources :projects do |project|
|
2102
|
+
project.milestones 'milestones', :controller => 'milestones', :action => 'index'
|
2103
|
+
end
|
2104
|
+
end
|
2105
|
+
|
2106
|
+
request.path = "/projects/1/milestones"
|
2107
|
+
request.method = :get
|
2108
|
+
assert_nothing_raised { set.recognize(request) }
|
2109
|
+
assert_equal("milestones", request.path_parameters[:controller])
|
2110
|
+
assert_equal("index", request.path_parameters[:action])
|
2111
|
+
end
|
2112
|
+
|
2113
|
+
def test_setting_root_in_namespace_using_symbol
|
2114
|
+
assert_nothing_raised do
|
2115
|
+
set.draw do |map|
|
2116
|
+
map.namespace :admin do |admin|
|
2117
|
+
admin.root :controller => 'home'
|
2118
|
+
end
|
2119
|
+
end
|
2120
|
+
end
|
2121
|
+
end
|
2122
|
+
|
2123
|
+
def test_setting_root_in_namespace_using_string
|
2124
|
+
assert_nothing_raised do
|
2125
|
+
set.draw do |map|
|
2126
|
+
map.namespace 'admin' do |admin|
|
2127
|
+
admin.root :controller => 'home'
|
2128
|
+
end
|
2129
|
+
end
|
2130
|
+
end
|
2131
|
+
end
|
2132
|
+
|
2133
|
+
def test_route_requirements_with_unsupported_regexp_options_must_error
|
2134
|
+
assert_raises ArgumentError do
|
2135
|
+
set.draw do |map|
|
2136
|
+
map.connect 'page/:name', :controller => 'pages',
|
2137
|
+
:action => 'show',
|
2138
|
+
:requirements => {:name => /(david|jamis)/m}
|
2139
|
+
end
|
2140
|
+
end
|
2141
|
+
end
|
2142
|
+
|
2143
|
+
def test_route_requirements_with_supported_options_must_not_error
|
2144
|
+
assert_nothing_raised do
|
2145
|
+
set.draw do |map|
|
2146
|
+
map.connect 'page/:name', :controller => 'pages',
|
2147
|
+
:action => 'show',
|
2148
|
+
:requirements => {:name => /(david|jamis)/i}
|
2149
|
+
end
|
2150
|
+
end
|
2151
|
+
assert_nothing_raised do
|
2152
|
+
set.draw do |map|
|
2153
|
+
map.connect 'page/:name', :controller => 'pages',
|
2154
|
+
:action => 'show',
|
2155
|
+
:requirements => {:name => / # Desperately overcommented regexp
|
2156
|
+
( #Either
|
2157
|
+
david #The Creator
|
2158
|
+
| #Or
|
2159
|
+
jamis #The Deployer
|
2160
|
+
)/x}
|
2161
|
+
end
|
2162
|
+
end
|
2163
|
+
end
|
2164
|
+
|
2165
|
+
def test_route_requirement_recognize_with_ignore_case
|
2166
|
+
set.draw do |map|
|
2167
|
+
map.connect 'page/:name', :controller => 'pages',
|
2168
|
+
:action => 'show',
|
2169
|
+
:requirements => {:name => /(david|jamis)/i}
|
2170
|
+
end
|
2171
|
+
assert_equal({:controller => 'pages', :action => 'show', :name => 'jamis'}, set.recognize_path('/page/jamis'))
|
2172
|
+
assert_raises ActionController::RoutingError do
|
2173
|
+
set.recognize_path('/page/davidjamis')
|
2174
|
+
end
|
2175
|
+
assert_equal({:controller => 'pages', :action => 'show', :name => 'DAVID'}, set.recognize_path('/page/DAVID'))
|
2176
|
+
end
|
2177
|
+
|
2178
|
+
def test_route_requirement_generate_with_ignore_case
|
2179
|
+
set.draw do |map|
|
2180
|
+
map.connect 'page/:name', :controller => 'pages',
|
2181
|
+
:action => 'show',
|
2182
|
+
:requirements => {:name => /(david|jamis)/i}
|
2183
|
+
end
|
2184
|
+
url = set.generate({:controller => 'pages', :action => 'show', :name => 'david'})
|
2185
|
+
assert_equal "/page/david", url
|
2186
|
+
assert_raises ActionController::RoutingError do
|
2187
|
+
url = set.generate({:controller => 'pages', :action => 'show', :name => 'davidjamis'})
|
2188
|
+
end
|
2189
|
+
url = set.generate({:controller => 'pages', :action => 'show', :name => 'JAMIS'})
|
2190
|
+
assert_equal "/page/JAMIS", url
|
2191
|
+
end
|
2192
|
+
|
2193
|
+
def test_route_requirement_recognize_with_extended_syntax
|
2194
|
+
set.draw do |map|
|
2195
|
+
map.connect 'page/:name', :controller => 'pages',
|
2196
|
+
:action => 'show',
|
2197
|
+
:requirements => {:name => / # Desperately overcommented regexp
|
2198
|
+
( #Either
|
2199
|
+
david #The Creator
|
2200
|
+
| #Or
|
2201
|
+
jamis #The Deployer
|
2202
|
+
)/x}
|
2203
|
+
end
|
2204
|
+
assert_equal({:controller => 'pages', :action => 'show', :name => 'jamis'}, set.recognize_path('/page/jamis'))
|
2205
|
+
assert_equal({:controller => 'pages', :action => 'show', :name => 'david'}, set.recognize_path('/page/david'))
|
2206
|
+
assert_raises ActionController::RoutingError do
|
2207
|
+
set.recognize_path('/page/david #The Creator')
|
2208
|
+
end
|
2209
|
+
assert_raises ActionController::RoutingError do
|
2210
|
+
set.recognize_path('/page/David')
|
2211
|
+
end
|
2212
|
+
end
|
2213
|
+
|
2214
|
+
def test_route_requirement_generate_with_extended_syntax
|
2215
|
+
set.draw do |map|
|
2216
|
+
map.connect 'page/:name', :controller => 'pages',
|
2217
|
+
:action => 'show',
|
2218
|
+
:requirements => {:name => / # Desperately overcommented regexp
|
2219
|
+
( #Either
|
2220
|
+
david #The Creator
|
2221
|
+
| #Or
|
2222
|
+
jamis #The Deployer
|
2223
|
+
)/x}
|
2224
|
+
end
|
2225
|
+
url = set.generate({:controller => 'pages', :action => 'show', :name => 'david'})
|
2226
|
+
assert_equal "/page/david", url
|
2227
|
+
assert_raises ActionController::RoutingError do
|
2228
|
+
url = set.generate({:controller => 'pages', :action => 'show', :name => 'davidjamis'})
|
2229
|
+
end
|
2230
|
+
assert_raises ActionController::RoutingError do
|
2231
|
+
url = set.generate({:controller => 'pages', :action => 'show', :name => 'JAMIS'})
|
2232
|
+
end
|
2233
|
+
end
|
2234
|
+
|
2235
|
+
def test_route_requirement_generate_with_xi_modifiers
|
2236
|
+
set.draw do |map|
|
2237
|
+
map.connect 'page/:name', :controller => 'pages',
|
2238
|
+
:action => 'show',
|
2239
|
+
:requirements => {:name => / # Desperately overcommented regexp
|
2240
|
+
( #Either
|
2241
|
+
david #The Creator
|
2242
|
+
| #Or
|
2243
|
+
jamis #The Deployer
|
2244
|
+
)/xi}
|
2245
|
+
end
|
2246
|
+
url = set.generate({:controller => 'pages', :action => 'show', :name => 'JAMIS'})
|
2247
|
+
assert_equal "/page/JAMIS", url
|
2248
|
+
end
|
2249
|
+
|
2250
|
+
def test_route_requirement_recognize_with_xi_modifiers
|
2251
|
+
set.draw do |map|
|
2252
|
+
map.connect 'page/:name', :controller => 'pages',
|
2253
|
+
:action => 'show',
|
2254
|
+
:requirements => {:name => / # Desperately overcommented regexp
|
2255
|
+
( #Either
|
2256
|
+
david #The Creator
|
2257
|
+
| #Or
|
2258
|
+
jamis #The Deployer
|
2259
|
+
)/xi}
|
2260
|
+
end
|
2261
|
+
assert_equal({:controller => 'pages', :action => 'show', :name => 'JAMIS'}, set.recognize_path('/page/JAMIS'))
|
2262
|
+
end
|
2263
|
+
|
2264
|
+
|
2265
|
+
end
|
2266
|
+
|
2267
|
+
class RoutingTest < Test::Unit::TestCase
|
2268
|
+
|
2269
|
+
def test_possible_controllers
|
2270
|
+
true_controller_paths = ActionController::Routing.controller_paths
|
2271
|
+
|
2272
|
+
ActionController::Routing.use_controllers! nil
|
2273
|
+
|
2274
|
+
silence_warnings do
|
2275
|
+
Object.send(:const_set, :RAILS_ROOT, File.dirname(__FILE__) + '/controller_fixtures')
|
2276
|
+
end
|
2277
|
+
|
2278
|
+
ActionController::Routing.controller_paths = [
|
2279
|
+
RAILS_ROOT, RAILS_ROOT + '/app/controllers', RAILS_ROOT + '/vendor/plugins/bad_plugin/lib'
|
2280
|
+
]
|
2281
|
+
|
2282
|
+
assert_equal ["admin/user", "plugin", "user"], ActionController::Routing.possible_controllers.sort
|
2283
|
+
ensure
|
2284
|
+
if true_controller_paths
|
2285
|
+
ActionController::Routing.controller_paths = true_controller_paths
|
2286
|
+
end
|
2287
|
+
ActionController::Routing.use_controllers! nil
|
2288
|
+
Object.send(:remove_const, :RAILS_ROOT) rescue nil
|
2289
|
+
end
|
2290
|
+
|
2291
|
+
def test_possible_controllers_are_reset_on_each_load
|
2292
|
+
true_possible_controllers = ActionController::Routing.possible_controllers
|
2293
|
+
true_controller_paths = ActionController::Routing.controller_paths
|
2294
|
+
|
2295
|
+
ActionController::Routing.use_controllers! nil
|
2296
|
+
root = File.dirname(__FILE__) + '/controller_fixtures'
|
2297
|
+
|
2298
|
+
ActionController::Routing.controller_paths = []
|
2299
|
+
assert_equal [], ActionController::Routing.possible_controllers
|
2300
|
+
|
2301
|
+
ActionController::Routing::Routes.load!
|
2302
|
+
ActionController::Routing.controller_paths = [
|
2303
|
+
root, root + '/app/controllers', root + '/vendor/plugins/bad_plugin/lib'
|
2304
|
+
]
|
2305
|
+
|
2306
|
+
assert_equal ["admin/user", "plugin", "user"], ActionController::Routing.possible_controllers.sort
|
2307
|
+
ensure
|
2308
|
+
ActionController::Routing.controller_paths = true_controller_paths
|
2309
|
+
ActionController::Routing.use_controllers! true_possible_controllers
|
2310
|
+
Object.send(:remove_const, :RAILS_ROOT) rescue nil
|
2311
|
+
|
2312
|
+
ActionController::Routing::Routes.clear!
|
2313
|
+
ActionController::Routing::Routes.load_routes!
|
2314
|
+
end
|
2315
|
+
|
2316
|
+
def test_with_controllers
|
2317
|
+
c = %w(admin/accounts admin/users account pages)
|
2318
|
+
ActionController::Routing.with_controllers c do
|
2319
|
+
assert_equal c, ActionController::Routing.possible_controllers
|
2320
|
+
end
|
2321
|
+
end
|
2322
|
+
|
2323
|
+
def test_normalize_unix_paths
|
2324
|
+
load_paths = %w(. config/../app/controllers config/../app//helpers script/../config/../vendor/rails/actionpack/lib vendor/rails/railties/builtin/rails_info app/models lib script/../config/../foo/bar/../../app/models .foo/../.bar foo.bar/../config)
|
2325
|
+
paths = ActionController::Routing.normalize_paths(load_paths)
|
2326
|
+
assert_equal %w(vendor/rails/railties/builtin/rails_info vendor/rails/actionpack/lib app/controllers app/helpers app/models config .bar lib .), paths
|
2327
|
+
end
|
2328
|
+
|
2329
|
+
def test_normalize_windows_paths
|
2330
|
+
load_paths = %w(. config\\..\\app\\controllers config\\..\\app\\\\helpers script\\..\\config\\..\\vendor\\rails\\actionpack\\lib vendor\\rails\\railties\\builtin\\rails_info app\\models lib script\\..\\config\\..\\foo\\bar\\..\\..\\app\\models .foo\\..\\.bar foo.bar\\..\\config)
|
2331
|
+
paths = ActionController::Routing.normalize_paths(load_paths)
|
2332
|
+
assert_equal %w(vendor\\rails\\railties\\builtin\\rails_info vendor\\rails\\actionpack\\lib app\\controllers app\\helpers app\\models config .bar lib .), paths
|
2333
|
+
end
|
2334
|
+
|
2335
|
+
def test_routing_helper_module
|
2336
|
+
assert_kind_of Module, ActionController::Routing::Helpers
|
2337
|
+
|
2338
|
+
h = ActionController::Routing::Helpers
|
2339
|
+
c = Class.new
|
2340
|
+
assert ! c.ancestors.include?(h)
|
2341
|
+
ActionController::Routing::Routes.install_helpers c
|
2342
|
+
assert c.ancestors.include?(h)
|
2343
|
+
end
|
2344
|
+
|
2345
|
+
end
|
2346
|
+
|
2347
|
+
uses_mocha 'route loading' do
|
2348
|
+
class RouteLoadingTest < Test::Unit::TestCase
|
2349
|
+
|
2350
|
+
def setup
|
2351
|
+
routes.instance_variable_set '@routes_last_modified', nil
|
2352
|
+
silence_warnings { Object.const_set :RAILS_ROOT, '.' }
|
2353
|
+
ActionController::Routing::Routes.configuration_file = File.join(RAILS_ROOT, 'config', 'routes.rb')
|
2354
|
+
|
2355
|
+
@stat = stub_everything
|
2356
|
+
end
|
2357
|
+
|
2358
|
+
def teardown
|
2359
|
+
ActionController::Routing::Routes.configuration_file = nil
|
2360
|
+
Object.send :remove_const, :RAILS_ROOT
|
2361
|
+
end
|
2362
|
+
|
2363
|
+
def test_load
|
2364
|
+
File.expects(:stat).returns(@stat)
|
2365
|
+
routes.expects(:load).with(regexp_matches(/routes\.rb$/))
|
2366
|
+
|
2367
|
+
routes.reload
|
2368
|
+
end
|
2369
|
+
|
2370
|
+
def test_no_reload_when_not_modified
|
2371
|
+
@stat.expects(:mtime).times(2).returns(1)
|
2372
|
+
File.expects(:stat).times(2).returns(@stat)
|
2373
|
+
routes.expects(:load).with(regexp_matches(/routes\.rb$/)).at_most_once
|
2374
|
+
|
2375
|
+
2.times { routes.reload }
|
2376
|
+
end
|
2377
|
+
|
2378
|
+
def test_reload_when_modified
|
2379
|
+
@stat.expects(:mtime).at_least(2).returns(1, 2)
|
2380
|
+
File.expects(:stat).at_least(2).returns(@stat)
|
2381
|
+
routes.expects(:load).with(regexp_matches(/routes\.rb$/)).times(2)
|
2382
|
+
|
2383
|
+
2.times { routes.reload }
|
2384
|
+
end
|
2385
|
+
|
2386
|
+
def test_bang_forces_reload
|
2387
|
+
@stat.expects(:mtime).at_least(2).returns(1)
|
2388
|
+
File.expects(:stat).at_least(2).returns(@stat)
|
2389
|
+
routes.expects(:load).with(regexp_matches(/routes\.rb$/)).times(2)
|
2390
|
+
|
2391
|
+
2.times { routes.reload! }
|
2392
|
+
end
|
2393
|
+
|
2394
|
+
def test_adding_inflections_forces_reload
|
2395
|
+
Inflector::Inflections.instance.expects(:uncountable).with('equipment')
|
2396
|
+
routes.expects(:reload!)
|
2397
|
+
|
2398
|
+
Inflector.inflections { |inflect| inflect.uncountable('equipment') }
|
2399
|
+
end
|
2400
|
+
|
2401
|
+
def test_load_with_configuration
|
2402
|
+
routes.configuration_file = "foobarbaz"
|
2403
|
+
File.expects(:stat).returns(@stat)
|
2404
|
+
routes.expects(:load).with("foobarbaz")
|
2405
|
+
|
2406
|
+
routes.reload
|
2407
|
+
end
|
2408
|
+
|
2409
|
+
private
|
2410
|
+
def routes
|
2411
|
+
ActionController::Routing::Routes
|
2412
|
+
end
|
2413
|
+
|
2414
|
+
end
|
2415
|
+
end
|