# New problems with ActiveRecord tests

**URL:** <https://www.ruby-forum.com/t/new-problems-with-activerecord-tests/169834>\
**Category:** Rails\
**Created:** [June 9, 2009, 12:25pm UTC](https://www.ruby-forum.com/t/new-problems-with-activerecord-tests/169834 "2009-06-09T12:25:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ffrancy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ecd19e/32.png) [@ffrancy](https://www.ruby-forum.com/u/ffrancy)\
**Post date:** [June 9, 2009, 12:25pm UTC](https://www.ruby-forum.com/t/new-problems-with-activerecord-tests/169834/1 "2009-06-09T12:25:02Z")

</div>

I tried to use ActiveRecord 2.3.2, opened ad as a Ruby project with  
existing source, to run its tests and they worked but with this  
following errors:

Finished in 71.143069 seconds.

1. Failure:  
test\_add\_limit\_offset\_should\_sanitize\_sql\_injection\_for\_limit\_with\_comas(AdapterTest)  
[test/cases/adapter\_test.rb:129:in  
`test_add_limit_offset_should_sanitize_sql_injection_for_limit_with_comas' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in`run’]:  
\<" LIMIT 1,7"\> expected but was  
\<" LIMIT 1, 7 procedure help()"\>.

2. Failure:  
test\_add\_limit\_offset\_should\_sanitize\_sql\_injection\_for\_limit\_without\_comas(AdapterTest)  
[test/cases/adapter\_test.rb:115:in  
`test_add_limit_offset_should_sanitize_sql_injection_for_limit_without_comas' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in`run’]:  
\<" LIMIT 1"\> expected but was  
\<" LIMIT 1 select \* from schema"\>.

3. Failure:  
test\_read\_attributes\_before\_type\_cast\_on\_datetime(BasicsTest)  
[test/cases/base\_test.rb:148:in  
`test_read_attributes_before_type_cast_on_datetime' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in`run’]:  
\<“2009-06-09 09:29:03”\> expected but was  
\<“2009-06-09 09:29:03.0”\>.

4. Failure:  
test\_update\_all\_with\_order\_and\_limit\_updates\_subset\_only(BasicsTest)  
[test/cases/base\_test.rb:693:in  
`test_update_all_with_order_and_limit_updates_subset_only' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in`run’]:  
Exception raised:  
Class: ActiveRecord::StatementInvalid  
Message: \<“ActiveRecord::ActiveRecordError: This version of MySQL  
doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME subquery’: UPDATE `posts`  
SET body = ‘bulk update!’ WHERE `id` IN (SELECT `id` FROM `posts` WHERE  
(`posts`.author\_id = 1) ORDER BY posts.id LIMIT 1)”\>  
—Backtrace—  
./test/cases/…/…/lib/active\_record/connection\_adapters/abstract\_adapter.rb:212:in  
`log' /home/ffrancy/.gem/jruby/1.8/gems/activerecord-jdbc-adapter-0.9.1/lib/active_record/connection_adapters/jdbc_adapter.rb:563:in`execute’  
./test/cases/helper.rb:37:in `execute_with_query_record' /home/ffrancy/.gem/jruby/1.8/gems/activerecord-jdbc-adapter-0.9.1/lib/active_record/connection_adapters/jdbc_adapter.rb:582:in`jdbc\_update’  
./test/cases/…/…/lib/active\_record/connection\_adapters/abstract/query\_cache.rb:25:in  
`update_with_query_dirty' ./test/cases/../../lib/active_record/base.rb:852:in`update\_all’  
./test/cases/…/…/lib/active\_record/associations/association\_collection.rb:375:in  
`method_missing' ./test/cases/../../lib/active_record/base.rb:2148:in`with\_scope’  
./test/cases/…/…/lib/active\_record/associations/association\_proxy.rb:206:in  
`with_scope' ./test/cases/../../lib/active_record/associations/association_collection.rb:371:in`method\_missing’  
test/cases/base\_test.rb:696:in  
`test_update_all_with_order_and_limit_updates_subset_only' test/cases/base_test.rb:693:in`test\_update\_all\_with\_order\_and\_limit\_updates\_subset\_only’  
./test/cases/…/…/…/activesupport/lib/active\_support/testing/setup\_and\_teardown.rb:62:in  
`run’

* * *

1. Failure:  
test\_integer\_creates\_integer\_column(ChangeTableMigrationsTest)  
[(eval):16:in `integer' (eval):5:in`each’  
(eval):5:in `integer' test/cases/migration_test.rb:1399:in`test\_integer\_creates\_integer\_column’  
test/cases/migration\_test.rb:1491:in `with_change_table' ./test/cases/../../lib/active_record/connection_adapters/abstract/schema_statements.rb:175:in`change\_table’  
test/cases/migration\_test.rb:1490:in `with_change_table' test/cases/migration_test.rb:1396:in`test\_integer\_creates\_integer\_column’  
./test/cases/…/…/…/activesupport/lib/active\_support/testing/setup\_and\_teardown.rb:62:in  
`run’]:  
unexpected invocation:  
#ActiveRecord::ConnectionAdapters::JdbcAdapter:0x18b8.add\_column(:delete\_me,  
:foo, ‘integer(10)’, {})  
unsatisfied expectations:

- expected exactly once, not yet invoked:  
#ActiveRecord::ConnectionAdapters::JdbcAdapter:0x18b8.add\_column(:delete\_me,  
:bar, ‘integer’, {})

- expected exactly once, not yet invoked:  
#ActiveRecord::ConnectionAdapters::JdbcAdapter:0x18b8.add\_column(:delete\_me,  
:foo, ‘integer’, {})

* * *

1. Failure:  
test\_count\_queries\_with\_cache(QueryCacheTest)  
[./test/cases/…/…/lib/active\_record/test\_case.rb:31:in  
`assert_queries' test/cases/query_cache_test.rb:25:in`test\_count\_queries\_with\_cache’  
./test/cases/…/…/lib/active\_record/connection\_adapters/abstract/query\_cache.rb:34:in  
`cache' ./test/cases/../../lib/active_record/query_cache.rb:9:in`cache’  
test/cases/query\_cache\_test.rb:24:in  
`test_count_queries_with_cache' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in`run’]:  
2 instead of 1 queries were executed.  
Queries:  
SELECT count(_) AS count\_all FROM `tasks`  
SELECT count(_) AS count\_all FROM `tasks` .  
\<1\> expected but was  
\<2\>.

2. Failure:  
test\_schema\_dump\_includes\_limit\_constraint\_for\_integer\_columns(SchemaDumperTest)  
[test/cases/schema\_dumper\_test.rb:113:in  
`test_schema_dump_includes_limit_constraint_for_integer_columns' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in`run’]:  
\<"# This file is auto-generated from the current state of the database.  
Instead of editing this file, \n# please use the migrations feature of  
Active Record to incrementally modify your database, and\n# then  
regenerate this schema definition.\n#\n# Note that this schema.rb  
definition is the authoritative source for your database schema. If you  
need\n# to create the application database on another system, you should  
be using db:schema:load, not running\n# all the migrations from scratch.  
The latter is a flawed and unsustainable approach (the more  
migrations\n# you’ll amass, the slower it’ll run and the greater  
likelihood for issues).\n#\n# It’s strongly recommended to check this  
file into your version control  
system.\n\nActiveRecord::Schema.define(:version =\> 0) do\n\n  
create\_table “integer\_limits”, :force =\> true do |t|\n t.integer  
“c\_int\_without\_limit”\n t.integer “c\_int\_1”, :limit  
=\> 1\n t.integer “c\_int\_2”, :limit =\> 2\n t.integer  
“c\_int\_3”, :limit =\> 3\n t.integer “c\_int\_4”,  
:limit =\> 4\n t.integer “c\_int\_5”, :limit =\> 5\n  
t.integer “c\_int\_6”, :limit =\> 6\n t.integer  
“c\_int\_7”, :limit =\> 7\n t.integer “c\_int\_8”,  
:limit =\> 8\n end\n\nend\n"\> expected to be =~  
\</c\_int\_5.\*:limit =\> 8/\>.

3. Failure:  
test\_underlying\_adapter\_no\_longer\_active(TestUnconnectedAdapter)  
[test/cases/unconnected\_test.rb:30:in  
`test_underlying_adapter_no_longer_active' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in`run’]:  
Removed adapter should no longer be active.  
 is not true.

4. Failure:  
test\_optionally\_validates\_length\_of\_using\_within\_on\_create\_utf8(ValidationsTest)  
[test/cases/validations\_test.rb:1074:in  
`test_optionally_validates_length_of_using_within_on_create_utf8' ./test/cases/../../lib/active_record/test_case.rb:57:in`with\_kcode’  
test/cases/validations\_test.rb:1065:in  
`test_optionally_validates_length_of_using_within_on_create_utf8' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in`run’]:  
 is not true.

5. Failure:  
test\_optionally\_validates\_length\_of\_using\_within\_on\_update\_utf8(ValidationsTest)  
[test/cases/validations\_test.rb:1092:in  
`test_optionally_validates_length_of_using_within_on_update_utf8' ./test/cases/../../lib/active_record/test_case.rb:57:in`with\_kcode’  
test/cases/validations\_test.rb:1088:in  
`test_optionally_validates_length_of_using_within_on_update_utf8' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in`run’]:  
 is not true.

6. Failure:  
test\_optionally\_validates\_length\_of\_using\_within\_utf8(ValidationsTest)  
[test/cases/validations\_test.rb:1054:in  
`test_optionally_validates_length_of_using_within_utf8' ./test/cases/../../lib/active_record/test_case.rb:57:in`with\_kcode’  
test/cases/validations\_test.rb:1050:in  
`test_optionally_validates_length_of_using_within_utf8' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in`run’]:  
#\<ActiveRecord::Errors:0x512bcf @errors={“title”=\>[“is too long (maximum  
is 5 characters)”]}, @base=#\<Topic id: nil, title: “ä¸€äºŒä¸‰å››äº””, author\_name:  
nil, author\_email\_address: “removed\_email\_address@domain.invalid”, written\_on: nil, bonus\_time:  
nil, last\_read: nil, content: nil, approved: true, replies\_count: 0,  
parent\_id: nil, type: nil\>\>.  
 is not true.

