factorylabs-castronaut 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.textile +67 -0
- data/Rakefile +78 -0
- data/bin/castronaut +75 -0
- data/config/castronaut.example.yml +41 -0
- data/config/castronaut.sample.yml +40 -0
- data/config/castronaut.yml +40 -0
- data/config/nginx_vhost.conf +17 -0
- data/config/thin_config.yml +13 -0
- data/lib/castronaut.rb +50 -0
- data/lib/castronaut/adapters.rb +13 -0
- data/lib/castronaut/adapters/development/adapter.rb +13 -0
- data/lib/castronaut/adapters/development/user.rb +25 -0
- data/lib/castronaut/adapters/ldap/adapter.rb +15 -0
- data/lib/castronaut/adapters/ldap/user.rb +40 -0
- data/lib/castronaut/adapters/restful_authentication/adapter.rb +15 -0
- data/lib/castronaut/adapters/restful_authentication/user.rb +50 -0
- data/lib/castronaut/application.rb +1 -0
- data/lib/castronaut/application/application.rb +70 -0
- data/lib/castronaut/application/public/javascripts/application.js +3 -0
- data/lib/castronaut/application/public/javascripts/jquery.js +32 -0
- data/lib/castronaut/application/public/stylesheets/screen.css +122 -0
- data/lib/castronaut/application/views/layout.erb +27 -0
- data/lib/castronaut/application/views/login.erb +31 -0
- data/lib/castronaut/application/views/logout.erb +13 -0
- data/lib/castronaut/application/views/proxy_validate.erb +21 -0
- data/lib/castronaut/application/views/service_validate.erb +14 -0
- data/lib/castronaut/authentication_result.rb +24 -0
- data/lib/castronaut/configuration.rb +110 -0
- data/lib/castronaut/db/001_create_cas_database.rb +47 -0
- data/lib/castronaut/models/consumeable.rb +18 -0
- data/lib/castronaut/models/dispenser.rb +14 -0
- data/lib/castronaut/models/login_ticket.rb +53 -0
- data/lib/castronaut/models/proxy_granting_ticket.rb +70 -0
- data/lib/castronaut/models/proxy_ticket.rb +43 -0
- data/lib/castronaut/models/service_ticket.rb +91 -0
- data/lib/castronaut/models/ticket_granting_ticket.rb +52 -0
- data/lib/castronaut/presenters/login.rb +84 -0
- data/lib/castronaut/presenters/logout.rb +56 -0
- data/lib/castronaut/presenters/process_login.rb +149 -0
- data/lib/castronaut/presenters/proxy_validate.rb +67 -0
- data/lib/castronaut/presenters/service_validate.rb +68 -0
- data/lib/castronaut/support/sample.rb +21 -0
- data/lib/castronaut/ticket_result.rb +27 -0
- data/lib/castronaut/utilities/random_string.rb +24 -0
- data/spec/app/controllers/application_spec.rb +86 -0
- data/spec/castronaut/adapters/development/adapter_spec.rb +14 -0
- data/spec/castronaut/adapters/development/user_spec.rb +55 -0
- data/spec/castronaut/adapters/ldap/adapter_spec.rb +14 -0
- data/spec/castronaut/adapters/ldap/user_spec.rb +25 -0
- data/spec/castronaut/adapters/restful_authentication/adapter_spec.rb +14 -0
- data/spec/castronaut/adapters/restful_authentication/user_spec.rb +108 -0
- data/spec/castronaut/adapters_spec.rb +13 -0
- data/spec/castronaut/authentication_result_spec.rb +20 -0
- data/spec/castronaut/configuration_spec.rb +172 -0
- data/spec/castronaut/models/consumeable_spec.rb +39 -0
- data/spec/castronaut/models/dispenser_spec.rb +30 -0
- data/spec/castronaut/models/login_ticket_spec.rb +107 -0
- data/spec/castronaut/models/proxy_granting_ticket_spec.rb +302 -0
- data/spec/castronaut/models/proxy_ticket_spec.rb +109 -0
- data/spec/castronaut/models/service_ticket_spec.rb +269 -0
- data/spec/castronaut/models/ticket_granting_ticket_spec.rb +89 -0
- data/spec/castronaut/presenters/login_spec.rb +152 -0
- data/spec/castronaut/presenters/logout_spec.rb +85 -0
- data/spec/castronaut/presenters/process_login_spec.rb +300 -0
- data/spec/castronaut/presenters/proxy_validate_spec.rb +103 -0
- data/spec/castronaut/presenters/service_validate_spec.rb +86 -0
- data/spec/castronaut/ticket_result_spec.rb +42 -0
- data/spec/castronaut/utilities/random_string_spec.rb +14 -0
- data/spec/castronaut_spec.rb +26 -0
- data/spec/spec_controller_helper.rb +17 -0
- data/spec/spec_helper.rb +39 -0
- data/spec/spec_rails_mocks.rb +132 -0
- data/vendor/activerecord/CHANGELOG +5786 -0
- data/vendor/activerecord/README +351 -0
- data/vendor/activerecord/RUNNING_UNIT_TESTS +36 -0
- data/vendor/activerecord/Rakefile +247 -0
- data/vendor/activerecord/examples/associations.png +0 -0
- data/vendor/activerecord/install.rb +30 -0
- data/vendor/activerecord/lib/active_record.rb +81 -0
- data/vendor/activerecord/lib/active_record/aggregations.rb +261 -0
- data/vendor/activerecord/lib/active_record/association_preload.rb +374 -0
- data/vendor/activerecord/lib/active_record/associations.rb +2227 -0
- data/vendor/activerecord/lib/active_record/associations/association_collection.rb +453 -0
- data/vendor/activerecord/lib/active_record/associations/association_proxy.rb +272 -0
- data/vendor/activerecord/lib/active_record/associations/belongs_to_association.rb +58 -0
- data/vendor/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb +49 -0
- data/vendor/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +121 -0
- data/vendor/activerecord/lib/active_record/associations/has_many_association.rb +121 -0
- data/vendor/activerecord/lib/active_record/associations/has_many_through_association.rb +256 -0
- data/vendor/activerecord/lib/active_record/associations/has_one_association.rb +115 -0
- data/vendor/activerecord/lib/active_record/associations/has_one_through_association.rb +31 -0
- data/vendor/activerecord/lib/active_record/attribute_methods.rb +387 -0
- data/vendor/activerecord/lib/active_record/base.rb +2967 -0
- data/vendor/activerecord/lib/active_record/calculations.rb +299 -0
- data/vendor/activerecord/lib/active_record/callbacks.rb +331 -0
- data/vendor/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +355 -0
- data/vendor/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +136 -0
- data/vendor/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +201 -0
- data/vendor/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb +94 -0
- data/vendor/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +69 -0
- data/vendor/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +705 -0
- data/vendor/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +434 -0
- data/vendor/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +210 -0
- data/vendor/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +585 -0
- data/vendor/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +1065 -0
- data/vendor/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +34 -0
- data/vendor/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +418 -0
- data/vendor/activerecord/lib/active_record/dirty.rb +183 -0
- data/vendor/activerecord/lib/active_record/dynamic_finder_match.rb +41 -0
- data/vendor/activerecord/lib/active_record/fixtures.rb +998 -0
- data/vendor/activerecord/lib/active_record/i18n_interpolation_deprecation.rb +26 -0
- data/vendor/activerecord/lib/active_record/locale/en.yml +54 -0
- data/vendor/activerecord/lib/active_record/locking/optimistic.rb +148 -0
- data/vendor/activerecord/lib/active_record/locking/pessimistic.rb +77 -0
- data/vendor/activerecord/lib/active_record/migration.rb +560 -0
- data/vendor/activerecord/lib/active_record/named_scope.rb +181 -0
- data/vendor/activerecord/lib/active_record/observer.rb +197 -0
- data/vendor/activerecord/lib/active_record/query_cache.rb +21 -0
- data/vendor/activerecord/lib/active_record/reflection.rb +307 -0
- data/vendor/activerecord/lib/active_record/schema.rb +51 -0
- data/vendor/activerecord/lib/active_record/schema_dumper.rb +177 -0
- data/vendor/activerecord/lib/active_record/serialization.rb +98 -0
- data/vendor/activerecord/lib/active_record/serializers/json_serializer.rb +80 -0
- data/vendor/activerecord/lib/active_record/serializers/xml_serializer.rb +338 -0
- data/vendor/activerecord/lib/active_record/test_case.rb +60 -0
- data/vendor/activerecord/lib/active_record/timestamp.rb +41 -0
- data/vendor/activerecord/lib/active_record/transactions.rb +185 -0
- data/vendor/activerecord/lib/active_record/validations.rb +1061 -0
- data/vendor/activerecord/lib/active_record/version.rb +9 -0
- data/vendor/activerecord/lib/activerecord.rb +1 -0
- data/vendor/activerecord/test/assets/example.log +1 -0
- data/vendor/activerecord/test/assets/flowers.jpg +0 -0
- data/vendor/activerecord/test/cases/aaa_create_tables_test.rb +24 -0
- data/vendor/activerecord/test/cases/active_schema_test_mysql.rb +100 -0
- data/vendor/activerecord/test/cases/active_schema_test_postgresql.rb +24 -0
- data/vendor/activerecord/test/cases/adapter_test.rb +133 -0
- data/vendor/activerecord/test/cases/aggregations_test.rb +167 -0
- data/vendor/activerecord/test/cases/ar_schema_test.rb +33 -0
- data/vendor/activerecord/test/cases/associations/belongs_to_associations_test.rb +441 -0
- data/vendor/activerecord/test/cases/associations/callbacks_test.rb +161 -0
- data/vendor/activerecord/test/cases/associations/cascaded_eager_loading_test.rb +123 -0
- data/vendor/activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb +36 -0
- data/vendor/activerecord/test/cases/associations/eager_load_nested_include_test.rb +101 -0
- data/vendor/activerecord/test/cases/associations/eager_singularization_test.rb +145 -0
- data/vendor/activerecord/test/cases/associations/eager_test.rb +692 -0
- data/vendor/activerecord/test/cases/associations/extension_test.rb +62 -0
- data/vendor/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb +773 -0
- data/vendor/activerecord/test/cases/associations/has_many_associations_test.rb +1101 -0
- data/vendor/activerecord/test/cases/associations/has_many_through_associations_test.rb +247 -0
- data/vendor/activerecord/test/cases/associations/has_one_associations_test.rb +362 -0
- data/vendor/activerecord/test/cases/associations/has_one_through_associations_test.rb +161 -0
- data/vendor/activerecord/test/cases/associations/inner_join_association_test.rb +88 -0
- data/vendor/activerecord/test/cases/associations/join_model_test.rb +714 -0
- data/vendor/activerecord/test/cases/associations_test.rb +262 -0
- data/vendor/activerecord/test/cases/attribute_methods_test.rb +293 -0
- data/vendor/activerecord/test/cases/base_test.rb +2087 -0
- data/vendor/activerecord/test/cases/binary_test.rb +30 -0
- data/vendor/activerecord/test/cases/calculations_test.rb +328 -0
- data/vendor/activerecord/test/cases/callbacks_observers_test.rb +38 -0
- data/vendor/activerecord/test/cases/callbacks_test.rb +400 -0
- data/vendor/activerecord/test/cases/class_inheritable_attributes_test.rb +32 -0
- data/vendor/activerecord/test/cases/column_alias_test.rb +17 -0
- data/vendor/activerecord/test/cases/column_definition_test.rb +36 -0
- data/vendor/activerecord/test/cases/connection_test_firebird.rb +8 -0
- data/vendor/activerecord/test/cases/connection_test_mysql.rb +30 -0
- data/vendor/activerecord/test/cases/copy_table_test_sqlite.rb +69 -0
- data/vendor/activerecord/test/cases/database_statements_test.rb +12 -0
- data/vendor/activerecord/test/cases/datatype_test_postgresql.rb +203 -0
- data/vendor/activerecord/test/cases/date_time_test.rb +37 -0
- data/vendor/activerecord/test/cases/default_test_firebird.rb +16 -0
- data/vendor/activerecord/test/cases/defaults_test.rb +100 -0
- data/vendor/activerecord/test/cases/deprecated_finder_test.rb +30 -0
- data/vendor/activerecord/test/cases/dirty_test.rb +270 -0
- data/vendor/activerecord/test/cases/finder_respond_to_test.rb +76 -0
- data/vendor/activerecord/test/cases/finder_test.rb +1048 -0
- data/vendor/activerecord/test/cases/fixtures_test.rb +655 -0
- data/vendor/activerecord/test/cases/helper.rb +62 -0
- data/vendor/activerecord/test/cases/i18n_test.rb +41 -0
- data/vendor/activerecord/test/cases/inheritance_test.rb +262 -0
- data/vendor/activerecord/test/cases/invalid_date_test.rb +24 -0
- data/vendor/activerecord/test/cases/json_serialization_test.rb +205 -0
- data/vendor/activerecord/test/cases/lifecycle_test.rb +193 -0
- data/vendor/activerecord/test/cases/locking_test.rb +304 -0
- data/vendor/activerecord/test/cases/method_scoping_test.rb +569 -0
- data/vendor/activerecord/test/cases/migration_test.rb +1479 -0
- data/vendor/activerecord/test/cases/migration_test_firebird.rb +124 -0
- data/vendor/activerecord/test/cases/mixin_test.rb +96 -0
- data/vendor/activerecord/test/cases/modules_test.rb +39 -0
- data/vendor/activerecord/test/cases/multiple_db_test.rb +85 -0
- data/vendor/activerecord/test/cases/named_scope_test.rb +280 -0
- data/vendor/activerecord/test/cases/pk_test.rb +101 -0
- data/vendor/activerecord/test/cases/pooled_connections_test.rb +103 -0
- data/vendor/activerecord/test/cases/query_cache_test.rb +127 -0
- data/vendor/activerecord/test/cases/readonly_test.rb +107 -0
- data/vendor/activerecord/test/cases/reflection_test.rb +184 -0
- data/vendor/activerecord/test/cases/reload_models_test.rb +20 -0
- data/vendor/activerecord/test/cases/reserved_word_test_mysql.rb +176 -0
- data/vendor/activerecord/test/cases/sanitize_test.rb +25 -0
- data/vendor/activerecord/test/cases/schema_authorization_test_postgresql.rb +75 -0
- data/vendor/activerecord/test/cases/schema_dumper_test.rb +184 -0
- data/vendor/activerecord/test/cases/schema_test_postgresql.rb +102 -0
- data/vendor/activerecord/test/cases/serialization_test.rb +47 -0
- data/vendor/activerecord/test/cases/synonym_test_oracle.rb +17 -0
- data/vendor/activerecord/test/cases/transactions_test.rb +357 -0
- data/vendor/activerecord/test/cases/unconnected_test.rb +32 -0
- data/vendor/activerecord/test/cases/validations_i18n_test.rb +921 -0
- data/vendor/activerecord/test/cases/validations_test.rb +1552 -0
- data/vendor/activerecord/test/cases/xml_serialization_test.rb +202 -0
- data/vendor/activerecord/test/config.rb +5 -0
- data/vendor/activerecord/test/connections/native_db2/connection.rb +25 -0
- data/vendor/activerecord/test/connections/native_firebird/connection.rb +26 -0
- data/vendor/activerecord/test/connections/native_frontbase/connection.rb +27 -0
- data/vendor/activerecord/test/connections/native_mysql/connection.rb +25 -0
- data/vendor/activerecord/test/connections/native_openbase/connection.rb +21 -0
- data/vendor/activerecord/test/connections/native_oracle/connection.rb +27 -0
- data/vendor/activerecord/test/connections/native_postgresql/connection.rb +21 -0
- data/vendor/activerecord/test/connections/native_sqlite/connection.rb +25 -0
- data/vendor/activerecord/test/connections/native_sqlite3/connection.rb +25 -0
- data/vendor/activerecord/test/connections/native_sqlite3/in_memory_connection.rb +18 -0
- data/vendor/activerecord/test/connections/native_sybase/connection.rb +23 -0
- data/vendor/activerecord/test/fixtures/accounts.yml +28 -0
- data/vendor/activerecord/test/fixtures/all/developers.yml +0 -0
- data/vendor/activerecord/test/fixtures/all/people.csv +0 -0
- data/vendor/activerecord/test/fixtures/all/tasks.yml +0 -0
- data/vendor/activerecord/test/fixtures/author_addresses.yml +5 -0
- data/vendor/activerecord/test/fixtures/author_favorites.yml +4 -0
- data/vendor/activerecord/test/fixtures/authors.yml +9 -0
- data/vendor/activerecord/test/fixtures/binaries.yml +132 -0
- data/vendor/activerecord/test/fixtures/books.yml +7 -0
- data/vendor/activerecord/test/fixtures/categories.yml +14 -0
- data/vendor/activerecord/test/fixtures/categories/special_categories.yml +9 -0
- data/vendor/activerecord/test/fixtures/categories/subsubdir/arbitrary_filename.yml +4 -0
- data/vendor/activerecord/test/fixtures/categories_ordered.yml +7 -0
- data/vendor/activerecord/test/fixtures/categories_posts.yml +23 -0
- data/vendor/activerecord/test/fixtures/categorizations.yml +17 -0
- data/vendor/activerecord/test/fixtures/clubs.yml +6 -0
- data/vendor/activerecord/test/fixtures/comments.yml +59 -0
- data/vendor/activerecord/test/fixtures/companies.yml +56 -0
- data/vendor/activerecord/test/fixtures/computers.yml +4 -0
- data/vendor/activerecord/test/fixtures/courses.yml +7 -0
- data/vendor/activerecord/test/fixtures/customers.yml +26 -0
- data/vendor/activerecord/test/fixtures/developers.yml +21 -0
- data/vendor/activerecord/test/fixtures/developers_projects.yml +17 -0
- data/vendor/activerecord/test/fixtures/edges.yml +6 -0
- data/vendor/activerecord/test/fixtures/entrants.yml +14 -0
- data/vendor/activerecord/test/fixtures/fixture_database.sqlite3 +0 -0
- data/vendor/activerecord/test/fixtures/fixture_database_2.sqlite3 +0 -0
- data/vendor/activerecord/test/fixtures/fk_test_has_fk.yml +3 -0
- data/vendor/activerecord/test/fixtures/fk_test_has_pk.yml +2 -0
- data/vendor/activerecord/test/fixtures/funny_jokes.yml +10 -0
- data/vendor/activerecord/test/fixtures/items.yml +4 -0
- data/vendor/activerecord/test/fixtures/jobs.yml +7 -0
- data/vendor/activerecord/test/fixtures/legacy_things.yml +3 -0
- data/vendor/activerecord/test/fixtures/mateys.yml +4 -0
- data/vendor/activerecord/test/fixtures/members.yml +4 -0
- data/vendor/activerecord/test/fixtures/memberships.yml +20 -0
- data/vendor/activerecord/test/fixtures/minimalistics.yml +2 -0
- data/vendor/activerecord/test/fixtures/mixed_case_monkeys.yml +6 -0
- data/vendor/activerecord/test/fixtures/mixins.yml +29 -0
- data/vendor/activerecord/test/fixtures/movies.yml +7 -0
- data/vendor/activerecord/test/fixtures/naked/csv/accounts.csv +1 -0
- data/vendor/activerecord/test/fixtures/naked/yml/accounts.yml +1 -0
- data/vendor/activerecord/test/fixtures/naked/yml/companies.yml +1 -0
- data/vendor/activerecord/test/fixtures/naked/yml/courses.yml +1 -0
- data/vendor/activerecord/test/fixtures/organizations.yml +5 -0
- data/vendor/activerecord/test/fixtures/owners.yml +7 -0
- data/vendor/activerecord/test/fixtures/parrots.yml +27 -0
- data/vendor/activerecord/test/fixtures/parrots_pirates.yml +7 -0
- data/vendor/activerecord/test/fixtures/people.yml +6 -0
- data/vendor/activerecord/test/fixtures/pets.yml +14 -0
- data/vendor/activerecord/test/fixtures/pirates.yml +9 -0
- data/vendor/activerecord/test/fixtures/posts.yml +49 -0
- data/vendor/activerecord/test/fixtures/price_estimates.yml +7 -0
- data/vendor/activerecord/test/fixtures/projects.yml +7 -0
- data/vendor/activerecord/test/fixtures/readers.yml +9 -0
- data/vendor/activerecord/test/fixtures/references.yml +17 -0
- data/vendor/activerecord/test/fixtures/reserved_words/distinct.yml +5 -0
- data/vendor/activerecord/test/fixtures/reserved_words/distincts_selects.yml +11 -0
- data/vendor/activerecord/test/fixtures/reserved_words/group.yml +14 -0
- data/vendor/activerecord/test/fixtures/reserved_words/select.yml +8 -0
- data/vendor/activerecord/test/fixtures/reserved_words/values.yml +7 -0
- data/vendor/activerecord/test/fixtures/ships.yml +5 -0
- data/vendor/activerecord/test/fixtures/sponsors.yml +9 -0
- data/vendor/activerecord/test/fixtures/subscribers.yml +7 -0
- data/vendor/activerecord/test/fixtures/subscriptions.yml +12 -0
- data/vendor/activerecord/test/fixtures/taggings.yml +28 -0
- data/vendor/activerecord/test/fixtures/tags.yml +7 -0
- data/vendor/activerecord/test/fixtures/tasks.yml +7 -0
- data/vendor/activerecord/test/fixtures/topics.yml +42 -0
- data/vendor/activerecord/test/fixtures/treasures.yml +10 -0
- data/vendor/activerecord/test/fixtures/vertices.yml +4 -0
- data/vendor/activerecord/test/fixtures/warehouse-things.yml +3 -0
- data/vendor/activerecord/test/migrations/broken/100_migration_that_raises_exception.rb +10 -0
- data/vendor/activerecord/test/migrations/decimal/1_give_me_big_numbers.rb +15 -0
- data/vendor/activerecord/test/migrations/duplicate/1_people_have_last_names.rb +9 -0
- data/vendor/activerecord/test/migrations/duplicate/2_we_need_reminders.rb +12 -0
- data/vendor/activerecord/test/migrations/duplicate/3_foo.rb +7 -0
- data/vendor/activerecord/test/migrations/duplicate/3_innocent_jointable.rb +12 -0
- data/vendor/activerecord/test/migrations/duplicate_names/20080507052938_chunky.rb +7 -0
- data/vendor/activerecord/test/migrations/duplicate_names/20080507053028_chunky.rb +7 -0
- data/vendor/activerecord/test/migrations/interleaved/pass_1/3_innocent_jointable.rb +12 -0
- data/vendor/activerecord/test/migrations/interleaved/pass_2/1_people_have_last_names.rb +9 -0
- data/vendor/activerecord/test/migrations/interleaved/pass_2/3_innocent_jointable.rb +12 -0
- data/vendor/activerecord/test/migrations/interleaved/pass_3/1_people_have_last_names.rb +9 -0
- data/vendor/activerecord/test/migrations/interleaved/pass_3/2_i_raise_on_down.rb +8 -0
- data/vendor/activerecord/test/migrations/interleaved/pass_3/3_innocent_jointable.rb +12 -0
- data/vendor/activerecord/test/migrations/missing/1000_people_have_middle_names.rb +9 -0
- data/vendor/activerecord/test/migrations/missing/1_people_have_last_names.rb +9 -0
- data/vendor/activerecord/test/migrations/missing/3_we_need_reminders.rb +12 -0
- data/vendor/activerecord/test/migrations/missing/4_innocent_jointable.rb +12 -0
- data/vendor/activerecord/test/migrations/valid/1_people_have_last_names.rb +9 -0
- data/vendor/activerecord/test/migrations/valid/2_we_need_reminders.rb +12 -0
- data/vendor/activerecord/test/migrations/valid/3_innocent_jointable.rb +12 -0
- data/vendor/activerecord/test/models/author.rb +140 -0
- data/vendor/activerecord/test/models/auto_id.rb +4 -0
- data/vendor/activerecord/test/models/binary.rb +2 -0
- data/vendor/activerecord/test/models/book.rb +4 -0
- data/vendor/activerecord/test/models/categorization.rb +5 -0
- data/vendor/activerecord/test/models/category.rb +33 -0
- data/vendor/activerecord/test/models/citation.rb +6 -0
- data/vendor/activerecord/test/models/club.rb +13 -0
- data/vendor/activerecord/test/models/column_name.rb +3 -0
- data/vendor/activerecord/test/models/comment.rb +25 -0
- data/vendor/activerecord/test/models/company.rb +156 -0
- data/vendor/activerecord/test/models/company_in_module.rb +61 -0
- data/vendor/activerecord/test/models/computer.rb +3 -0
- data/vendor/activerecord/test/models/contact.rb +16 -0
- data/vendor/activerecord/test/models/course.rb +3 -0
- data/vendor/activerecord/test/models/customer.rb +73 -0
- data/vendor/activerecord/test/models/default.rb +2 -0
- data/vendor/activerecord/test/models/developer.rb +79 -0
- data/vendor/activerecord/test/models/edge.rb +5 -0
- data/vendor/activerecord/test/models/entrant.rb +3 -0
- data/vendor/activerecord/test/models/guid.rb +2 -0
- data/vendor/activerecord/test/models/item.rb +7 -0
- data/vendor/activerecord/test/models/job.rb +5 -0
- data/vendor/activerecord/test/models/joke.rb +3 -0
- data/vendor/activerecord/test/models/keyboard.rb +3 -0
- data/vendor/activerecord/test/models/legacy_thing.rb +3 -0
- data/vendor/activerecord/test/models/matey.rb +4 -0
- data/vendor/activerecord/test/models/member.rb +11 -0
- data/vendor/activerecord/test/models/member_detail.rb +4 -0
- data/vendor/activerecord/test/models/membership.rb +9 -0
- data/vendor/activerecord/test/models/minimalistic.rb +2 -0
- data/vendor/activerecord/test/models/mixed_case_monkey.rb +3 -0
- data/vendor/activerecord/test/models/movie.rb +5 -0
- data/vendor/activerecord/test/models/order.rb +4 -0
- data/vendor/activerecord/test/models/organization.rb +4 -0
- data/vendor/activerecord/test/models/owner.rb +4 -0
- data/vendor/activerecord/test/models/parrot.rb +14 -0
- data/vendor/activerecord/test/models/person.rb +10 -0
- data/vendor/activerecord/test/models/pet.rb +4 -0
- data/vendor/activerecord/test/models/pirate.rb +9 -0
- data/vendor/activerecord/test/models/post.rb +88 -0
- data/vendor/activerecord/test/models/price_estimate.rb +3 -0
- data/vendor/activerecord/test/models/project.rb +29 -0
- data/vendor/activerecord/test/models/reader.rb +4 -0
- data/vendor/activerecord/test/models/reference.rb +4 -0
- data/vendor/activerecord/test/models/reply.rb +39 -0
- data/vendor/activerecord/test/models/ship.rb +3 -0
- data/vendor/activerecord/test/models/sponsor.rb +4 -0
- data/vendor/activerecord/test/models/subject.rb +4 -0
- data/vendor/activerecord/test/models/subscriber.rb +8 -0
- data/vendor/activerecord/test/models/subscription.rb +4 -0
- data/vendor/activerecord/test/models/tag.rb +7 -0
- data/vendor/activerecord/test/models/tagging.rb +10 -0
- data/vendor/activerecord/test/models/task.rb +3 -0
- data/vendor/activerecord/test/models/topic.rb +69 -0
- data/vendor/activerecord/test/models/treasure.rb +6 -0
- data/vendor/activerecord/test/models/vertex.rb +9 -0
- data/vendor/activerecord/test/models/warehouse_thing.rb +5 -0
- data/vendor/activerecord/test/schema/mysql_specific_schema.rb +12 -0
- data/vendor/activerecord/test/schema/postgresql_specific_schema.rb +103 -0
- data/vendor/activerecord/test/schema/schema.rb +440 -0
- data/vendor/activerecord/test/schema/schema2.rb +6 -0
- data/vendor/activerecord/test/schema/sqlite_specific_schema.rb +25 -0
- data/vendor/activesupport/CHANGELOG +1257 -0
- data/vendor/activesupport/README +43 -0
- data/vendor/activesupport/lib/active_support.rb +61 -0
- data/vendor/activesupport/lib/active_support/base64.rb +33 -0
- data/vendor/activesupport/lib/active_support/basic_object.rb +24 -0
- data/vendor/activesupport/lib/active_support/buffered_logger.rb +122 -0
- data/vendor/activesupport/lib/active_support/cache.rb +223 -0
- data/vendor/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb +20 -0
- data/vendor/activesupport/lib/active_support/cache/drb_store.rb +15 -0
- data/vendor/activesupport/lib/active_support/cache/file_store.rb +72 -0
- data/vendor/activesupport/lib/active_support/cache/mem_cache_store.rb +127 -0
- data/vendor/activesupport/lib/active_support/cache/memory_store.rb +52 -0
- data/vendor/activesupport/lib/active_support/cache/synchronized_memory_store.rb +47 -0
- data/vendor/activesupport/lib/active_support/callbacks.rb +280 -0
- data/vendor/activesupport/lib/active_support/core_ext.rb +4 -0
- data/vendor/activesupport/lib/active_support/core_ext/array.rb +13 -0
- data/vendor/activesupport/lib/active_support/core_ext/array/access.rb +53 -0
- data/vendor/activesupport/lib/active_support/core_ext/array/conversions.rb +183 -0
- data/vendor/activesupport/lib/active_support/core_ext/array/extract_options.rb +20 -0
- data/vendor/activesupport/lib/active_support/core_ext/array/grouping.rb +106 -0
- data/vendor/activesupport/lib/active_support/core_ext/array/random_access.rb +12 -0
- data/vendor/activesupport/lib/active_support/core_ext/base64.rb +4 -0
- data/vendor/activesupport/lib/active_support/core_ext/base64/encoding.rb +16 -0
- data/vendor/activesupport/lib/active_support/core_ext/benchmark.rb +12 -0
- data/vendor/activesupport/lib/active_support/core_ext/bigdecimal.rb +6 -0
- data/vendor/activesupport/lib/active_support/core_ext/bigdecimal/conversions.rb +37 -0
- data/vendor/activesupport/lib/active_support/core_ext/blank.rb +58 -0
- data/vendor/activesupport/lib/active_support/core_ext/cgi.rb +5 -0
- data/vendor/activesupport/lib/active_support/core_ext/cgi/escape_skipping_slashes.rb +14 -0
- data/vendor/activesupport/lib/active_support/core_ext/class.rb +4 -0
- data/vendor/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb +54 -0
- data/vendor/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb +46 -0
- data/vendor/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb +140 -0
- data/vendor/activesupport/lib/active_support/core_ext/class/removal.rb +50 -0
- data/vendor/activesupport/lib/active_support/core_ext/date.rb +10 -0
- data/vendor/activesupport/lib/active_support/core_ext/date/behavior.rb +42 -0
- data/vendor/activesupport/lib/active_support/core_ext/date/calculations.rb +230 -0
- data/vendor/activesupport/lib/active_support/core_ext/date/conversions.rb +107 -0
- data/vendor/activesupport/lib/active_support/core_ext/date_time.rb +12 -0
- data/vendor/activesupport/lib/active_support/core_ext/date_time/calculations.rb +126 -0
- data/vendor/activesupport/lib/active_support/core_ext/date_time/conversions.rb +96 -0
- data/vendor/activesupport/lib/active_support/core_ext/duplicable.rb +43 -0
- data/vendor/activesupport/lib/active_support/core_ext/enumerable.rb +107 -0
- data/vendor/activesupport/lib/active_support/core_ext/exception.rb +41 -0
- data/vendor/activesupport/lib/active_support/core_ext/file.rb +5 -0
- data/vendor/activesupport/lib/active_support/core_ext/file/atomic.rb +46 -0
- data/vendor/activesupport/lib/active_support/core_ext/float.rb +7 -0
- data/vendor/activesupport/lib/active_support/core_ext/float/rounding.rb +24 -0
- data/vendor/activesupport/lib/active_support/core_ext/float/time.rb +27 -0
- data/vendor/activesupport/lib/active_support/core_ext/hash.rb +14 -0
- data/vendor/activesupport/lib/active_support/core_ext/hash/conversions.rb +259 -0
- data/vendor/activesupport/lib/active_support/core_ext/hash/deep_merge.rb +23 -0
- data/vendor/activesupport/lib/active_support/core_ext/hash/diff.rb +19 -0
- data/vendor/activesupport/lib/active_support/core_ext/hash/except.rb +25 -0
- data/vendor/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb +137 -0
- data/vendor/activesupport/lib/active_support/core_ext/hash/keys.rb +52 -0
- data/vendor/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb +35 -0
- data/vendor/activesupport/lib/active_support/core_ext/hash/slice.rb +33 -0
- data/vendor/activesupport/lib/active_support/core_ext/integer.rb +9 -0
- data/vendor/activesupport/lib/active_support/core_ext/integer/even_odd.rb +29 -0
- data/vendor/activesupport/lib/active_support/core_ext/integer/inflections.rb +20 -0
- data/vendor/activesupport/lib/active_support/core_ext/integer/time.rb +45 -0
- data/vendor/activesupport/lib/active_support/core_ext/kernel.rb +5 -0
- data/vendor/activesupport/lib/active_support/core_ext/kernel/agnostics.rb +11 -0
- data/vendor/activesupport/lib/active_support/core_ext/kernel/daemonizing.rb +7 -0
- data/vendor/activesupport/lib/active_support/core_ext/kernel/debugger.rb +13 -0
- data/vendor/activesupport/lib/active_support/core_ext/kernel/reporting.rb +59 -0
- data/vendor/activesupport/lib/active_support/core_ext/kernel/requires.rb +24 -0
- data/vendor/activesupport/lib/active_support/core_ext/load_error.rb +38 -0
- data/vendor/activesupport/lib/active_support/core_ext/logger.rb +143 -0
- data/vendor/activesupport/lib/active_support/core_ext/module.rb +23 -0
- data/vendor/activesupport/lib/active_support/core_ext/module/aliasing.rb +74 -0
- data/vendor/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb +31 -0
- data/vendor/activesupport/lib/active_support/core_ext/module/attr_internal.rb +32 -0
- data/vendor/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb +58 -0
- data/vendor/activesupport/lib/active_support/core_ext/module/delegation.rb +95 -0
- data/vendor/activesupport/lib/active_support/core_ext/module/inclusion.rb +30 -0
- data/vendor/activesupport/lib/active_support/core_ext/module/introspection.rb +90 -0
- data/vendor/activesupport/lib/active_support/core_ext/module/loading.rb +23 -0
- data/vendor/activesupport/lib/active_support/core_ext/module/model_naming.rb +23 -0
- data/vendor/activesupport/lib/active_support/core_ext/module/synchronization.rb +39 -0
- data/vendor/activesupport/lib/active_support/core_ext/name_error.rb +17 -0
- data/vendor/activesupport/lib/active_support/core_ext/numeric.rb +9 -0
- data/vendor/activesupport/lib/active_support/core_ext/numeric/bytes.rb +44 -0
- data/vendor/activesupport/lib/active_support/core_ext/numeric/conversions.rb +19 -0
- data/vendor/activesupport/lib/active_support/core_ext/numeric/time.rb +81 -0
- data/vendor/activesupport/lib/active_support/core_ext/object.rb +5 -0
- data/vendor/activesupport/lib/active_support/core_ext/object/conversions.rb +14 -0
- data/vendor/activesupport/lib/active_support/core_ext/object/extending.rb +80 -0
- data/vendor/activesupport/lib/active_support/core_ext/object/instance_variables.rb +74 -0
- data/vendor/activesupport/lib/active_support/core_ext/object/metaclass.rb +13 -0
- data/vendor/activesupport/lib/active_support/core_ext/object/misc.rb +74 -0
- data/vendor/activesupport/lib/active_support/core_ext/pathname.rb +7 -0
- data/vendor/activesupport/lib/active_support/core_ext/pathname/clean_within.rb +14 -0
- data/vendor/activesupport/lib/active_support/core_ext/proc.rb +12 -0
- data/vendor/activesupport/lib/active_support/core_ext/process.rb +1 -0
- data/vendor/activesupport/lib/active_support/core_ext/process/daemon.rb +25 -0
- data/vendor/activesupport/lib/active_support/core_ext/range.rb +11 -0
- data/vendor/activesupport/lib/active_support/core_ext/range/blockless_step.rb +32 -0
- data/vendor/activesupport/lib/active_support/core_ext/range/conversions.rb +27 -0
- data/vendor/activesupport/lib/active_support/core_ext/range/include_range.rb +30 -0
- data/vendor/activesupport/lib/active_support/core_ext/range/overlaps.rb +15 -0
- data/vendor/activesupport/lib/active_support/core_ext/rexml.rb +36 -0
- data/vendor/activesupport/lib/active_support/core_ext/string.rb +22 -0
- data/vendor/activesupport/lib/active_support/core_ext/string/access.rb +82 -0
- data/vendor/activesupport/lib/active_support/core_ext/string/behavior.rb +13 -0
- data/vendor/activesupport/lib/active_support/core_ext/string/conversions.rb +28 -0
- data/vendor/activesupport/lib/active_support/core_ext/string/filters.rb +26 -0
- data/vendor/activesupport/lib/active_support/core_ext/string/inflections.rb +167 -0
- data/vendor/activesupport/lib/active_support/core_ext/string/iterators.rb +21 -0
- data/vendor/activesupport/lib/active_support/core_ext/string/multibyte.rb +81 -0
- data/vendor/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb +35 -0
- data/vendor/activesupport/lib/active_support/core_ext/string/xchar.rb +11 -0
- data/vendor/activesupport/lib/active_support/core_ext/symbol.rb +14 -0
- data/vendor/activesupport/lib/active_support/core_ext/time.rb +42 -0
- data/vendor/activesupport/lib/active_support/core_ext/time/behavior.rb +13 -0
- data/vendor/activesupport/lib/active_support/core_ext/time/calculations.rb +303 -0
- data/vendor/activesupport/lib/active_support/core_ext/time/conversions.rb +90 -0
- data/vendor/activesupport/lib/active_support/core_ext/time/zones.rb +86 -0
- data/vendor/activesupport/lib/active_support/dependencies.rb +621 -0
- data/vendor/activesupport/lib/active_support/deprecation.rb +243 -0
- data/vendor/activesupport/lib/active_support/duration.rb +96 -0
- data/vendor/activesupport/lib/active_support/gzip.rb +25 -0
- data/vendor/activesupport/lib/active_support/inflections.rb +55 -0
- data/vendor/activesupport/lib/active_support/inflector.rb +397 -0
- data/vendor/activesupport/lib/active_support/json.rb +23 -0
- data/vendor/activesupport/lib/active_support/json/decoding.rb +63 -0
- data/vendor/activesupport/lib/active_support/json/encoders/date.rb +21 -0
- data/vendor/activesupport/lib/active_support/json/encoders/date_time.rb +21 -0
- data/vendor/activesupport/lib/active_support/json/encoders/enumerable.rb +12 -0
- data/vendor/activesupport/lib/active_support/json/encoders/false_class.rb +5 -0
- data/vendor/activesupport/lib/active_support/json/encoders/hash.rb +47 -0
- data/vendor/activesupport/lib/active_support/json/encoders/nil_class.rb +5 -0
- data/vendor/activesupport/lib/active_support/json/encoders/numeric.rb +5 -0
- data/vendor/activesupport/lib/active_support/json/encoders/object.rb +6 -0
- data/vendor/activesupport/lib/active_support/json/encoders/regexp.rb +5 -0
- data/vendor/activesupport/lib/active_support/json/encoders/string.rb +36 -0
- data/vendor/activesupport/lib/active_support/json/encoders/symbol.rb +5 -0
- data/vendor/activesupport/lib/active_support/json/encoders/time.rb +21 -0
- data/vendor/activesupport/lib/active_support/json/encoders/true_class.rb +5 -0
- data/vendor/activesupport/lib/active_support/json/encoding.rb +37 -0
- data/vendor/activesupport/lib/active_support/json/variable.rb +10 -0
- data/vendor/activesupport/lib/active_support/locale/en.yml +32 -0
- data/vendor/activesupport/lib/active_support/memoizable.rb +82 -0
- data/vendor/activesupport/lib/active_support/multibyte.rb +33 -0
- data/vendor/activesupport/lib/active_support/multibyte/chars.rb +679 -0
- data/vendor/activesupport/lib/active_support/multibyte/exceptions.rb +8 -0
- data/vendor/activesupport/lib/active_support/multibyte/unicode_database.rb +71 -0
- data/vendor/activesupport/lib/active_support/option_merger.rb +17 -0
- data/vendor/activesupport/lib/active_support/ordered_hash.rb +58 -0
- data/vendor/activesupport/lib/active_support/ordered_options.rb +19 -0
- data/vendor/activesupport/lib/active_support/rescuable.rb +108 -0
- data/vendor/activesupport/lib/active_support/secure_random.rb +197 -0
- data/vendor/activesupport/lib/active_support/string_inquirer.rb +21 -0
- data/vendor/activesupport/lib/active_support/test_case.rb +24 -0
- data/vendor/activesupport/lib/active_support/testing/core_ext/test.rb +6 -0
- data/vendor/activesupport/lib/active_support/testing/core_ext/test/unit/assertions.rb +72 -0
- data/vendor/activesupport/lib/active_support/testing/default.rb +9 -0
- data/vendor/activesupport/lib/active_support/testing/performance.rb +452 -0
- data/vendor/activesupport/lib/active_support/testing/setup_and_teardown.rb +120 -0
- data/vendor/activesupport/lib/active_support/time_with_zone.rb +328 -0
- data/vendor/activesupport/lib/active_support/values/time_zone.rb +403 -0
- data/vendor/activesupport/lib/active_support/values/unicode_tables.dat +0 -0
- data/vendor/activesupport/lib/active_support/vendor.rb +34 -0
- data/vendor/activesupport/lib/active_support/vendor/builder-2.1.2/blankslate.rb +113 -0
- data/vendor/activesupport/lib/active_support/vendor/builder-2.1.2/builder.rb +13 -0
- data/vendor/activesupport/lib/active_support/vendor/builder-2.1.2/builder/blankslate.rb +20 -0
- data/vendor/activesupport/lib/active_support/vendor/builder-2.1.2/builder/css.rb +250 -0
- data/vendor/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xchar.rb +115 -0
- data/vendor/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlbase.rb +139 -0
- data/vendor/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlevents.rb +63 -0
- data/vendor/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlmarkup.rb +328 -0
- data/vendor/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb +194 -0
- data/vendor/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb +216 -0
- data/vendor/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/exceptions.rb +53 -0
- data/vendor/activesupport/lib/active_support/vendor/memcache-client-1.5.1/memcache.rb +849 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo.rb +33 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/data_timezone.rb +47 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/data_timezone_info.rb +228 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Algiers.rb +55 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Cairo.rb +219 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Casablanca.rb +40 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Harare.rb +18 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Johannesburg.rb +25 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Monrovia.rb +22 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Nairobi.rb +23 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +166 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Argentina/San_Juan.rb +86 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Bogota.rb +23 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Caracas.rb +23 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Chicago.rb +283 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Chihuahua.rb +136 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Denver.rb +204 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Godthab.rb +161 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Guatemala.rb +27 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Halifax.rb +274 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Indiana/Indianapolis.rb +149 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Juneau.rb +194 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/La_Paz.rb +22 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Lima.rb +35 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Los_Angeles.rb +232 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Mazatlan.rb +139 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Mexico_City.rb +144 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Monterrey.rb +131 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/New_York.rb +282 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Phoenix.rb +30 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Regina.rb +74 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Santiago.rb +205 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Sao_Paulo.rb +171 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/St_Johns.rb +288 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Tijuana.rb +196 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Almaty.rb +67 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Baghdad.rb +73 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Baku.rb +161 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Bangkok.rb +20 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Chongqing.rb +33 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Colombo.rb +30 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Dhaka.rb +27 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Hong_Kong.rb +87 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Irkutsk.rb +165 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Jakarta.rb +30 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Jerusalem.rb +163 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Kabul.rb +20 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Kamchatka.rb +163 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Karachi.rb +30 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Katmandu.rb +20 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Kolkata.rb +25 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Krasnoyarsk.rb +163 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Kuala_Lumpur.rb +31 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Kuwait.rb +18 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Magadan.rb +163 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Muscat.rb +18 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Novosibirsk.rb +164 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Rangoon.rb +24 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Riyadh.rb +18 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Seoul.rb +34 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Shanghai.rb +35 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Singapore.rb +33 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Taipei.rb +59 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Tashkent.rb +47 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Tbilisi.rb +78 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Tehran.rb +121 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Tokyo.rb +30 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Ulaanbaatar.rb +65 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Urumqi.rb +33 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Vladivostok.rb +164 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Yakutsk.rb +163 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Yekaterinburg.rb +165 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Yerevan.rb +165 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Atlantic/Azores.rb +270 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Atlantic/Cape_Verde.rb +23 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Atlantic/South_Georgia.rb +18 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Adelaide.rb +187 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Brisbane.rb +35 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Darwin.rb +29 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Hobart.rb +193 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Melbourne.rb +185 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Perth.rb +37 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Sydney.rb +185 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Etc/UTC.rb +16 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Amsterdam.rb +228 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Athens.rb +185 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Belgrade.rb +163 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Berlin.rb +188 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Bratislava.rb +13 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Brussels.rb +232 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Bucharest.rb +181 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Budapest.rb +197 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Copenhagen.rb +179 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Dublin.rb +276 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Helsinki.rb +163 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Istanbul.rb +218 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Kiev.rb +168 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Lisbon.rb +268 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Ljubljana.rb +13 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/London.rb +288 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Madrid.rb +211 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Minsk.rb +170 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Moscow.rb +181 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Paris.rb +232 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Prague.rb +187 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Riga.rb +176 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Rome.rb +215 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Sarajevo.rb +13 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Skopje.rb +13 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Sofia.rb +173 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Stockholm.rb +165 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Tallinn.rb +172 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Vienna.rb +183 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Vilnius.rb +170 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Warsaw.rb +212 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Zagreb.rb +13 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Auckland.rb +202 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Fiji.rb +23 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Guam.rb +22 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Honolulu.rb +28 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Majuro.rb +20 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Midway.rb +25 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Noumea.rb +25 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Pago_Pago.rb +26 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Port_Moresby.rb +20 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Tongatapu.rb +27 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/info_timezone.rb +52 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/linked_timezone.rb +51 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/linked_timezone_info.rb +44 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/offset_rationals.rb +98 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/ruby_core_support.rb +56 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/time_or_datetime.rb +292 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone.rb +508 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_definition.rb +56 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_info.rb +40 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_offset_info.rb +94 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_period.rb +198 -0
- data/vendor/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_transition_info.rb +129 -0
- data/vendor/activesupport/lib/active_support/vendor/xml-simple-1.0.11/xmlsimple.rb +1021 -0
- data/vendor/activesupport/lib/active_support/version.rb +9 -0
- data/vendor/activesupport/lib/active_support/whiny_nil.rb +58 -0
- data/vendor/activesupport/lib/activesupport.rb +1 -0
- data/vendor/isaac/LICENSE +26 -0
- data/vendor/isaac/README +78 -0
- data/vendor/isaac/TODO +3 -0
- data/vendor/isaac/VERSIONS +3 -0
- data/vendor/isaac/crypt/ISAAC.rb +171 -0
- data/vendor/isaac/isaac.gemspec +39 -0
- data/vendor/isaac/setup.rb +596 -0
- data/vendor/isaac/test/TC_ISAAC.rb +76 -0
- data/vendor/json/CHANGES +93 -0
- data/vendor/json/GPL +340 -0
- data/vendor/json/README +78 -0
- data/vendor/json/RUBY +58 -0
- data/vendor/json/Rakefile +309 -0
- data/vendor/json/TODO +1 -0
- data/vendor/json/VERSION +1 -0
- data/vendor/json/benchmarks/benchmark.txt +133 -0
- data/vendor/json/benchmarks/benchmark_generator.rb +48 -0
- data/vendor/json/benchmarks/benchmark_parser.rb +26 -0
- data/vendor/json/benchmarks/benchmark_rails.rb +26 -0
- data/vendor/json/bin/edit_json.rb +10 -0
- data/vendor/json/bin/prettify_json.rb +76 -0
- data/vendor/json/data/example.json +1 -0
- data/vendor/json/data/index.html +38 -0
- data/vendor/json/data/prototype.js +4184 -0
- data/vendor/json/ext/json/ext/generator/extconf.rb +9 -0
- data/vendor/json/ext/json/ext/generator/generator.c +875 -0
- data/vendor/json/ext/json/ext/generator/unicode.c +182 -0
- data/vendor/json/ext/json/ext/generator/unicode.h +53 -0
- data/vendor/json/ext/json/ext/parser/extconf.rb +9 -0
- data/vendor/json/ext/json/ext/parser/parser.c +1758 -0
- data/vendor/json/ext/json/ext/parser/parser.rl +638 -0
- data/vendor/json/ext/json/ext/parser/unicode.c +154 -0
- data/vendor/json/ext/json/ext/parser/unicode.h +58 -0
- data/vendor/json/install.rb +26 -0
- data/vendor/json/lib/json.rb +235 -0
- data/vendor/json/lib/json/Array.xpm +21 -0
- data/vendor/json/lib/json/FalseClass.xpm +21 -0
- data/vendor/json/lib/json/Hash.xpm +21 -0
- data/vendor/json/lib/json/Key.xpm +73 -0
- data/vendor/json/lib/json/NilClass.xpm +21 -0
- data/vendor/json/lib/json/Numeric.xpm +28 -0
- data/vendor/json/lib/json/String.xpm +96 -0
- data/vendor/json/lib/json/TrueClass.xpm +21 -0
- data/vendor/json/lib/json/add/core.rb +135 -0
- data/vendor/json/lib/json/add/rails.rb +58 -0
- data/vendor/json/lib/json/common.rb +354 -0
- data/vendor/json/lib/json/editor.rb +1362 -0
- data/vendor/json/lib/json/ext.rb +13 -0
- data/vendor/json/lib/json/json.xpm +1499 -0
- data/vendor/json/lib/json/pure.rb +75 -0
- data/vendor/json/lib/json/pure/generator.rb +394 -0
- data/vendor/json/lib/json/pure/parser.rb +259 -0
- data/vendor/json/lib/json/version.rb +9 -0
- data/vendor/json/tests/fixtures/fail1.json +1 -0
- data/vendor/json/tests/fixtures/fail10.json +1 -0
- data/vendor/json/tests/fixtures/fail11.json +1 -0
- data/vendor/json/tests/fixtures/fail12.json +1 -0
- data/vendor/json/tests/fixtures/fail13.json +1 -0
- data/vendor/json/tests/fixtures/fail14.json +1 -0
- data/vendor/json/tests/fixtures/fail18.json +1 -0
- data/vendor/json/tests/fixtures/fail19.json +1 -0
- data/vendor/json/tests/fixtures/fail2.json +1 -0
- data/vendor/json/tests/fixtures/fail20.json +1 -0
- data/vendor/json/tests/fixtures/fail21.json +1 -0
- data/vendor/json/tests/fixtures/fail22.json +1 -0
- data/vendor/json/tests/fixtures/fail23.json +1 -0
- data/vendor/json/tests/fixtures/fail24.json +1 -0
- data/vendor/json/tests/fixtures/fail25.json +1 -0
- data/vendor/json/tests/fixtures/fail27.json +2 -0
- data/vendor/json/tests/fixtures/fail28.json +2 -0
- data/vendor/json/tests/fixtures/fail3.json +1 -0
- data/vendor/json/tests/fixtures/fail4.json +1 -0
- data/vendor/json/tests/fixtures/fail5.json +1 -0
- data/vendor/json/tests/fixtures/fail6.json +1 -0
- data/vendor/json/tests/fixtures/fail7.json +1 -0
- data/vendor/json/tests/fixtures/fail8.json +1 -0
- data/vendor/json/tests/fixtures/fail9.json +1 -0
- data/vendor/json/tests/fixtures/pass1.json +56 -0
- data/vendor/json/tests/fixtures/pass15.json +1 -0
- data/vendor/json/tests/fixtures/pass16.json +1 -0
- data/vendor/json/tests/fixtures/pass17.json +1 -0
- data/vendor/json/tests/fixtures/pass2.json +1 -0
- data/vendor/json/tests/fixtures/pass26.json +1 -0
- data/vendor/json/tests/fixtures/pass3.json +6 -0
- data/vendor/json/tests/runner.rb +25 -0
- data/vendor/json/tests/test_json.rb +293 -0
- data/vendor/json/tests/test_json_addition.rb +161 -0
- data/vendor/json/tests/test_json_fixtures.rb +30 -0
- data/vendor/json/tests/test_json_generate.rb +100 -0
- data/vendor/json/tests/test_json_rails.rb +118 -0
- data/vendor/json/tests/test_json_unicode.rb +61 -0
- data/vendor/json/tools/fuzz.rb +140 -0
- data/vendor/json/tools/server.rb +62 -0
- metadata +841 -0
@@ -0,0 +1,655 @@
|
|
1
|
+
require "cases/helper"
|
2
|
+
require 'models/post'
|
3
|
+
require 'models/binary'
|
4
|
+
require 'models/topic'
|
5
|
+
require 'models/computer'
|
6
|
+
require 'models/developer'
|
7
|
+
require 'models/company'
|
8
|
+
require 'models/task'
|
9
|
+
require 'models/reply'
|
10
|
+
require 'models/joke'
|
11
|
+
require 'models/course'
|
12
|
+
require 'models/category'
|
13
|
+
require 'models/parrot'
|
14
|
+
require 'models/pirate'
|
15
|
+
require 'models/treasure'
|
16
|
+
require 'models/matey'
|
17
|
+
require 'models/ship'
|
18
|
+
require 'models/book'
|
19
|
+
|
20
|
+
class FixturesTest < ActiveRecord::TestCase
|
21
|
+
self.use_instantiated_fixtures = true
|
22
|
+
self.use_transactional_fixtures = false
|
23
|
+
|
24
|
+
fixtures :topics, :developers, :accounts, :tasks, :categories, :funny_jokes, :binaries
|
25
|
+
|
26
|
+
FIXTURES = %w( accounts binaries companies customers
|
27
|
+
developers developers_projects entrants
|
28
|
+
movies projects subscribers topics tasks )
|
29
|
+
MATCH_ATTRIBUTE_NAME = /[a-zA-Z][-_\w]*/
|
30
|
+
|
31
|
+
def test_clean_fixtures
|
32
|
+
FIXTURES.each do |name|
|
33
|
+
fixtures = nil
|
34
|
+
assert_nothing_raised { fixtures = create_fixtures(name) }
|
35
|
+
assert_kind_of(Fixtures, fixtures)
|
36
|
+
fixtures.each { |name, fixture|
|
37
|
+
fixture.each { |key, value|
|
38
|
+
assert_match(MATCH_ATTRIBUTE_NAME, key)
|
39
|
+
}
|
40
|
+
}
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_multiple_clean_fixtures
|
45
|
+
fixtures_array = nil
|
46
|
+
assert_nothing_raised { fixtures_array = create_fixtures(*FIXTURES) }
|
47
|
+
assert_kind_of(Array, fixtures_array)
|
48
|
+
fixtures_array.each { |fixtures| assert_kind_of(Fixtures, fixtures) }
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_attributes
|
52
|
+
topics = create_fixtures("topics")
|
53
|
+
assert_equal("The First Topic", topics["first"]["title"])
|
54
|
+
assert_nil(topics["second"]["author_email_address"])
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_inserts
|
58
|
+
topics = create_fixtures("topics")
|
59
|
+
first_row = ActiveRecord::Base.connection.select_one("SELECT * FROM topics WHERE author_name = 'David'")
|
60
|
+
assert_equal("The First Topic", first_row["title"])
|
61
|
+
|
62
|
+
second_row = ActiveRecord::Base.connection.select_one("SELECT * FROM topics WHERE author_name = 'Mary'")
|
63
|
+
assert_nil(second_row["author_email_address"])
|
64
|
+
end
|
65
|
+
|
66
|
+
if ActiveRecord::Base.connection.supports_migrations?
|
67
|
+
def test_inserts_with_pre_and_suffix
|
68
|
+
# Reset cache to make finds on the new table work
|
69
|
+
Fixtures.reset_cache
|
70
|
+
|
71
|
+
ActiveRecord::Base.connection.create_table :prefix_topics_suffix do |t|
|
72
|
+
t.column :title, :string
|
73
|
+
t.column :author_name, :string
|
74
|
+
t.column :author_email_address, :string
|
75
|
+
t.column :written_on, :datetime
|
76
|
+
t.column :bonus_time, :time
|
77
|
+
t.column :last_read, :date
|
78
|
+
t.column :content, :string
|
79
|
+
t.column :approved, :boolean, :default => true
|
80
|
+
t.column :replies_count, :integer, :default => 0
|
81
|
+
t.column :parent_id, :integer
|
82
|
+
t.column :type, :string, :limit => 50
|
83
|
+
end
|
84
|
+
|
85
|
+
# Store existing prefix/suffix
|
86
|
+
old_prefix = ActiveRecord::Base.table_name_prefix
|
87
|
+
old_suffix = ActiveRecord::Base.table_name_suffix
|
88
|
+
|
89
|
+
# Set a prefix/suffix we can test against
|
90
|
+
ActiveRecord::Base.table_name_prefix = 'prefix_'
|
91
|
+
ActiveRecord::Base.table_name_suffix = '_suffix'
|
92
|
+
|
93
|
+
topics = create_fixtures("topics")
|
94
|
+
|
95
|
+
first_row = ActiveRecord::Base.connection.select_one("SELECT * FROM prefix_topics_suffix WHERE author_name = 'David'")
|
96
|
+
assert_equal("The First Topic", first_row["title"])
|
97
|
+
|
98
|
+
second_row = ActiveRecord::Base.connection.select_one("SELECT * FROM prefix_topics_suffix WHERE author_name = 'Mary'")
|
99
|
+
assert_nil(second_row["author_email_address"])
|
100
|
+
|
101
|
+
# This checks for a caching problem which causes a bug in the fixtures
|
102
|
+
# class-level configuration helper.
|
103
|
+
assert_not_nil topics, "Fixture data inserted, but fixture objects not returned from create"
|
104
|
+
ensure
|
105
|
+
# Restore prefix/suffix to its previous values
|
106
|
+
ActiveRecord::Base.table_name_prefix = old_prefix
|
107
|
+
ActiveRecord::Base.table_name_suffix = old_suffix
|
108
|
+
|
109
|
+
ActiveRecord::Base.connection.drop_table :prefix_topics_suffix rescue nil
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
def test_insert_with_datetime
|
114
|
+
topics = create_fixtures("tasks")
|
115
|
+
first = Task.find(1)
|
116
|
+
assert first
|
117
|
+
end
|
118
|
+
|
119
|
+
def test_logger_level_invariant
|
120
|
+
level = ActiveRecord::Base.logger.level
|
121
|
+
create_fixtures('topics')
|
122
|
+
assert_equal level, ActiveRecord::Base.logger.level
|
123
|
+
end
|
124
|
+
|
125
|
+
def test_instantiation
|
126
|
+
topics = create_fixtures("topics")
|
127
|
+
assert_kind_of Topic, topics["first"].find
|
128
|
+
end
|
129
|
+
|
130
|
+
def test_complete_instantiation
|
131
|
+
assert_equal 4, @topics.size
|
132
|
+
assert_equal "The First Topic", @first.title
|
133
|
+
end
|
134
|
+
|
135
|
+
def test_fixtures_from_root_yml_with_instantiation
|
136
|
+
# assert_equal 2, @accounts.size
|
137
|
+
assert_equal 50, @unknown.credit_limit
|
138
|
+
end
|
139
|
+
|
140
|
+
def test_erb_in_fixtures
|
141
|
+
assert_equal 11, @developers.size
|
142
|
+
assert_equal "fixture_5", @dev_5.name
|
143
|
+
end
|
144
|
+
|
145
|
+
def test_empty_yaml_fixture
|
146
|
+
assert_not_nil Fixtures.new( Account.connection, "accounts", 'Account', FIXTURES_ROOT + "/naked/yml/accounts")
|
147
|
+
end
|
148
|
+
|
149
|
+
def test_empty_yaml_fixture_with_a_comment_in_it
|
150
|
+
assert_not_nil Fixtures.new( Account.connection, "companies", 'Company', FIXTURES_ROOT + "/naked/yml/companies")
|
151
|
+
end
|
152
|
+
|
153
|
+
def test_dirty_dirty_yaml_file
|
154
|
+
assert_raises(Fixture::FormatError) do
|
155
|
+
Fixtures.new( Account.connection, "courses", 'Course', FIXTURES_ROOT + "/naked/yml/courses")
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
def test_empty_csv_fixtures
|
160
|
+
assert_not_nil Fixtures.new( Account.connection, "accounts", 'Account', FIXTURES_ROOT + "/naked/csv/accounts")
|
161
|
+
end
|
162
|
+
|
163
|
+
def test_omap_fixtures
|
164
|
+
assert_nothing_raised do
|
165
|
+
fixtures = Fixtures.new(Account.connection, 'categories', 'Category', FIXTURES_ROOT + "/categories_ordered")
|
166
|
+
|
167
|
+
i = 0
|
168
|
+
fixtures.each do |name, fixture|
|
169
|
+
assert_equal "fixture_no_#{i}", name
|
170
|
+
assert_equal "Category #{i}", fixture['name']
|
171
|
+
i += 1
|
172
|
+
end
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
def test_yml_file_in_subdirectory
|
177
|
+
assert_equal(categories(:sub_special_1).name, "A special category in a subdir file")
|
178
|
+
assert_equal(categories(:sub_special_1).class, SpecialCategory)
|
179
|
+
end
|
180
|
+
|
181
|
+
def test_subsubdir_file_with_arbitrary_name
|
182
|
+
assert_equal(categories(:sub_special_3).name, "A special category in an arbitrarily named subsubdir file")
|
183
|
+
assert_equal(categories(:sub_special_3).class, SpecialCategory)
|
184
|
+
end
|
185
|
+
|
186
|
+
def test_binary_in_fixtures
|
187
|
+
assert_equal 1, @binaries.size
|
188
|
+
data = File.read(ASSETS_ROOT + "/flowers.jpg")
|
189
|
+
data.force_encoding('ASCII-8BIT') if data.respond_to?(:force_encoding)
|
190
|
+
data.freeze
|
191
|
+
assert_equal data, @flowers.data
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
if Account.connection.respond_to?(:reset_pk_sequence!)
|
196
|
+
class FixturesResetPkSequenceTest < ActiveRecord::TestCase
|
197
|
+
fixtures :accounts
|
198
|
+
fixtures :companies
|
199
|
+
|
200
|
+
def setup
|
201
|
+
@instances = [Account.new(:credit_limit => 50), Company.new(:name => 'RoR Consulting')]
|
202
|
+
Fixtures.reset_cache # make sure tables get reinitialized
|
203
|
+
end
|
204
|
+
|
205
|
+
def test_resets_to_min_pk_with_specified_pk_and_sequence
|
206
|
+
@instances.each do |instance|
|
207
|
+
model = instance.class
|
208
|
+
model.delete_all
|
209
|
+
model.connection.reset_pk_sequence!(model.table_name, model.primary_key, model.sequence_name)
|
210
|
+
|
211
|
+
instance.save!
|
212
|
+
assert_equal 1, instance.id, "Sequence reset for #{model.table_name} failed."
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
def test_resets_to_min_pk_with_default_pk_and_sequence
|
217
|
+
@instances.each do |instance|
|
218
|
+
model = instance.class
|
219
|
+
model.delete_all
|
220
|
+
model.connection.reset_pk_sequence!(model.table_name)
|
221
|
+
|
222
|
+
instance.save!
|
223
|
+
assert_equal 1, instance.id, "Sequence reset for #{model.table_name} failed."
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
def test_create_fixtures_resets_sequences_when_not_cached
|
228
|
+
@instances.each do |instance|
|
229
|
+
max_id = create_fixtures(instance.class.table_name).inject(0) do |max_id, (name, fixture)|
|
230
|
+
fixture_id = fixture['id'].to_i
|
231
|
+
fixture_id > max_id ? fixture_id : max_id
|
232
|
+
end
|
233
|
+
|
234
|
+
# Clone the last fixture to check that it gets the next greatest id.
|
235
|
+
instance.save!
|
236
|
+
assert_equal max_id + 1, instance.id, "Sequence reset for #{instance.class.table_name} failed."
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
class FixturesWithoutInstantiationTest < ActiveRecord::TestCase
|
243
|
+
self.use_instantiated_fixtures = false
|
244
|
+
fixtures :topics, :developers, :accounts
|
245
|
+
|
246
|
+
def test_without_complete_instantiation
|
247
|
+
assert_nil @first
|
248
|
+
assert_nil @topics
|
249
|
+
assert_nil @developers
|
250
|
+
assert_nil @accounts
|
251
|
+
end
|
252
|
+
|
253
|
+
def test_fixtures_from_root_yml_without_instantiation
|
254
|
+
assert_nil @unknown
|
255
|
+
end
|
256
|
+
|
257
|
+
def test_accessor_methods
|
258
|
+
assert_equal "The First Topic", topics(:first).title
|
259
|
+
assert_equal "Jamis", developers(:jamis).name
|
260
|
+
assert_equal 50, accounts(:signals37).credit_limit
|
261
|
+
end
|
262
|
+
|
263
|
+
def test_accessor_methods_with_multiple_args
|
264
|
+
assert_equal 2, topics(:first, :second).size
|
265
|
+
assert_raise(StandardError) { topics([:first, :second]) }
|
266
|
+
end
|
267
|
+
|
268
|
+
uses_mocha 'reloading_fixtures_through_accessor_methods' do
|
269
|
+
def test_reloading_fixtures_through_accessor_methods
|
270
|
+
assert_equal "The First Topic", topics(:first).title
|
271
|
+
@loaded_fixtures['topics']['first'].expects(:find).returns(stub(:title => "Fresh Topic!"))
|
272
|
+
assert_equal "Fresh Topic!", topics(:first, true).title
|
273
|
+
end
|
274
|
+
end
|
275
|
+
end
|
276
|
+
|
277
|
+
class FixturesWithoutInstanceInstantiationTest < ActiveRecord::TestCase
|
278
|
+
self.use_instantiated_fixtures = true
|
279
|
+
self.use_instantiated_fixtures = :no_instances
|
280
|
+
|
281
|
+
fixtures :topics, :developers, :accounts
|
282
|
+
|
283
|
+
def test_without_instance_instantiation
|
284
|
+
assert_nil @first
|
285
|
+
assert_not_nil @topics
|
286
|
+
assert_not_nil @developers
|
287
|
+
assert_not_nil @accounts
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
291
|
+
class TransactionalFixturesTest < ActiveRecord::TestCase
|
292
|
+
self.use_instantiated_fixtures = true
|
293
|
+
self.use_transactional_fixtures = true
|
294
|
+
|
295
|
+
fixtures :topics
|
296
|
+
|
297
|
+
def test_destroy
|
298
|
+
assert_not_nil @first
|
299
|
+
@first.destroy
|
300
|
+
end
|
301
|
+
|
302
|
+
def test_destroy_just_kidding
|
303
|
+
assert_not_nil @first
|
304
|
+
end
|
305
|
+
end
|
306
|
+
|
307
|
+
class MultipleFixturesTest < ActiveRecord::TestCase
|
308
|
+
fixtures :topics
|
309
|
+
fixtures :developers, :accounts
|
310
|
+
|
311
|
+
def test_fixture_table_names
|
312
|
+
assert_equal %w(topics developers accounts), fixture_table_names
|
313
|
+
end
|
314
|
+
end
|
315
|
+
|
316
|
+
class SetupTest < ActiveRecord::TestCase
|
317
|
+
# fixtures :topics
|
318
|
+
|
319
|
+
def setup
|
320
|
+
@first = true
|
321
|
+
end
|
322
|
+
|
323
|
+
def test_nothing
|
324
|
+
end
|
325
|
+
end
|
326
|
+
|
327
|
+
class SetupSubclassTest < SetupTest
|
328
|
+
def setup
|
329
|
+
super
|
330
|
+
@second = true
|
331
|
+
end
|
332
|
+
|
333
|
+
def test_subclassing_should_preserve_setups
|
334
|
+
assert @first
|
335
|
+
assert @second
|
336
|
+
end
|
337
|
+
end
|
338
|
+
|
339
|
+
|
340
|
+
class OverlappingFixturesTest < ActiveRecord::TestCase
|
341
|
+
fixtures :topics, :developers
|
342
|
+
fixtures :developers, :accounts
|
343
|
+
|
344
|
+
def test_fixture_table_names
|
345
|
+
assert_equal %w(topics developers accounts), fixture_table_names
|
346
|
+
end
|
347
|
+
end
|
348
|
+
|
349
|
+
class ForeignKeyFixturesTest < ActiveRecord::TestCase
|
350
|
+
fixtures :fk_test_has_pk, :fk_test_has_fk
|
351
|
+
|
352
|
+
# if foreign keys are implemented and fixtures
|
353
|
+
# are not deleted in reverse order then this test
|
354
|
+
# case will raise StatementInvalid
|
355
|
+
|
356
|
+
def test_number1
|
357
|
+
assert true
|
358
|
+
end
|
359
|
+
|
360
|
+
def test_number2
|
361
|
+
assert true
|
362
|
+
end
|
363
|
+
end
|
364
|
+
|
365
|
+
class CheckSetTableNameFixturesTest < ActiveRecord::TestCase
|
366
|
+
set_fixture_class :funny_jokes => 'Joke'
|
367
|
+
fixtures :funny_jokes
|
368
|
+
# Set to false to blow away fixtures cache and ensure our fixtures are loaded
|
369
|
+
# and thus takes into account our set_fixture_class
|
370
|
+
self.use_transactional_fixtures = false
|
371
|
+
|
372
|
+
def test_table_method
|
373
|
+
assert_kind_of Joke, funny_jokes(:a_joke)
|
374
|
+
end
|
375
|
+
end
|
376
|
+
|
377
|
+
class FixtureNameIsNotTableNameFixturesTest < ActiveRecord::TestCase
|
378
|
+
set_fixture_class :items => Book
|
379
|
+
fixtures :items
|
380
|
+
# Set to false to blow away fixtures cache and ensure our fixtures are loaded
|
381
|
+
# and thus takes into account our set_fixture_class
|
382
|
+
self.use_transactional_fixtures = false
|
383
|
+
|
384
|
+
def test_named_accessor
|
385
|
+
assert_kind_of Book, items(:dvd)
|
386
|
+
end
|
387
|
+
end
|
388
|
+
|
389
|
+
class FixtureNameIsNotTableNameMultipleFixturesTest < ActiveRecord::TestCase
|
390
|
+
set_fixture_class :items => Book, :funny_jokes => Joke
|
391
|
+
fixtures :items, :funny_jokes
|
392
|
+
# Set to false to blow away fixtures cache and ensure our fixtures are loaded
|
393
|
+
# and thus takes into account our set_fixture_class
|
394
|
+
self.use_transactional_fixtures = false
|
395
|
+
|
396
|
+
def test_named_accessor_of_differently_named_fixture
|
397
|
+
assert_kind_of Book, items(:dvd)
|
398
|
+
end
|
399
|
+
|
400
|
+
def test_named_accessor_of_same_named_fixture
|
401
|
+
assert_kind_of Joke, funny_jokes(:a_joke)
|
402
|
+
end
|
403
|
+
end
|
404
|
+
|
405
|
+
class CustomConnectionFixturesTest < ActiveRecord::TestCase
|
406
|
+
set_fixture_class :courses => Course
|
407
|
+
fixtures :courses
|
408
|
+
# Set to false to blow away fixtures cache and ensure our fixtures are loaded
|
409
|
+
# and thus takes into account our set_fixture_class
|
410
|
+
self.use_transactional_fixtures = false
|
411
|
+
|
412
|
+
def test_connection
|
413
|
+
assert_kind_of Course, courses(:ruby)
|
414
|
+
assert_equal Course.connection, courses(:ruby).connection
|
415
|
+
end
|
416
|
+
end
|
417
|
+
|
418
|
+
class InvalidTableNameFixturesTest < ActiveRecord::TestCase
|
419
|
+
fixtures :funny_jokes
|
420
|
+
# Set to false to blow away fixtures cache and ensure our fixtures are loaded
|
421
|
+
# and thus takes into account our lack of set_fixture_class
|
422
|
+
self.use_transactional_fixtures = false
|
423
|
+
|
424
|
+
def test_raises_error
|
425
|
+
assert_raises FixtureClassNotFound do
|
426
|
+
funny_jokes(:a_joke)
|
427
|
+
end
|
428
|
+
end
|
429
|
+
end
|
430
|
+
|
431
|
+
class CheckEscapedYamlFixturesTest < ActiveRecord::TestCase
|
432
|
+
set_fixture_class :funny_jokes => 'Joke'
|
433
|
+
fixtures :funny_jokes
|
434
|
+
# Set to false to blow away fixtures cache and ensure our fixtures are loaded
|
435
|
+
# and thus takes into account our set_fixture_class
|
436
|
+
self.use_transactional_fixtures = false
|
437
|
+
|
438
|
+
def test_proper_escaped_fixture
|
439
|
+
assert_equal "The \\n Aristocrats\nAte the candy\n", funny_jokes(:another_joke).name
|
440
|
+
end
|
441
|
+
end
|
442
|
+
|
443
|
+
class DevelopersProject; end
|
444
|
+
class ManyToManyFixturesWithClassDefined < ActiveRecord::TestCase
|
445
|
+
fixtures :developers_projects
|
446
|
+
|
447
|
+
def test_this_should_run_cleanly
|
448
|
+
assert true
|
449
|
+
end
|
450
|
+
end
|
451
|
+
|
452
|
+
class FixturesBrokenRollbackTest < ActiveRecord::TestCase
|
453
|
+
def blank_setup; end
|
454
|
+
alias_method :ar_setup_fixtures, :setup_fixtures
|
455
|
+
alias_method :setup_fixtures, :blank_setup
|
456
|
+
alias_method :setup, :blank_setup
|
457
|
+
|
458
|
+
def blank_teardown; end
|
459
|
+
alias_method :ar_teardown_fixtures, :teardown_fixtures
|
460
|
+
alias_method :teardown_fixtures, :blank_teardown
|
461
|
+
alias_method :teardown, :blank_teardown
|
462
|
+
|
463
|
+
def test_no_rollback_in_teardown_unless_transaction_active
|
464
|
+
assert_equal 0, ActiveRecord::Base.connection.open_transactions
|
465
|
+
assert_raise(RuntimeError) { ar_setup_fixtures }
|
466
|
+
assert_equal 0, ActiveRecord::Base.connection.open_transactions
|
467
|
+
assert_nothing_raised { ar_teardown_fixtures }
|
468
|
+
assert_equal 0, ActiveRecord::Base.connection.open_transactions
|
469
|
+
end
|
470
|
+
|
471
|
+
private
|
472
|
+
def load_fixtures
|
473
|
+
raise 'argh'
|
474
|
+
end
|
475
|
+
end
|
476
|
+
|
477
|
+
class LoadAllFixturesTest < ActiveRecord::TestCase
|
478
|
+
self.fixture_path = FIXTURES_ROOT + "/all"
|
479
|
+
fixtures :all
|
480
|
+
|
481
|
+
def test_all_there
|
482
|
+
assert_equal %w(developers people tasks), fixture_table_names.sort
|
483
|
+
end
|
484
|
+
end
|
485
|
+
|
486
|
+
class FasterFixturesTest < ActiveRecord::TestCase
|
487
|
+
fixtures :categories, :authors
|
488
|
+
|
489
|
+
def load_extra_fixture(name)
|
490
|
+
fixture = create_fixtures(name)
|
491
|
+
assert fixture.is_a?(Fixtures)
|
492
|
+
@loaded_fixtures[fixture.table_name] = fixture
|
493
|
+
end
|
494
|
+
|
495
|
+
def test_cache
|
496
|
+
assert Fixtures.fixture_is_cached?(ActiveRecord::Base.connection, 'categories')
|
497
|
+
assert Fixtures.fixture_is_cached?(ActiveRecord::Base.connection, 'authors')
|
498
|
+
|
499
|
+
assert_no_queries do
|
500
|
+
create_fixtures('categories')
|
501
|
+
create_fixtures('authors')
|
502
|
+
end
|
503
|
+
|
504
|
+
load_extra_fixture('posts')
|
505
|
+
assert Fixtures.fixture_is_cached?(ActiveRecord::Base.connection, 'posts')
|
506
|
+
self.class.setup_fixture_accessors('posts')
|
507
|
+
assert_equal 'Welcome to the weblog', posts(:welcome).title
|
508
|
+
end
|
509
|
+
end
|
510
|
+
|
511
|
+
class FoxyFixturesTest < ActiveRecord::TestCase
|
512
|
+
fixtures :parrots, :parrots_pirates, :pirates, :treasures, :mateys, :ships, :computers, :developers
|
513
|
+
|
514
|
+
def test_identifies_strings
|
515
|
+
assert_equal(Fixtures.identify("foo"), Fixtures.identify("foo"))
|
516
|
+
assert_not_equal(Fixtures.identify("foo"), Fixtures.identify("FOO"))
|
517
|
+
end
|
518
|
+
|
519
|
+
def test_identifies_symbols
|
520
|
+
assert_equal(Fixtures.identify(:foo), Fixtures.identify(:foo))
|
521
|
+
end
|
522
|
+
|
523
|
+
TIMESTAMP_COLUMNS = %w(created_at created_on updated_at updated_on)
|
524
|
+
|
525
|
+
def test_populates_timestamp_columns
|
526
|
+
TIMESTAMP_COLUMNS.each do |property|
|
527
|
+
assert_not_nil(parrots(:george).send(property), "should set #{property}")
|
528
|
+
end
|
529
|
+
end
|
530
|
+
|
531
|
+
def test_does_not_populate_timestamp_columns_if_model_has_set_record_timestamps_to_false
|
532
|
+
TIMESTAMP_COLUMNS.each do |property|
|
533
|
+
assert_nil(ships(:black_pearl).send(property), "should not set #{property}")
|
534
|
+
end
|
535
|
+
end
|
536
|
+
|
537
|
+
def test_populates_all_columns_with_the_same_time
|
538
|
+
last = nil
|
539
|
+
|
540
|
+
TIMESTAMP_COLUMNS.each do |property|
|
541
|
+
current = parrots(:george).send(property)
|
542
|
+
last ||= current
|
543
|
+
|
544
|
+
assert_equal(last, current)
|
545
|
+
last = current
|
546
|
+
end
|
547
|
+
end
|
548
|
+
|
549
|
+
def test_only_populates_columns_that_exist
|
550
|
+
assert_not_nil(pirates(:blackbeard).created_on)
|
551
|
+
assert_not_nil(pirates(:blackbeard).updated_on)
|
552
|
+
end
|
553
|
+
|
554
|
+
def test_preserves_existing_fixture_data
|
555
|
+
assert_equal(2.weeks.ago.to_date, pirates(:redbeard).created_on.to_date)
|
556
|
+
assert_equal(2.weeks.ago.to_date, pirates(:redbeard).updated_on.to_date)
|
557
|
+
end
|
558
|
+
|
559
|
+
def test_generates_unique_ids
|
560
|
+
assert_not_nil(parrots(:george).id)
|
561
|
+
assert_not_equal(parrots(:george).id, parrots(:louis).id)
|
562
|
+
end
|
563
|
+
|
564
|
+
def test_automatically_sets_primary_key
|
565
|
+
assert_not_nil(ships(:black_pearl))
|
566
|
+
end
|
567
|
+
|
568
|
+
def test_preserves_existing_primary_key
|
569
|
+
assert_equal(2, ships(:interceptor).id)
|
570
|
+
end
|
571
|
+
|
572
|
+
def test_resolves_belongs_to_symbols
|
573
|
+
assert_equal(parrots(:george), pirates(:blackbeard).parrot)
|
574
|
+
end
|
575
|
+
|
576
|
+
def test_ignores_belongs_to_symbols_if_association_and_foreign_key_are_named_the_same
|
577
|
+
assert_equal(developers(:david), computers(:workstation).developer)
|
578
|
+
end
|
579
|
+
|
580
|
+
def test_supports_join_tables
|
581
|
+
assert(pirates(:blackbeard).parrots.include?(parrots(:george)))
|
582
|
+
assert(pirates(:blackbeard).parrots.include?(parrots(:louis)))
|
583
|
+
assert(parrots(:george).pirates.include?(pirates(:blackbeard)))
|
584
|
+
end
|
585
|
+
|
586
|
+
def test_supports_inline_habtm
|
587
|
+
assert(parrots(:george).treasures.include?(treasures(:diamond)))
|
588
|
+
assert(parrots(:george).treasures.include?(treasures(:sapphire)))
|
589
|
+
assert(!parrots(:george).treasures.include?(treasures(:ruby)))
|
590
|
+
end
|
591
|
+
|
592
|
+
def test_supports_inline_habtm_with_specified_id
|
593
|
+
assert(parrots(:polly).treasures.include?(treasures(:ruby)))
|
594
|
+
assert(parrots(:polly).treasures.include?(treasures(:sapphire)))
|
595
|
+
assert(!parrots(:polly).treasures.include?(treasures(:diamond)))
|
596
|
+
end
|
597
|
+
|
598
|
+
def test_supports_yaml_arrays
|
599
|
+
assert(parrots(:louis).treasures.include?(treasures(:diamond)))
|
600
|
+
assert(parrots(:louis).treasures.include?(treasures(:sapphire)))
|
601
|
+
end
|
602
|
+
|
603
|
+
def test_strips_DEFAULTS_key
|
604
|
+
assert_raise(StandardError) { parrots(:DEFAULTS) }
|
605
|
+
|
606
|
+
# this lets us do YAML defaults and not have an extra fixture entry
|
607
|
+
%w(sapphire ruby).each { |t| assert(parrots(:davey).treasures.include?(treasures(t))) }
|
608
|
+
end
|
609
|
+
|
610
|
+
def test_supports_label_interpolation
|
611
|
+
assert_equal("frederick", parrots(:frederick).name)
|
612
|
+
end
|
613
|
+
|
614
|
+
def test_supports_polymorphic_belongs_to
|
615
|
+
assert_equal(pirates(:redbeard), treasures(:sapphire).looter)
|
616
|
+
assert_equal(parrots(:louis), treasures(:ruby).looter)
|
617
|
+
end
|
618
|
+
|
619
|
+
def test_only_generates_a_pk_if_necessary
|
620
|
+
m = Matey.find(:first)
|
621
|
+
m.pirate = pirates(:blackbeard)
|
622
|
+
m.target = pirates(:redbeard)
|
623
|
+
end
|
624
|
+
|
625
|
+
def test_supports_sti
|
626
|
+
assert_kind_of DeadParrot, parrots(:polly)
|
627
|
+
assert_equal pirates(:blackbeard), parrots(:polly).killer
|
628
|
+
end
|
629
|
+
end
|
630
|
+
|
631
|
+
class ActiveSupportSubclassWithFixturesTest < ActiveRecord::TestCase
|
632
|
+
fixtures :parrots
|
633
|
+
|
634
|
+
# This seemingly useless assertion catches a bug that caused the fixtures
|
635
|
+
# setup code call nil[]
|
636
|
+
def test_foo
|
637
|
+
assert_equal parrots(:louis), Parrot.find_by_name("King Louis")
|
638
|
+
end
|
639
|
+
end
|
640
|
+
|
641
|
+
class FixtureLoadingTest < ActiveRecord::TestCase
|
642
|
+
uses_mocha 'reloading_fixtures_through_accessor_methods' do
|
643
|
+
def test_logs_message_for_failed_dependency_load
|
644
|
+
Test::Unit::TestCase.expects(:require_dependency).with(:does_not_exist).raises(LoadError)
|
645
|
+
ActiveRecord::Base.logger.expects(:warn)
|
646
|
+
Test::Unit::TestCase.try_to_load_dependency(:does_not_exist)
|
647
|
+
end
|
648
|
+
|
649
|
+
def test_does_not_logs_message_for_successful_dependency_load
|
650
|
+
Test::Unit::TestCase.expects(:require_dependency).with(:works_out_fine)
|
651
|
+
ActiveRecord::Base.logger.expects(:warn).never
|
652
|
+
Test::Unit::TestCase.try_to_load_dependency(:works_out_fine)
|
653
|
+
end
|
654
|
+
end
|
655
|
+
end
|