radiant 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of radiant might be problematic. Click here for more details.
- data/CHANGELOG +33 -1
- data/CONTRIBUTORS +15 -2
- data/INSTALL +9 -7
- data/README +11 -7
- data/app/controllers/admin/layouts_controller.rb +5 -2
- data/app/controllers/admin/pages_controller.rb +8 -5
- data/app/controllers/admin/snippets_controller.rb +5 -2
- data/app/controllers/application_controller.rb +7 -0
- data/app/helpers/admin/node_helper.rb +2 -2
- data/app/helpers/application_helper.rb +2 -2
- data/app/models/radiant/config.rb +36 -4
- data/app/models/standard_tags.rb +1 -1
- data/app/views/admin/layouts/index.html.haml +15 -12
- data/app/views/admin/page_parts/_page_part.html.haml +2 -2
- data/app/views/admin/pages/index.html.haml +1 -1
- data/app/views/admin/snippets/_form.html.haml +1 -1
- data/app/views/admin/snippets/index.html.haml +14 -10
- data/config/database.db2.yml +20 -0
- data/config/environment.rb +4 -4
- data/config/environments/test.rb +1 -2
- data/features/support/env.rb +2 -1
- data/lib/generators/extension/extension_generator.rb +5 -0
- data/lib/generators/extension/templates/RSpecRakefile +11 -8
- data/lib/generators/extension/templates/cucumber.yml +1 -0
- data/lib/generators/extension/templates/cucumber_env.rb +16 -0
- data/lib/generators/extension/templates/cucumber_paths.rb +14 -0
- data/lib/generators/extension/templates/extension.rb +1 -1
- data/lib/generators/instance/instance_generator.rb +1 -1
- data/lib/generators/instance/templates/databases/db2.yml +40 -0
- data/lib/generators/instance/templates/instance_environment.rb +6 -6
- data/lib/local_time.rb +3 -9
- data/lib/radiant.rb +1 -1
- data/lib/radiant/cache.rb +10 -8
- data/lib/radiant/extension.rb +36 -0
- data/lib/radiant/extension/script.rb +1 -1
- data/lib/radiant/extension_loader.rb +5 -1
- data/lib/radiant/initializer.rb +52 -4
- data/lib/task_support.rb +33 -0
- data/lib/tasks/cucumber.rake +5 -1
- data/lib/tasks/radiant_config.rake +18 -0
- data/lib/tasks/release.rake +1 -0
- data/public/javascripts/admin/admin.js +1 -1
- data/spec/controllers/admin/layouts_controller_spec.rb +18 -12
- data/spec/controllers/admin/pages_controller_spec.rb +35 -29
- data/spec/controllers/admin/snippets_controller_spec.rb +11 -5
- data/spec/controllers/admin/welcome_controller_spec.rb +1 -1
- data/spec/controllers/application_controller_spec.rb +18 -0
- data/spec/fixtures/radiant_config.yml +10 -0
- data/spec/generators/extension_generator_spec.rb +12 -0
- data/spec/helpers/admin/node_helper_spec.rb +6 -0
- data/spec/helpers/application_helper_spec.rb +1 -1
- data/spec/lib/radiant/extension_loader_spec.rb +17 -0
- data/spec/lib/radiant/extension_spec.rb +28 -0
- data/spec/lib/radiant/initializer_spec.rb +34 -0
- data/spec/lib/task_support_spec.rb +42 -0
- data/spec/models/page_spec.rb +6 -2
- data/spec/models/radiant/config_spec.rb +42 -1
- data/spec/models/standard_tags_spec.rb +2 -2
- data/test/fixtures/extensions/01_basic/app/metal/basic_metal.rb +9 -0
- data/test/fixtures/extensions/02_overriding/app/metal/basic_metal.rb +9 -0
- data/vendor/extensions/textile_filter/textile.html +2 -2
- data/vendor/plugins/dataset/CHANGELOG +2 -1
- data/vendor/plugins/dataset/Rakefile +3 -0
- data/vendor/plugins/dataset/VERSION.yml +2 -2
- data/vendor/plugins/dataset/dataset.gemspec +9 -3
- data/vendor/plugins/dataset/lib/dataset.rb +3 -0
- data/vendor/radius/lib/radius.rb +5 -0
- data/vendor/radius/test/radius_test.rb +6 -0
- data/vendor/rails/actionmailer/CHANGELOG +8 -0
- data/vendor/rails/actionmailer/Rakefile +3 -2
- data/vendor/rails/actionmailer/lib/action_mailer/base.rb +2 -1
- data/vendor/rails/actionmailer/lib/action_mailer/version.rb +1 -1
- data/vendor/rails/actionmailer/test/abstract_unit.rb +0 -3
- data/vendor/rails/actionmailer/test/mail_service_test.rb +3 -2
- data/vendor/rails/actionpack/CHANGELOG +16 -0
- data/vendor/rails/actionpack/Rakefile +5 -3
- data/vendor/rails/actionpack/lib/action_controller.rb +2 -7
- data/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb +13 -3
- data/vendor/rails/actionpack/lib/action_controller/base.rb +12 -3
- data/vendor/rails/actionpack/lib/action_controller/caching.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/caching/actions.rb +9 -1
- data/vendor/rails/actionpack/lib/action_controller/caching/sweeper.rb +45 -0
- data/vendor/rails/actionpack/lib/action_controller/caching/sweeping.rb +0 -42
- data/vendor/rails/actionpack/lib/action_controller/cookies.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/dispatcher.rb +21 -6
- data/vendor/rails/actionpack/lib/action_controller/failsafe.rb +40 -6
- data/vendor/rails/actionpack/lib/action_controller/flash.rb +11 -3
- data/vendor/rails/actionpack/lib/action_controller/http_authentication.rb +7 -3
- data/vendor/rails/actionpack/lib/action_controller/integration.rb +5 -12
- data/vendor/rails/actionpack/lib/action_controller/middlewares.rb +0 -1
- data/vendor/rails/actionpack/lib/action_controller/params_parser.rb +6 -0
- data/vendor/rails/actionpack/lib/action_controller/reloader.rb +47 -7
- data/vendor/rails/actionpack/lib/action_controller/request.rb +6 -2
- data/vendor/rails/actionpack/lib/action_controller/request_forgery_protection.rb +2 -1
- data/vendor/rails/actionpack/lib/action_controller/resources.rb +17 -13
- data/vendor/rails/actionpack/lib/action_controller/response.rb +8 -2
- data/vendor/rails/actionpack/lib/action_controller/routing.rb +3 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb +20 -6
- data/vendor/rails/actionpack/lib/action_controller/streaming.rb +4 -2
- data/vendor/rails/actionpack/lib/action_controller/test_process.rb +9 -1
- data/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb +1 -1
- data/vendor/rails/actionpack/lib/action_pack/version.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb +21 -9
- data/vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb +2 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb +26 -12
- data/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb +71 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb +10 -4
- data/vendor/rails/actionpack/lib/action_view/helpers/number_helper.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb +7 -7
- data/vendor/rails/actionpack/lib/action_view/helpers/scriptaculous_helper.rb +5 -5
- data/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb +23 -14
- data/vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb +2 -2
- data/vendor/rails/actionpack/lib/action_view/locale/en.yml +4 -0
- data/vendor/rails/actionpack/lib/action_view/paths.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view/template.rb +22 -33
- data/vendor/rails/actionpack/test/abstract_unit.rb +17 -1
- data/vendor/rails/actionpack/test/activerecord/active_record_store_test.rb +3 -3
- data/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +27 -0
- data/vendor/rails/actionpack/test/controller/caching_test.rb +40 -1
- data/vendor/rails/actionpack/test/controller/cookie_test.rb +16 -0
- data/vendor/rails/actionpack/test/controller/dispatcher_test.rb +59 -18
- data/vendor/rails/actionpack/test/controller/failsafe_test.rb +60 -0
- data/vendor/rails/actionpack/test/controller/filter_params_test.rb +3 -1
- data/vendor/rails/actionpack/test/controller/flash_test.rb +6 -1
- data/vendor/rails/actionpack/test/controller/http_basic_authentication_test.rb +25 -0
- data/vendor/rails/actionpack/test/controller/http_digest_authentication_test.rb +63 -9
- data/vendor/rails/actionpack/test/controller/integration_test.rb +31 -3
- data/vendor/rails/actionpack/test/controller/rack_test.rb +18 -1
- data/vendor/rails/actionpack/test/controller/redirect_test.rb +4 -1
- data/vendor/rails/actionpack/test/controller/reloader_test.rb +124 -0
- data/vendor/rails/actionpack/test/controller/render_test.rb +19 -9
- data/vendor/rails/actionpack/test/controller/request/json_params_parsing_test.rb +24 -4
- data/vendor/rails/actionpack/test/controller/request/multipart_params_parsing_test.rb +1 -62
- data/vendor/rails/actionpack/test/controller/request/test_request_test.rb +35 -0
- data/vendor/rails/actionpack/test/controller/request/url_encoded_params_parsing_test.rb +0 -38
- data/vendor/rails/actionpack/test/controller/request/xml_params_parsing_test.rb +15 -0
- data/vendor/rails/actionpack/test/controller/request_forgery_protection_test.rb +6 -5
- data/vendor/rails/actionpack/test/controller/request_test.rb +218 -230
- data/vendor/rails/actionpack/test/controller/resources_test.rb +52 -0
- data/vendor/rails/actionpack/test/controller/routing_test.rb +28 -2
- data/vendor/rails/actionpack/test/controller/send_file_test.rb +12 -2
- data/vendor/rails/actionpack/test/controller/session/cookie_store_test.rb +9 -32
- data/vendor/rails/actionpack/test/controller/test_test.rb +8 -0
- data/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +29 -3
- data/vendor/rails/actionpack/test/fixtures/failsafe/500.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/absolute/test.css +23 -0
- data/vendor/rails/actionpack/test/fixtures/public/absolute/test.js +63 -0
- data/vendor/rails/actionpack/test/template/active_record_helper_test.rb +1 -1
- data/vendor/rails/actionpack/test/template/asset_tag_helper_test.rb +46 -0
- data/vendor/rails/actionpack/test/template/atom_feed_helper_test.rb +29 -0
- data/vendor/rails/actionpack/test/template/form_helper_test.rb +143 -6
- data/vendor/rails/actionpack/test/template/form_options_helper_i18n_test.rb +27 -0
- data/vendor/rails/actionpack/test/template/form_options_helper_test.rb +56 -0
- data/vendor/rails/actionpack/test/template/form_tag_helper_test.rb +23 -6
- data/vendor/rails/actionpack/test/template/prototype_helper_test.rb +11 -11
- data/vendor/rails/actionpack/test/template/template_test.rb +32 -0
- data/vendor/rails/actionpack/test/template/text_helper_test.rb +23 -0
- data/vendor/rails/actionpack/test/template/url_helper_test.rb +8 -0
- data/vendor/rails/activerecord/CHANGELOG +18 -0
- data/vendor/rails/activerecord/Rakefile +26 -9
- data/vendor/rails/activerecord/examples/performance.rb +162 -0
- data/vendor/rails/activerecord/lib/active_record/associations.rb +104 -35
- data/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb +10 -5
- data/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb +2 -2
- data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb +22 -4
- data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb +5 -1
- data/vendor/rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +16 -0
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb +1 -0
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb +13 -3
- data/vendor/rails/activerecord/lib/active_record/associations/has_one_through_association.rb +15 -9
- data/vendor/rails/activerecord/lib/active_record/autosave_association.rb +15 -9
- data/vendor/rails/activerecord/lib/active_record/base.rb +34 -31
- data/vendor/rails/activerecord/lib/active_record/batches.rb +23 -15
- data/vendor/rails/activerecord/lib/active_record/calculations.rb +7 -13
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +16 -2
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +2 -2
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +7 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +17 -8
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +98 -35
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +15 -0
- data/vendor/rails/activerecord/lib/active_record/dirty.rb +1 -1
- data/vendor/rails/activerecord/lib/active_record/fixtures.rb +14 -11
- data/vendor/rails/activerecord/lib/active_record/i18n_interpolation_deprecation.rb +1 -1
- data/vendor/rails/activerecord/lib/active_record/locale/en.yml +4 -0
- data/vendor/rails/activerecord/lib/active_record/named_scope.rb +3 -8
- data/vendor/rails/activerecord/lib/active_record/reflection.rb +1 -1
- data/vendor/rails/activerecord/lib/active_record/schema_dumper.rb +6 -3
- data/vendor/rails/activerecord/lib/active_record/serialization.rb +3 -2
- data/vendor/rails/activerecord/lib/active_record/serializers/json_serializer.rb +10 -18
- data/vendor/rails/activerecord/lib/active_record/serializers/xml_serializer.rb +6 -2
- data/vendor/rails/activerecord/lib/active_record/session_store.rb +9 -1
- data/vendor/rails/activerecord/lib/active_record/timestamp.rb +39 -9
- data/vendor/rails/activerecord/lib/active_record/validations.rb +149 -80
- data/vendor/rails/activerecord/lib/active_record/version.rb +1 -1
- data/vendor/rails/activerecord/test/cases/adapter_test.rb +12 -0
- data/vendor/rails/activerecord/test/cases/associations/belongs_to_associations_test.rb +102 -22
- data/vendor/rails/activerecord/test/cases/associations/eager_load_nested_include_test.rb +5 -5
- data/vendor/rails/activerecord/test/cases/associations/eager_test.rb +12 -0
- data/vendor/rails/activerecord/test/cases/associations/habtm_join_table_test.rb +56 -0
- data/vendor/rails/activerecord/test/cases/associations/has_many_associations_test.rb +62 -2
- data/vendor/rails/activerecord/test/cases/associations/has_many_through_associations_test.rb +46 -1
- data/vendor/rails/activerecord/test/cases/associations/has_one_through_associations_test.rb +18 -1
- data/vendor/rails/activerecord/test/cases/associations/inner_join_association_test.rb +5 -0
- data/vendor/rails/activerecord/test/cases/associations/join_model_test.rb +4 -4
- data/vendor/rails/activerecord/test/cases/autosave_association_test.rb +22 -0
- data/vendor/rails/activerecord/test/cases/base_test.rb +51 -6
- data/vendor/rails/activerecord/test/cases/calculations_test.rb +14 -14
- data/vendor/rails/activerecord/test/cases/column_definition_test.rb +34 -0
- data/vendor/rails/activerecord/test/cases/copy_table_test_sqlite.rb +5 -5
- data/vendor/rails/activerecord/test/cases/dirty_test.rb +10 -0
- data/vendor/rails/activerecord/test/cases/finder_test.rb +21 -50
- data/vendor/rails/activerecord/test/cases/fixtures_test.rb +6 -1
- data/vendor/rails/activerecord/test/cases/helper.rb +1 -2
- data/vendor/rails/activerecord/test/cases/i18n_test.rb +5 -0
- data/vendor/rails/activerecord/test/cases/json_serialization_test.rb +57 -57
- data/vendor/rails/activerecord/test/cases/method_scoping_test.rb +14 -4
- data/vendor/rails/activerecord/test/cases/migration_test.rb +39 -11
- data/vendor/rails/activerecord/test/cases/modules_test.rb +42 -0
- data/vendor/rails/activerecord/test/cases/named_scope_test.rb +6 -4
- data/vendor/rails/activerecord/test/cases/pk_test.rb +18 -0
- data/vendor/rails/activerecord/test/cases/reflection_test.rb +7 -7
- data/vendor/rails/activerecord/test/cases/schema_dumper_test.rb +35 -7
- data/vendor/rails/activerecord/test/cases/schema_test_postgresql.rb +76 -0
- data/vendor/rails/activerecord/test/cases/timestamp_test.rb +75 -0
- data/vendor/rails/activerecord/test/cases/validations_i18n_test.rb +656 -624
- data/vendor/rails/activerecord/test/cases/validations_test.rb +12 -2
- data/vendor/rails/activerecord/test/cases/xml_serialization_test.rb +20 -0
- data/vendor/rails/activerecord/test/fixtures/fixture_database.sqlite +0 -0
- data/vendor/rails/activerecord/test/fixtures/fixture_database.sqlite3 +0 -0
- data/vendor/rails/activerecord/test/fixtures/fixture_database_2.sqlite +0 -0
- data/vendor/rails/activerecord/test/fixtures/fixture_database_2.sqlite3 +0 -0
- data/vendor/rails/activerecord/test/fixtures/posts.yml +3 -0
- data/vendor/rails/activerecord/test/models/author.rb +5 -0
- data/vendor/rails/activerecord/test/models/comment.rb +5 -1
- data/vendor/rails/activerecord/test/models/company.rb +9 -7
- data/vendor/rails/activerecord/test/models/company_in_module.rb +1 -1
- data/vendor/rails/activerecord/test/models/contract.rb +5 -0
- data/vendor/rails/activerecord/test/models/developer.rb +10 -0
- data/vendor/rails/activerecord/test/models/essay.rb +3 -0
- data/vendor/rails/activerecord/test/models/organization.rb +2 -0
- data/vendor/rails/activerecord/test/models/pet.rb +1 -1
- data/vendor/rails/activerecord/test/models/project.rb +1 -1
- data/vendor/rails/activerecord/test/models/reply.rb +2 -1
- data/vendor/rails/activerecord/test/models/topic.rb +1 -2
- data/vendor/rails/activerecord/test/models/toy.rb +2 -0
- data/vendor/rails/activerecord/test/schema/postgresql_specific_schema.rb +13 -2
- data/vendor/rails/activerecord/test/schema/schema.rb +19 -0
- data/vendor/rails/activeresource/CHANGELOG +16 -0
- data/vendor/rails/activeresource/Rakefile +3 -2
- data/vendor/rails/activeresource/lib/active_resource/base.rb +89 -9
- data/vendor/rails/activeresource/lib/active_resource/connection.rb +73 -8
- data/vendor/rails/activeresource/lib/active_resource/exceptions.rb +66 -0
- data/vendor/rails/activeresource/lib/active_resource/formats/json_format.rb +2 -2
- data/vendor/rails/activeresource/lib/active_resource/validations.rb +20 -4
- data/vendor/rails/activeresource/lib/active_resource/version.rb +1 -1
- data/vendor/rails/activeresource/test/abstract_unit.rb +1 -3
- data/vendor/rails/activeresource/test/base/load_test.rb +16 -1
- data/vendor/rails/activeresource/test/base_errors_test.rb +56 -19
- data/vendor/rails/activeresource/test/base_test.rb +147 -0
- data/vendor/rails/activeresource/test/connection_test.rb +42 -0
- data/vendor/rails/activeresource/test/debug.log +7974 -0
- data/vendor/rails/activeresource/test/fixtures/proxy.rb +4 -0
- data/vendor/rails/activesupport/CHANGELOG +13 -0
- data/vendor/rails/activesupport/lib/active_support/all.rb +8 -0
- data/vendor/rails/activesupport/lib/active_support/cache.rb +14 -1
- data/vendor/rails/activesupport/lib/active_support/cache/mem_cache_store.rb +16 -10
- data/vendor/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/conversions.rb +1 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/calculations.rb +2 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/enumerable.rb +2 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb +14 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/debugger.rb +4 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb +2 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/delegation.rb +19 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/model_naming.rb +8 -6
- data/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb +15 -9
- data/vendor/rails/activesupport/lib/active_support/core_ext/string.rb +1 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/access.rb +29 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/bytesize.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb +7 -7
- data/vendor/rails/activesupport/lib/active_support/deprecation.rb +9 -9
- data/vendor/rails/activesupport/lib/active_support/duration.rb +4 -2
- data/vendor/rails/activesupport/lib/active_support/json.rb +1 -22
- data/vendor/rails/activesupport/lib/active_support/json/backends/jsongem.rb +38 -0
- data/vendor/rails/activesupport/lib/active_support/json/backends/yaml.rb +88 -0
- data/vendor/rails/activesupport/lib/active_support/json/decoding.rb +23 -72
- data/vendor/rails/activesupport/lib/active_support/json/encoders/date.rb +9 -8
- data/vendor/rails/activesupport/lib/active_support/json/encoders/date_time.rb +9 -8
- data/vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb +14 -9
- data/vendor/rails/activesupport/lib/active_support/json/encoders/false_class.rb +4 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/hash.rb +21 -11
- data/vendor/rails/activesupport/lib/active_support/json/encoders/nil_class.rb +4 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/numeric.rb +16 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/object.rb +6 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/regexp.rb +4 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/string.rb +5 -32
- data/vendor/rails/activesupport/lib/active_support/json/encoders/symbol.rb +2 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/time.rb +9 -8
- data/vendor/rails/activesupport/lib/active_support/json/encoders/true_class.rb +4 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoding.rb +80 -9
- data/vendor/rails/activesupport/lib/active_support/memoizable.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/message_verifier.rb +16 -3
- data/vendor/rails/activesupport/lib/active_support/multibyte.rb +30 -6
- data/vendor/rails/activesupport/lib/active_support/multibyte/chars.rb +23 -17
- data/vendor/rails/activesupport/lib/active_support/multibyte/utils.rb +61 -0
- data/vendor/rails/activesupport/lib/active_support/ordered_hash.rb +28 -0
- data/vendor/rails/activesupport/lib/active_support/test_case.rb +9 -8
- data/vendor/rails/activesupport/lib/active_support/testing/deprecation.rb +2 -0
- data/vendor/rails/activesupport/lib/active_support/time_with_zone.rb +9 -8
- data/vendor/rails/activesupport/lib/active_support/vendor.rb +6 -7
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb +0 -1
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/i18n_test.rb +0 -1
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb +0 -1
- data/vendor/rails/activesupport/lib/active_support/vendor/{memcache-client-1.6.5 → memcache-client-1.7.4}/memcache.rb +242 -70
- data/vendor/rails/activesupport/lib/active_support/version.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/xml_mini/jdom.rb +162 -0
- data/vendor/rails/railties/CHANGELOG +10 -0
- data/vendor/rails/railties/Rakefile +13 -9
- data/vendor/rails/railties/bin/about +2 -2
- data/vendor/rails/railties/bin/console +1 -1
- data/vendor/rails/railties/bin/dbconsole +1 -1
- data/vendor/rails/railties/bin/destroy +1 -1
- data/vendor/rails/railties/bin/generate +1 -1
- data/vendor/rails/railties/bin/performance/benchmarker +1 -1
- data/vendor/rails/railties/bin/performance/profiler +1 -1
- data/vendor/rails/railties/bin/plugin +1 -1
- data/vendor/rails/railties/bin/runner +1 -1
- data/vendor/rails/railties/bin/server +1 -1
- data/vendor/rails/railties/builtin/rails_info/rails/info.rb +4 -2
- data/vendor/rails/railties/configs/initializers/new_rails_defaults.rb +2 -0
- data/vendor/rails/railties/configs/routes.rb +1 -1
- data/vendor/rails/railties/configs/seeds.rb +7 -0
- data/vendor/rails/railties/environments/boot.rb +1 -1
- data/vendor/rails/railties/guides/files/javascripts/code_highlighter.js +188 -0
- data/vendor/rails/railties/guides/files/javascripts/guides.js +8 -0
- data/vendor/rails/railties/guides/files/javascripts/highlighters.js +90 -0
- data/vendor/rails/railties/guides/files/stylesheets/main.css +441 -0
- data/vendor/rails/railties/guides/files/stylesheets/print.css +52 -0
- data/vendor/rails/railties/guides/files/stylesheets/reset.css +43 -0
- data/vendor/rails/railties/guides/files/stylesheets/style.css +13 -0
- data/vendor/rails/railties/guides/files/stylesheets/syntax.css +31 -0
- data/vendor/rails/railties/guides/images/belongs_to.png +0 -0
- data/vendor/rails/railties/guides/images/book_icon.gif +0 -0
- data/vendor/rails/railties/guides/images/bullet.gif +0 -0
- data/vendor/rails/railties/guides/images/chapters_icon.gif +0 -0
- data/vendor/rails/railties/guides/images/check_bullet.gif +0 -0
- data/vendor/rails/railties/guides/images/credits_pic_blank.gif +0 -0
- data/vendor/rails/railties/guides/images/csrf.png +0 -0
- data/vendor/rails/railties/guides/images/customized_error_messages.png +0 -0
- data/vendor/rails/railties/guides/images/error_messages.png +0 -0
- data/vendor/rails/railties/guides/images/feature_tile.gif +0 -0
- data/vendor/rails/railties/guides/images/footer_tile.gif +0 -0
- data/vendor/rails/railties/guides/images/fxn.jpg +0 -0
- data/vendor/rails/railties/guides/images/grey_bullet.gif +0 -0
- data/vendor/rails/railties/guides/images/habtm.png +0 -0
- data/vendor/rails/railties/guides/images/has_many.png +0 -0
- data/vendor/rails/railties/guides/images/has_many_through.png +0 -0
- data/vendor/rails/railties/guides/images/has_one.png +0 -0
- data/vendor/rails/railties/guides/images/has_one_through.png +0 -0
- data/vendor/rails/railties/guides/images/header_backdrop.png +0 -0
- data/vendor/rails/railties/guides/images/header_tile.gif +0 -0
- data/vendor/rails/railties/guides/images/i18n/demo_localized_pirate.png +0 -0
- data/vendor/rails/railties/guides/images/i18n/demo_translated_en.png +0 -0
- data/vendor/rails/railties/guides/images/i18n/demo_translated_pirate.png +0 -0
- data/vendor/rails/railties/guides/images/i18n/demo_translation_missing.png +0 -0
- data/vendor/rails/railties/guides/images/i18n/demo_untranslated.png +0 -0
- data/vendor/rails/railties/guides/images/icons/README +5 -0
- data/vendor/rails/railties/guides/images/icons/callouts/1.png +0 -0
- data/vendor/rails/railties/guides/images/icons/callouts/10.png +0 -0
- data/vendor/rails/railties/guides/images/icons/callouts/11.png +0 -0
- data/vendor/rails/railties/guides/images/icons/callouts/12.png +0 -0
- data/vendor/rails/railties/guides/images/icons/callouts/13.png +0 -0
- data/vendor/rails/railties/guides/images/icons/callouts/14.png +0 -0
- data/vendor/rails/railties/guides/images/icons/callouts/15.png +0 -0
- data/vendor/rails/railties/guides/images/icons/callouts/2.png +0 -0
- data/vendor/rails/railties/guides/images/icons/callouts/3.png +0 -0
- data/vendor/rails/railties/guides/images/icons/callouts/4.png +0 -0
- data/vendor/rails/railties/guides/images/icons/callouts/5.png +0 -0
- data/vendor/rails/railties/guides/images/icons/callouts/6.png +0 -0
- data/vendor/rails/railties/guides/images/icons/callouts/7.png +0 -0
- data/vendor/rails/railties/guides/images/icons/callouts/8.png +0 -0
- data/vendor/rails/railties/guides/images/icons/callouts/9.png +0 -0
- data/vendor/rails/railties/guides/images/icons/caution.png +0 -0
- data/vendor/rails/railties/guides/images/icons/example.png +0 -0
- data/vendor/rails/railties/guides/images/icons/home.png +0 -0
- data/vendor/rails/railties/guides/images/icons/important.png +0 -0
- data/vendor/rails/railties/guides/images/icons/next.png +0 -0
- data/vendor/rails/railties/guides/images/icons/note.png +0 -0
- data/vendor/rails/railties/guides/images/icons/prev.png +0 -0
- data/vendor/rails/railties/guides/images/icons/tip.png +0 -0
- data/vendor/rails/railties/guides/images/icons/up.png +0 -0
- data/vendor/rails/railties/guides/images/icons/warning.png +0 -0
- data/vendor/rails/railties/guides/images/nav_arrow.gif +0 -0
- data/vendor/rails/railties/guides/images/polymorphic.png +0 -0
- data/vendor/rails/railties/guides/images/posts_index.png +0 -0
- data/vendor/rails/railties/guides/images/rails_guides_logo.gif +0 -0
- data/vendor/rails/railties/guides/images/rails_logo_remix.gif +0 -0
- data/vendor/rails/railties/guides/images/rails_welcome.png +0 -0
- data/vendor/rails/railties/guides/images/session_fixation.png +0 -0
- data/vendor/rails/railties/guides/images/tab_grey.gif +0 -0
- data/vendor/rails/railties/guides/images/tab_info.gif +0 -0
- data/vendor/rails/railties/guides/images/tab_note.gif +0 -0
- data/vendor/rails/railties/guides/images/tab_red.gif +0 -0
- data/vendor/rails/railties/guides/images/tab_yellow.gif +0 -0
- data/vendor/rails/railties/guides/images/tab_yellow.png +0 -0
- data/vendor/rails/railties/guides/images/validation_error_messages.png +0 -0
- data/vendor/rails/railties/guides/rails_guides.rb +42 -0
- data/vendor/rails/railties/guides/rails_guides/generator.rb +138 -0
- data/vendor/rails/railties/guides/rails_guides/helpers.rb +34 -0
- data/vendor/rails/railties/guides/rails_guides/indexer.rb +55 -0
- data/vendor/rails/railties/guides/rails_guides/textile_extensions.rb +41 -0
- data/vendor/rails/railties/guides/source/2_2_release_notes.textile +422 -0
- data/vendor/rails/railties/guides/source/2_3_release_notes.textile +610 -0
- data/vendor/rails/railties/guides/source/action_controller_overview.textile +776 -0
- data/vendor/rails/railties/guides/source/action_mailer_basics.textile +424 -0
- data/vendor/rails/railties/guides/source/active_record_basics.textile +135 -0
- data/vendor/rails/railties/guides/source/active_record_querying.textile +969 -0
- data/vendor/rails/railties/guides/source/activerecord_validations_callbacks.textile +1086 -0
- data/vendor/rails/railties/guides/source/association_basics.textile +1781 -0
- data/vendor/rails/railties/guides/source/caching_with_rails.textile +524 -0
- data/vendor/rails/railties/guides/source/command_line.textile +589 -0
- data/vendor/rails/railties/guides/source/configuring.textile +234 -0
- data/vendor/rails/railties/guides/source/contribute.textile +71 -0
- data/vendor/rails/railties/guides/source/contributing_to_rails.textile +239 -0
- data/vendor/rails/railties/guides/source/credits.erb.textile +52 -0
- data/vendor/rails/railties/guides/source/debugging_rails_applications.textile +709 -0
- data/vendor/rails/railties/guides/source/form_helpers.textile +766 -0
- data/vendor/rails/railties/guides/source/getting_started.textile +1297 -0
- data/vendor/rails/railties/guides/source/i18n.textile +912 -0
- data/vendor/rails/railties/guides/source/index.erb.textile +124 -0
- data/vendor/rails/railties/guides/source/layout.html.erb +103 -0
- data/vendor/rails/railties/guides/source/layouts_and_rendering.textile +979 -0
- data/vendor/rails/railties/guides/source/migrations.textile +591 -0
- data/vendor/rails/railties/guides/source/nested_model_forms.textile +222 -0
- data/vendor/rails/railties/guides/source/performance_testing.textile +531 -0
- data/vendor/rails/railties/guides/source/plugins.textile +1512 -0
- data/vendor/rails/railties/guides/source/rails_on_rack.textile +309 -0
- data/vendor/rails/railties/guides/source/routing.textile +903 -0
- data/vendor/rails/railties/guides/source/security.textile +986 -0
- data/vendor/rails/railties/guides/source/testing.textile +951 -0
- data/vendor/rails/railties/lib/commands/dbconsole.rb +8 -4
- data/vendor/rails/railties/lib/commands/performance/profiler.rb +1 -1
- data/vendor/rails/railties/lib/initializer.rb +27 -4
- data/vendor/rails/railties/lib/rails/gem_dependency.rb +35 -6
- data/vendor/rails/railties/lib/rails/plugin.rb +12 -0
- data/vendor/rails/railties/lib/rails/plugin/loader.rb +7 -0
- data/vendor/rails/railties/lib/rails/rack/metal.rb +1 -1
- data/vendor/rails/railties/lib/rails/version.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/base.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/applications/app/app_generator.rb +5 -0
- data/vendor/rails/railties/lib/rails_generator/generators/applications/app/template_runner.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/model_generator.rb +9 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +1 -0
- data/vendor/rails/railties/lib/tasks/databases.rake +17 -4
- data/vendor/rails/railties/lib/tasks/gems.rake +19 -6
- data/vendor/rails/railties/lib/tasks/routes.rake +4 -3
- data/vendor/rails/railties/lib/test_help.rb +4 -1
- metadata +158 -58
- data/spec/lib/local_time_spec.rb +0 -40
- data/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb +0 -28
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack.rb +0 -89
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/adapter/camping.rb +0 -22
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/abstract/handler.rb +0 -37
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/abstract/request.rb +0 -37
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/basic.rb +0 -58
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/digest/md5.rb +0 -124
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/digest/nonce.rb +0 -51
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/digest/params.rb +0 -55
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/digest/request.rb +0 -40
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/openid.rb +0 -480
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/builder.rb +0 -63
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/cascade.rb +0 -36
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/chunked.rb +0 -49
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/commonlogger.rb +0 -61
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/conditionalget.rb +0 -45
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/content_length.rb +0 -29
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/content_type.rb +0 -23
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/deflater.rb +0 -85
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/directory.rb +0 -153
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/file.rb +0 -88
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler.rb +0 -48
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/cgi.rb +0 -61
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/evented_mongrel.rb +0 -8
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/fastcgi.rb +0 -89
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/lsws.rb +0 -55
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/mongrel.rb +0 -84
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/scgi.rb +0 -59
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/swiftiplied_mongrel.rb +0 -8
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/thin.rb +0 -18
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb +0 -67
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb +0 -19
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lint.rb +0 -462
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lobster.rb +0 -65
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb +0 -16
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb +0 -27
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/mime.rb +0 -204
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/mock.rb +0 -160
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/recursive.rb +0 -57
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/reloader.rb +0 -64
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/request.rb +0 -241
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/response.rb +0 -179
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/session/abstract/id.rb +0 -142
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/session/cookie.rb +0 -91
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/session/memcache.rb +0 -109
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/session/pool.rb +0 -100
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/showexceptions.rb +0 -349
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/showstatus.rb +0 -106
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/static.rb +0 -38
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb +0 -55
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/utils.rb +0 -392
@@ -150,6 +150,26 @@ class ScrollsController < ActionController::Base
|
|
150
150
|
end
|
151
151
|
end
|
152
152
|
EOT
|
153
|
+
FEEDS["provide_builder"] = <<-'EOT'
|
154
|
+
# we pass in the new_xml to the helper so it doesn't
|
155
|
+
# call anything on the original builder
|
156
|
+
new_xml = Builder::XmlMarkup.new(:target=>'')
|
157
|
+
atom_feed(:xml => new_xml) do |feed|
|
158
|
+
feed.title("My great blog!")
|
159
|
+
feed.updated((@scrolls.first.created_at))
|
160
|
+
|
161
|
+
for scroll in @scrolls
|
162
|
+
feed.entry(scroll) do |entry|
|
163
|
+
entry.title(scroll.title)
|
164
|
+
entry.content(scroll.body, :type => 'html')
|
165
|
+
|
166
|
+
entry.author do |author|
|
167
|
+
author.name("DHH")
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
EOT
|
153
173
|
def index
|
154
174
|
@scrolls = [
|
155
175
|
Scroll.new(1, "1", "Hello One", "Something <i>COOL!</i>", Time.utc(2007, 12, 12, 15), Time.utc(2007, 12, 12, 15)),
|
@@ -194,6 +214,15 @@ class AtomFeedTest < ActionController::TestCase
|
|
194
214
|
end
|
195
215
|
end
|
196
216
|
|
217
|
+
def test_providing_builder_to_atom_feed
|
218
|
+
with_restful_routing(:scrolls) do
|
219
|
+
get :index, :id=>"provide_builder"
|
220
|
+
# because we pass in the non-default builder, the content generated by the
|
221
|
+
# helper should go 'nowhere'. Leaving the response body blank.
|
222
|
+
assert @response.body.blank?
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
197
226
|
def test_entry_with_prefilled_options_should_use_those_instead_of_querying_the_record
|
198
227
|
with_restful_routing(:scrolls) do
|
199
228
|
get :index, :id => "entry_options"
|
@@ -21,6 +21,9 @@ silence_warnings do
|
|
21
21
|
|
22
22
|
attr_accessor :comments
|
23
23
|
def comments_attributes=(attributes); end
|
24
|
+
|
25
|
+
attr_accessor :tags
|
26
|
+
def tags_attributes=(attributes); end
|
24
27
|
end
|
25
28
|
|
26
29
|
class Comment
|
@@ -33,6 +36,50 @@ silence_warnings do
|
|
33
36
|
def name
|
34
37
|
@id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}"
|
35
38
|
end
|
39
|
+
|
40
|
+
attr_accessor :relevances
|
41
|
+
def relevances_attributes=(attributes); end
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
class Tag
|
46
|
+
attr_reader :id
|
47
|
+
attr_reader :post_id
|
48
|
+
def initialize(id = nil, post_id = nil); @id, @post_id = id, post_id end
|
49
|
+
def save; @id = 1; @post_id = 1 end
|
50
|
+
def new_record?; @id.nil? end
|
51
|
+
def to_param; @id; end
|
52
|
+
def value
|
53
|
+
@id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}"
|
54
|
+
end
|
55
|
+
|
56
|
+
attr_accessor :relevances
|
57
|
+
def relevances_attributes=(attributes); end
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
class CommentRelevance
|
62
|
+
attr_reader :id
|
63
|
+
attr_reader :comment_id
|
64
|
+
def initialize(id = nil, comment_id = nil); @id, @comment_id = id, comment_id end
|
65
|
+
def save; @id = 1; @comment_id = 1 end
|
66
|
+
def new_record?; @id.nil? end
|
67
|
+
def to_param; @id; end
|
68
|
+
def value
|
69
|
+
@id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}"
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
class TagRelevance
|
74
|
+
attr_reader :id
|
75
|
+
attr_reader :tag_id
|
76
|
+
def initialize(id = nil, tag_id = nil); @id, @tag_id = id, tag_id end
|
77
|
+
def save; @id = 1; @tag_id = 1 end
|
78
|
+
def new_record?; @id.nil? end
|
79
|
+
def to_param; @id; end
|
80
|
+
def value
|
81
|
+
@id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}"
|
82
|
+
end
|
36
83
|
end
|
37
84
|
|
38
85
|
class Author < Comment
|
@@ -98,6 +145,27 @@ class FormHelperTest < ActionView::TestCase
|
|
98
145
|
assert_dom_equal('<label for="my_for">Title</label>', label(:post, :title, nil, "for" => "my_for"))
|
99
146
|
end
|
100
147
|
|
148
|
+
def test_label_with_id_attribute_as_symbol
|
149
|
+
assert_dom_equal('<label for="post_title" id="my_id">Title</label>', label(:post, :title, nil, :id => "my_id"))
|
150
|
+
end
|
151
|
+
|
152
|
+
def test_label_with_id_attribute_as_string
|
153
|
+
assert_dom_equal('<label for="post_title" id="my_id">Title</label>', label(:post, :title, nil, "id" => "my_id"))
|
154
|
+
end
|
155
|
+
|
156
|
+
def test_label_with_for_and_id_attributes_as_symbol
|
157
|
+
assert_dom_equal('<label for="my_for" id="my_id">Title</label>', label(:post, :title, nil, :for => "my_for", :id => "my_id"))
|
158
|
+
end
|
159
|
+
|
160
|
+
def test_label_with_for_and_id_attributes_as_string
|
161
|
+
assert_dom_equal('<label for="my_for" id="my_id">Title</label>', label(:post, :title, nil, "for" => "my_for", "id" => "my_id"))
|
162
|
+
end
|
163
|
+
|
164
|
+
def test_label_for_radio_buttons_with_value
|
165
|
+
assert_dom_equal('<label for="post_title_great_title">The title goes here</label>', label("post", "title", "The title goes here", :value => "great_title"))
|
166
|
+
assert_dom_equal('<label for="post_title_great_title">The title goes here</label>', label("post", "title", "The title goes here", :value => "great title"))
|
167
|
+
end
|
168
|
+
|
101
169
|
def test_text_field
|
102
170
|
assert_dom_equal(
|
103
171
|
'<input id="post_title" name="post[title]" size="30" type="text" value="Hello World" />', text_field("post", "title")
|
@@ -243,6 +311,16 @@ class FormHelperTest < ActionView::TestCase
|
|
243
311
|
)
|
244
312
|
end
|
245
313
|
|
314
|
+
def test_radio_button_with_booleans
|
315
|
+
assert_dom_equal('<input id="post_secret_true" name="post[secret]" type="radio" value="true" />',
|
316
|
+
radio_button("post", "secret", true)
|
317
|
+
)
|
318
|
+
|
319
|
+
assert_dom_equal('<input id="post_secret_false" name="post[secret]" type="radio" value="false" />',
|
320
|
+
radio_button("post", "secret", false)
|
321
|
+
)
|
322
|
+
end
|
323
|
+
|
246
324
|
def test_text_area
|
247
325
|
assert_dom_equal(
|
248
326
|
'<textarea cols="40" id="post_body" name="post[body]" rows="20">Back to the hill and over it again!</textarea>',
|
@@ -377,7 +455,7 @@ class FormHelperTest < ActionView::TestCase
|
|
377
455
|
|
378
456
|
expected =
|
379
457
|
"<form action='http://www.example.com' id='create-post' method='post'>" +
|
380
|
-
"<div style='margin:0;padding:0'><input name='_method' type='hidden' value='put' /></div>" +
|
458
|
+
"<div style='margin:0;padding:0;display:inline'><input name='_method' type='hidden' value='put' /></div>" +
|
381
459
|
"<input name='post[title]' size='30' type='text' id='post_title' value='Hello World' />" +
|
382
460
|
"<textarea name='post[body]' id='post_body' rows='20' cols='40'>Back to the hill and over it again!</textarea>" +
|
383
461
|
"<input name='post[secret]' type='hidden' value='0' />" +
|
@@ -531,6 +609,20 @@ class FormHelperTest < ActionView::TestCase
|
|
531
609
|
assert_dom_equal expected, output_buffer
|
532
610
|
end
|
533
611
|
|
612
|
+
def test_nested_fields_for_with_index_radio_button
|
613
|
+
form_for(:post, @post) do |f|
|
614
|
+
f.fields_for(:comment, @post, :index => 5) do |c|
|
615
|
+
concat c.radio_button(:title, "hello")
|
616
|
+
end
|
617
|
+
end
|
618
|
+
|
619
|
+
expected = "<form action='http://www.example.com' method='post'>" +
|
620
|
+
"<input name='post[comment][5][title]' type='radio' id='post_comment_5_title_hello' value='hello' />" +
|
621
|
+
"</form>"
|
622
|
+
|
623
|
+
assert_dom_equal expected, output_buffer
|
624
|
+
end
|
625
|
+
|
534
626
|
def test_nested_fields_for_with_auto_index_on_both
|
535
627
|
form_for("post[]", @post) do |f|
|
536
628
|
f.fields_for("comment[]", @post) do |c|
|
@@ -720,6 +812,51 @@ class FormHelperTest < ActionView::TestCase
|
|
720
812
|
assert_dom_equal expected, output_buffer
|
721
813
|
end
|
722
814
|
|
815
|
+
def test_nested_fields_uses_unique_indices_for_different_collection_associations
|
816
|
+
@post.comments = [Comment.new(321)]
|
817
|
+
@post.tags = [Tag.new(123), Tag.new(456)]
|
818
|
+
@post.comments[0].relevances = []
|
819
|
+
@post.tags[0].relevances = []
|
820
|
+
@post.tags[1].relevances = []
|
821
|
+
form_for(:post, @post) do |f|
|
822
|
+
f.fields_for(:comments, @post.comments[0]) do |cf|
|
823
|
+
concat cf.text_field(:name)
|
824
|
+
cf.fields_for(:relevances, CommentRelevance.new(314)) do |crf|
|
825
|
+
concat crf.text_field(:value)
|
826
|
+
end
|
827
|
+
end
|
828
|
+
f.fields_for(:tags, @post.tags[0]) do |tf|
|
829
|
+
concat tf.text_field(:value)
|
830
|
+
tf.fields_for(:relevances, TagRelevance.new(3141)) do |trf|
|
831
|
+
concat trf.text_field(:value)
|
832
|
+
end
|
833
|
+
end
|
834
|
+
f.fields_for('tags', @post.tags[1]) do |tf|
|
835
|
+
concat tf.text_field(:value)
|
836
|
+
tf.fields_for(:relevances, TagRelevance.new(31415)) do |trf|
|
837
|
+
concat trf.text_field(:value)
|
838
|
+
end
|
839
|
+
end
|
840
|
+
end
|
841
|
+
|
842
|
+
expected = '<form action="http://www.example.com" method="post">' +
|
843
|
+
'<input id="post_comments_attributes_0_id" name="post[comments_attributes][0][id]" type="hidden" value="321" />' +
|
844
|
+
'<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" size="30" type="text" value="comment #321" />' +
|
845
|
+
'<input id="post_comments_attributes_0_relevances_attributes_0_id" name="post[comments_attributes][0][relevances_attributes][0][id]" type="hidden" value="314" />' +
|
846
|
+
'<input id="post_comments_attributes_0_relevances_attributes_0_value" name="post[comments_attributes][0][relevances_attributes][0][value]" size="30" type="text" value="commentrelevance #314" />' +
|
847
|
+
'<input id="post_tags_attributes_0_id" name="post[tags_attributes][0][id]" type="hidden" value="123" />' +
|
848
|
+
'<input id="post_tags_attributes_0_value" name="post[tags_attributes][0][value]" size="30" type="text" value="tag #123" />' +
|
849
|
+
'<input id="post_tags_attributes_0_relevances_attributes_0_id" name="post[tags_attributes][0][relevances_attributes][0][id]" type="hidden" value="3141" />' +
|
850
|
+
'<input id="post_tags_attributes_0_relevances_attributes_0_value" name="post[tags_attributes][0][relevances_attributes][0][value]" size="30" type="text" value="tagrelevance #3141" />' +
|
851
|
+
'<input id="post_tags_attributes_1_id" name="post[tags_attributes][1][id]" type="hidden" value="456" />' +
|
852
|
+
'<input id="post_tags_attributes_1_value" name="post[tags_attributes][1][value]" size="30" type="text" value="tag #456" />' +
|
853
|
+
'<input id="post_tags_attributes_1_relevances_attributes_0_id" name="post[tags_attributes][1][relevances_attributes][0][id]" type="hidden" value="31415" />' +
|
854
|
+
'<input id="post_tags_attributes_1_relevances_attributes_0_value" name="post[tags_attributes][1][relevances_attributes][0][value]" size="30" type="text" value="tagrelevance #31415" />' +
|
855
|
+
'</form>'
|
856
|
+
|
857
|
+
assert_dom_equal expected, output_buffer
|
858
|
+
end
|
859
|
+
|
723
860
|
def test_fields_for
|
724
861
|
fields_for(:post, @post) do |f|
|
725
862
|
concat f.text_field(:title)
|
@@ -1072,7 +1209,7 @@ class FormHelperTest < ActionView::TestCase
|
|
1072
1209
|
def test_form_for_with_existing_object
|
1073
1210
|
form_for(@post) do |f| end
|
1074
1211
|
|
1075
|
-
expected = "<form action=\"/posts/123\" class=\"edit_post\" id=\"edit_post_123\" method=\"post\"><div style=\"margin:0;padding:0\"><input name=\"_method\" type=\"hidden\" value=\"put\" /></div></form>"
|
1212
|
+
expected = "<form action=\"/posts/123\" class=\"edit_post\" id=\"edit_post_123\" method=\"post\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"_method\" type=\"hidden\" value=\"put\" /></div></form>"
|
1076
1213
|
assert_equal expected, output_buffer
|
1077
1214
|
end
|
1078
1215
|
|
@@ -1093,7 +1230,7 @@ class FormHelperTest < ActionView::TestCase
|
|
1093
1230
|
|
1094
1231
|
form_for([@post, @comment]) {}
|
1095
1232
|
|
1096
|
-
expected = %(<form action="#{comment_path(@post, @comment)}" class="edit_comment" id="edit_comment_1" method="post"><div style="margin:0;padding:0"><input name="_method" type="hidden" value="put" /></div></form>)
|
1233
|
+
expected = %(<form action="#{comment_path(@post, @comment)}" class="edit_comment" id="edit_comment_1" method="post"><div style="margin:0;padding:0;display:inline"><input name="_method" type="hidden" value="put" /></div></form>)
|
1097
1234
|
assert_dom_equal expected, output_buffer
|
1098
1235
|
end
|
1099
1236
|
|
@@ -1112,7 +1249,7 @@ class FormHelperTest < ActionView::TestCase
|
|
1112
1249
|
|
1113
1250
|
form_for([:admin, @post, @comment]) {}
|
1114
1251
|
|
1115
|
-
expected = %(<form action="#{admin_comment_path(@post, @comment)}" class="edit_comment" id="edit_comment_1" method="post"><div style="margin:0;padding:0"><input name="_method" type="hidden" value="put" /></div></form>)
|
1252
|
+
expected = %(<form action="#{admin_comment_path(@post, @comment)}" class="edit_comment" id="edit_comment_1" method="post"><div style="margin:0;padding:0;display:inline"><input name="_method" type="hidden" value="put" /></div></form>)
|
1116
1253
|
assert_dom_equal expected, output_buffer
|
1117
1254
|
end
|
1118
1255
|
|
@@ -1128,7 +1265,7 @@ class FormHelperTest < ActionView::TestCase
|
|
1128
1265
|
def test_form_for_with_existing_object_and_custom_url
|
1129
1266
|
form_for(@post, :url => "/super_posts") do |f| end
|
1130
1267
|
|
1131
|
-
expected = "<form action=\"/super_posts\" class=\"edit_post\" id=\"edit_post_123\" method=\"post\"><div style=\"margin:0;padding:0\"><input name=\"_method\" type=\"hidden\" value=\"put\" /></div></form>"
|
1268
|
+
expected = "<form action=\"/super_posts\" class=\"edit_post\" id=\"edit_post_123\" method=\"post\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"_method\" type=\"hidden\" value=\"put\" /></div></form>"
|
1132
1269
|
assert_equal expected, output_buffer
|
1133
1270
|
end
|
1134
1271
|
|
@@ -1173,4 +1310,4 @@ class FormHelperTest < ActionView::TestCase
|
|
1173
1310
|
def protect_against_forgery?
|
1174
1311
|
false
|
1175
1312
|
end
|
1176
|
-
end
|
1313
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'abstract_unit'
|
2
|
+
|
3
|
+
class FormOptionsHelperI18nTests < ActionView::TestCase
|
4
|
+
tests ActionView::Helpers::FormOptionsHelper
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@prompt_message = 'Select!'
|
8
|
+
I18n.backend.send(:init_translations)
|
9
|
+
I18n.backend.store_translations :en, :support => { :select => { :prompt => @prompt_message } }
|
10
|
+
end
|
11
|
+
|
12
|
+
def teardown
|
13
|
+
I18n.backend = I18n::Backend::Simple.new
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_select_with_prompt_true_translates_prompt_message
|
17
|
+
I18n.expects(:translate).with('support.select.prompt', { :default => 'Please select' })
|
18
|
+
select('post', 'category', [], :prompt => true)
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_select_with_translated_prompt
|
22
|
+
assert_dom_equal(
|
23
|
+
%Q(<select id="post_category" name="post[category]"><option value="">#{@prompt_message}</option>\n</select>),
|
24
|
+
select('post', 'category', [], :prompt => true)
|
25
|
+
)
|
26
|
+
end
|
27
|
+
end
|
@@ -80,6 +80,14 @@ class FormOptionsHelperTest < ActionView::TestCase
|
|
80
80
|
)
|
81
81
|
end
|
82
82
|
|
83
|
+
def test_string_options_for_select
|
84
|
+
options = "<option value=\"Denmark\">Denmark</option><option value=\"USA\">USA</option><option value=\"Sweden\">Sweden</option>"
|
85
|
+
assert_dom_equal(
|
86
|
+
options,
|
87
|
+
options_for_select(options)
|
88
|
+
)
|
89
|
+
end
|
90
|
+
|
83
91
|
def test_array_options_for_select
|
84
92
|
assert_dom_equal(
|
85
93
|
"<option value=\"<Denmark>\"><Denmark></option>\n<option value=\"USA\">USA</option>\n<option value=\"Sweden\">Sweden</option>",
|
@@ -324,6 +332,20 @@ class FormOptionsHelperTest < ActionView::TestCase
|
|
324
332
|
)
|
325
333
|
end
|
326
334
|
|
335
|
+
def test_select_under_fields_for_with_string_and_given_prompt
|
336
|
+
@post = Post.new
|
337
|
+
options = "<option value=\"abe\">abe</option><option value=\"mus\">mus</option><option value=\"hest\">hest</option>"
|
338
|
+
|
339
|
+
fields_for :post, @post do |f|
|
340
|
+
concat f.select(:category, options, :prompt => 'The prompt')
|
341
|
+
end
|
342
|
+
|
343
|
+
assert_dom_equal(
|
344
|
+
"<select id=\"post_category\" name=\"post[category]\"><option value=\"\">The prompt</option>\n#{options}</select>",
|
345
|
+
output_buffer
|
346
|
+
)
|
347
|
+
end
|
348
|
+
|
327
349
|
def test_select_with_blank
|
328
350
|
@post = Post.new
|
329
351
|
@post.category = "<mus>"
|
@@ -741,6 +763,40 @@ class FormOptionsHelperTest < ActionView::TestCase
|
|
741
763
|
html
|
742
764
|
end
|
743
765
|
|
766
|
+
def test_grouped_collection_select
|
767
|
+
@continents = [
|
768
|
+
Continent.new("<Africa>", [Country.new("<sa>", "<South Africa>"), Country.new("so", "Somalia")] ),
|
769
|
+
Continent.new("Europe", [Country.new("dk", "Denmark"), Country.new("ie", "Ireland")] )
|
770
|
+
]
|
771
|
+
|
772
|
+
@post = Post.new
|
773
|
+
@post.origin = 'dk'
|
774
|
+
|
775
|
+
assert_dom_equal(
|
776
|
+
%Q{<select id="post_origin" name="post[origin]"><optgroup label="<Africa>"><option value="<sa>"><South Africa></option>\n<option value="so">Somalia</option></optgroup><optgroup label="Europe"><option value="dk" selected="selected">Denmark</option>\n<option value="ie">Ireland</option></optgroup></select>},
|
777
|
+
grouped_collection_select("post", "origin", @continents, :countries, :continent_name, :country_id, :country_name)
|
778
|
+
)
|
779
|
+
end
|
780
|
+
|
781
|
+
def test_grouped_collection_select_under_fields_for
|
782
|
+
@continents = [
|
783
|
+
Continent.new("<Africa>", [Country.new("<sa>", "<South Africa>"), Country.new("so", "Somalia")] ),
|
784
|
+
Continent.new("Europe", [Country.new("dk", "Denmark"), Country.new("ie", "Ireland")] )
|
785
|
+
]
|
786
|
+
|
787
|
+
@post = Post.new
|
788
|
+
@post.origin = 'dk'
|
789
|
+
|
790
|
+
fields_for :post, @post do |f|
|
791
|
+
concat f.grouped_collection_select("origin", @continents, :countries, :continent_name, :country_id, :country_name)
|
792
|
+
end
|
793
|
+
|
794
|
+
assert_dom_equal(
|
795
|
+
%Q{<select id="post_origin" name="post[origin]"><optgroup label="<Africa>"><option value="<sa>"><South Africa></option>\n<option value="so">Somalia</option></optgroup><optgroup label="Europe"><option value="dk" selected="selected">Denmark</option>\n<option value="ie">Ireland</option></optgroup></select>},
|
796
|
+
output_buffer
|
797
|
+
)
|
798
|
+
end
|
799
|
+
|
744
800
|
private
|
745
801
|
|
746
802
|
def dummy_posts
|
@@ -39,13 +39,13 @@ class FormTagHelperTest < ActionView::TestCase
|
|
39
39
|
|
40
40
|
def test_form_tag_with_method_put
|
41
41
|
actual = form_tag({}, { :method => :put })
|
42
|
-
expected = %(<form action="http://www.example.com" method="post"><div style='margin:0;padding:0'><input type="hidden" name="_method" value="put" /></div>)
|
42
|
+
expected = %(<form action="http://www.example.com" method="post"><div style='margin:0;padding:0;display:inline'><input type="hidden" name="_method" value="put" /></div>)
|
43
43
|
assert_dom_equal expected, actual
|
44
44
|
end
|
45
45
|
|
46
46
|
def test_form_tag_with_method_delete
|
47
47
|
actual = form_tag({}, { :method => :delete })
|
48
|
-
expected = %(<form action="http://www.example.com" method="post"><div style='margin:0;padding:0'><input type="hidden" name="_method" value="delete" /></div>)
|
48
|
+
expected = %(<form action="http://www.example.com" method="post"><div style='margin:0;padding:0;display:inline'><input type="hidden" name="_method" value="delete" /></div>)
|
49
49
|
assert_dom_equal expected, actual
|
50
50
|
end
|
51
51
|
|
@@ -61,7 +61,7 @@ class FormTagHelperTest < ActionView::TestCase
|
|
61
61
|
__in_erb_template = ''
|
62
62
|
form_tag("http://example.com", :method => :put) { concat "Hello world!" }
|
63
63
|
|
64
|
-
expected = %(<form action="http://example.com" method="post"><div style='margin:0;padding:0'><input type="hidden" name="_method" value="put" /></div>Hello world!</form>)
|
64
|
+
expected = %(<form action="http://example.com" method="post"><div style='margin:0;padding:0;display:inline'><input type="hidden" name="_method" value="put" /></div>Hello world!</form>)
|
65
65
|
assert_dom_equal expected, output_buffer
|
66
66
|
end
|
67
67
|
|
@@ -153,6 +153,23 @@ class FormTagHelperTest < ActionView::TestCase
|
|
153
153
|
assert_dom_equal expected, actual
|
154
154
|
end
|
155
155
|
|
156
|
+
def test_text_area_tag_id_sanitized
|
157
|
+
input_elem = root_elem(text_area_tag("item[][description]"))
|
158
|
+
assert_match VALID_HTML_ID, input_elem['id']
|
159
|
+
end
|
160
|
+
|
161
|
+
def test_text_area_tag_escape_content
|
162
|
+
actual = text_area_tag "body", "<b>hello world</b>", :size => "20x40"
|
163
|
+
expected = %(<textarea cols="20" id="body" name="body" rows="40"><b>hello world</b></textarea>)
|
164
|
+
assert_dom_equal expected, actual
|
165
|
+
end
|
166
|
+
|
167
|
+
def test_text_area_tag_unescaped_content
|
168
|
+
actual = text_area_tag "body", "<b>hello world</b>", :size => "20x40", :escape => false
|
169
|
+
expected = %(<textarea cols="20" id="body" name="body" rows="40"><b>hello world</b></textarea>)
|
170
|
+
assert_dom_equal expected, actual
|
171
|
+
end
|
172
|
+
|
156
173
|
def test_text_field_tag
|
157
174
|
actual = text_field_tag "title", "Hello!"
|
158
175
|
expected = %(<input id="title" name="title" type="text" value="Hello!" />)
|
@@ -252,14 +269,14 @@ class FormTagHelperTest < ActionView::TestCase
|
|
252
269
|
|
253
270
|
def test_submit_tag
|
254
271
|
assert_dom_equal(
|
255
|
-
%(<input name='commit'
|
272
|
+
%(<input name='commit' onclick="if (window.hiddenCommit) { window.hiddenCommit.setAttribute('value', this.value); }else { hiddenCommit = document.createElement('input');hiddenCommit.type = 'hidden';hiddenCommit.value = this.value;hiddenCommit.name = this.name;this.form.appendChild(hiddenCommit); }this.setAttribute('originalValue', this.value);this.disabled = true;this.value='Saving...';alert('hello!');result = (this.form.onsubmit ? (this.form.onsubmit() ? this.form.submit() : false) : this.form.submit());if (result == false) { this.value = this.getAttribute('originalValue');this.disabled = false; }return result;" type="submit" value="Save" />),
|
256
273
|
submit_tag("Save", :disable_with => "Saving...", :onclick => "alert('hello!')")
|
257
274
|
)
|
258
275
|
end
|
259
276
|
|
260
277
|
def test_submit_tag_with_no_onclick_options
|
261
278
|
assert_dom_equal(
|
262
|
-
%(<input name='commit'
|
279
|
+
%(<input name='commit' onclick="if (window.hiddenCommit) { window.hiddenCommit.setAttribute('value', this.value); }else { hiddenCommit = document.createElement('input');hiddenCommit.type = 'hidden';hiddenCommit.value = this.value;hiddenCommit.name = this.name;this.form.appendChild(hiddenCommit); }this.setAttribute('originalValue', this.value);this.disabled = true;this.value='Saving...';result = (this.form.onsubmit ? (this.form.onsubmit() ? this.form.submit() : false) : this.form.submit());if (result == false) { this.value = this.getAttribute('originalValue');this.disabled = false; }return result;" type="submit" value="Save" />),
|
263
280
|
submit_tag("Save", :disable_with => "Saving...")
|
264
281
|
)
|
265
282
|
end
|
@@ -273,7 +290,7 @@ class FormTagHelperTest < ActionView::TestCase
|
|
273
290
|
|
274
291
|
def test_submit_tag_with_confirmation_and_with_disable_with
|
275
292
|
assert_dom_equal(
|
276
|
-
%(<input name="commit"
|
293
|
+
%(<input name="commit" onclick="if (!confirm('Are you sure?')) return false; if (window.hiddenCommit) { window.hiddenCommit.setAttribute('value', this.value); }else { hiddenCommit = document.createElement('input');hiddenCommit.type = 'hidden';hiddenCommit.value = this.value;hiddenCommit.name = this.name;this.form.appendChild(hiddenCommit); }this.setAttribute('originalValue', this.value);this.disabled = true;this.value='Saving...';result = (this.form.onsubmit ? (this.form.onsubmit() ? this.form.submit() : false) : this.form.submit());if (result == false) { this.value = this.getAttribute('originalValue');this.disabled = false; }return result;" type="submit" value="Save" />),
|
277
294
|
submit_tag("Save", :disable_with => "Saving...", :confirm => "Are you sure?")
|
278
295
|
)
|
279
296
|
end
|
@@ -130,7 +130,7 @@ class PrototypeHelperTest < PrototypeHelperBaseTest
|
|
130
130
|
end
|
131
131
|
|
132
132
|
def test_form_remote_tag_with_method
|
133
|
-
assert_dom_equal %(<form action=\"http://www.example.com/fast\" method=\"post\" onsubmit=\"new Ajax.Updater('glass_of_beer', 'http://www.example.com/fast', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\"><div style='margin:0;padding:0'><input name='_method' type='hidden' value='put' /></div>),
|
133
|
+
assert_dom_equal %(<form action=\"http://www.example.com/fast\" method=\"post\" onsubmit=\"new Ajax.Updater('glass_of_beer', 'http://www.example.com/fast', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\"><div style='margin:0;padding:0;display:inline'><input name='_method' type='hidden' value='put' /></div>),
|
134
134
|
form_remote_tag(:update => "glass_of_beer", :url => { :action => :fast }, :html => { :method => :put })
|
135
135
|
end
|
136
136
|
|
@@ -158,7 +158,7 @@ class PrototypeHelperTest < PrototypeHelperBaseTest
|
|
158
158
|
@record.save
|
159
159
|
remote_form_for(@record) {}
|
160
160
|
|
161
|
-
expected = %(<form action='#{author_path(@record)}' id='edit_author_1' method='post' onsubmit="new Ajax.Request('#{author_path(@record)}', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;" class='edit_author'><div style='margin:0;padding:0'><input name='_method' type='hidden' value='put' /></div></form>)
|
161
|
+
expected = %(<form action='#{author_path(@record)}' id='edit_author_1' method='post' onsubmit="new Ajax.Request('#{author_path(@record)}', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;" class='edit_author'><div style='margin:0;padding:0;display:inline'><input name='_method' type='hidden' value='put' /></div></form>)
|
162
162
|
assert_dom_equal expected, output_buffer
|
163
163
|
end
|
164
164
|
|
@@ -174,7 +174,7 @@ class PrototypeHelperTest < PrototypeHelperBaseTest
|
|
174
174
|
@article.save
|
175
175
|
remote_form_for([@author, @article]) {}
|
176
176
|
|
177
|
-
expected = %(<form action='#{author_article_path(@author, @article)}' id='edit_article_1' method='post' onsubmit="new Ajax.Request('#{author_article_path(@author, @article)}', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;" class='edit_article'><div style='margin:0;padding:0'><input name='_method' type='hidden' value='put' /></div></form>)
|
177
|
+
expected = %(<form action='#{author_article_path(@author, @article)}' id='edit_article_1' method='post' onsubmit="new Ajax.Request('#{author_article_path(@author, @article)}', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;" class='edit_article'><div style='margin:0;padding:0;display:inline'><input name='_method' type='hidden' value='put' /></div></form>)
|
178
178
|
assert_dom_equal expected, output_buffer
|
179
179
|
end
|
180
180
|
|
@@ -327,28 +327,28 @@ class JavaScriptGeneratorTest < PrototypeHelperBaseTest
|
|
327
327
|
def test_remove
|
328
328
|
assert_equal 'Element.remove("foo");',
|
329
329
|
@generator.remove('foo')
|
330
|
-
assert_equal '["foo",
|
330
|
+
assert_equal '["foo","bar","baz"].each(Element.remove);',
|
331
331
|
@generator.remove('foo', 'bar', 'baz')
|
332
332
|
end
|
333
333
|
|
334
334
|
def test_show
|
335
335
|
assert_equal 'Element.show("foo");',
|
336
336
|
@generator.show('foo')
|
337
|
-
assert_equal '["foo",
|
337
|
+
assert_equal '["foo","bar","baz"].each(Element.show);',
|
338
338
|
@generator.show('foo', 'bar', 'baz')
|
339
339
|
end
|
340
340
|
|
341
341
|
def test_hide
|
342
342
|
assert_equal 'Element.hide("foo");',
|
343
343
|
@generator.hide('foo')
|
344
|
-
assert_equal '["foo",
|
344
|
+
assert_equal '["foo","bar","baz"].each(Element.hide);',
|
345
345
|
@generator.hide('foo', 'bar', 'baz')
|
346
346
|
end
|
347
347
|
|
348
348
|
def test_toggle
|
349
349
|
assert_equal 'Element.toggle("foo");',
|
350
350
|
@generator.toggle('foo')
|
351
|
-
assert_equal '["foo",
|
351
|
+
assert_equal '["foo","bar","baz"].each(Element.toggle);',
|
352
352
|
@generator.toggle('foo', 'bar', 'baz')
|
353
353
|
end
|
354
354
|
|
@@ -385,7 +385,7 @@ class JavaScriptGeneratorTest < PrototypeHelperBaseTest
|
|
385
385
|
assert_equal <<-EOS.chomp, @generator.to_s
|
386
386
|
Element.insert("element", { top: "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E" });
|
387
387
|
Element.insert("element", { bottom: "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E" });
|
388
|
-
["foo",
|
388
|
+
["foo","bar"].each(Element.remove);
|
389
389
|
Element.update("baz", "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E");
|
390
390
|
EOS
|
391
391
|
end
|
@@ -554,8 +554,8 @@ return (value.className == "welcome");
|
|
554
554
|
end
|
555
555
|
|
556
556
|
assert_equal <<-EOS.strip, @generator.to_s
|
557
|
-
var a = [1, 2, 3].zip([4,
|
558
|
-
var b = [1, 2, 3].zip([4,
|
557
|
+
var a = [1, 2, 3].zip([4,5,6], [7,8,9]);
|
558
|
+
var b = [1, 2, 3].zip([4,5,6], [7,8,9], function(array) {
|
559
559
|
return array.reverse();
|
560
560
|
});
|
561
561
|
EOS
|
@@ -606,7 +606,7 @@ return value.reverse();
|
|
606
606
|
|
607
607
|
def test_literal
|
608
608
|
literal = @generator.literal("function() {}")
|
609
|
-
assert_equal "function() {}", literal
|
609
|
+
assert_equal "function() {}", ActiveSupport::JSON.encode(literal)
|
610
610
|
assert_equal "", @generator.to_s
|
611
611
|
end
|
612
612
|
|