7. Failure:  
test\_validate\_case\_sensitive\_uniqueness(ValidationsTest)  
[test/cases/validations\_test.rb:485:in  
`test_validate_case_sensitive_uniqueness' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in`run’]:  
Should be valid.  
 is not true.

8. Failure:  
test\_validates\_length\_of\_using\_is\_utf8(ValidationsTest)  
[test/cases/validations\_test.rb:1114:in  
`test_validates_length_of_using_is_utf8' ./test/cases/../../lib/active_record/test_case.rb:57:in`with\_kcode’  
test/cases/validations\_test.rb:1110:in  
`test_validates_length_of_using_is_utf8' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in`run’]:  
 is not true.

9. Failure:  
test\_validates\_length\_of\_using\_maximum\_utf8(ValidationsTest)  
[test/cases/validations\_test.rb:1026:in  
`test_validates_length_of_using_maximum_utf8' ./test/cases/../../lib/active_record/test_case.rb:57:in`with\_kcode’  
test/cases/validations\_test.rb:1022:in  
`test_validates_length_of_using_maximum_utf8' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in`run’]:  
 is not true.

10. Failure:  
test\_validates\_length\_of\_using\_minimum\_utf8(ValidationsTest)  
[test/cases/validations\_test.rb:1015:in  
`test_validates_length_of_using_minimum_utf8' ./test/cases/../../lib/active_record/test_case.rb:57:in`with\_kcode’  
test/cases/validations\_test.rb:1008:in  
`test_validates_length_of_using_minimum_utf8' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in`run’]:  
 is not true.

11. Failure:  
test\_validates\_length\_of\_using\_within\_utf8(ValidationsTest)  
[test/cases/validations\_test.rb:1041:in  
`test_validates_length_of_using_within_utf8' ./test/cases/../../lib/active_record/test_case.rb:57:in`with\_kcode’  
test/cases/validations\_test.rb:1036:in  
`test_validates_length_of_using_within_utf8' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in`run’]:  
\<“is too short (minimum is 3 characters)”\> expected but was  
\<“is too long (maximum is 5 characters)”\>.

2013 tests, 6503 assertions, 19 failures, 1 errors  
rake aborted!  
Command failed with status (1): [/opt/jruby/bin/jruby  
-Ilib:test:test/conne…]

I have to say that I’m using JRuby 1.6, Glassfish V 3 Prelude, Rails  
2.2.2 and NetBeans IDE.

How can I make everything work?  
Do I have to upgrade something?

And also, if I have to use rails 2.3.2, how can I make it work with  
glassfish?

Thanks a lot!!!
