This project is archived and is in readonly mode.

#2983 ✓stale
Karl Doody

nil vs "" error in activerecord test

Reported by Karl Doody | August 1st, 2009 @ 11:06 AM

Fresh Rails checkout, this test fails with the following error: http://pastie.org/567717

1) Failure: test\_polymorphic\_assignment\_with\_primary\_key\_updates\_foreign\_id\_field\_for\_new\_and\_saved\_records(BelongsToAssociationsTest)<br/>

[./test/cases/associations/belongs_to_associations_test.rb:415:in 'test_polymorphic_assignment_with_primary_key_updates_foreign_id_field_for_new_and_saved_records'
 ./test/cases/../../lib/../../activemodel/lib/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in '__send__'
 ./test/cases/../../lib/../../activemodel/lib/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in 'run']:

expected but was
<"">.

My setup:

$ mysql --version

mysql Ver 14.12 Distrib 5.0.41, for apple-darwin8.11.1 (i686) using EditLine wrapper (MAMP)

$ sw_vers

ProductName: Mac OS X ProductVersion: 10.5.7<br/> BuildVersion: 9J61

Comments and changes to this ticket

  • Karl Doody

    Karl Doody August 1st, 2009 @ 11:15 AM

    mikeg1a on #railsbridge reports the same error, different test and setup though:

    test_nil_defaults_for_not_null_columns
    http://gist.github.com/159628

    mysql Ver 14.14 Distrib 5.1.28-rc, for apple-darwin9.4.0 (i686) using readline 5.1

  • Zac Williams

    Zac Williams August 4th, 2009 @ 04:15 AM

    • Tag changed from 2.3.x, activerecord, active_record, fail, mysql, test to 2.3.x, activerecord, active_record, fail, mysql, patch, test

    In activerecord/test/schema/schema.rb you will see that the :name attribute in defined for the :authors has the :null => false property. I have corrected the test in the attached patch.

  • Zac Williams

    Zac Williams August 4th, 2009 @ 04:16 AM

    • Tag changed from 2.3.x, activerecord, active_record, fail, mysql, patch, test to 2.3.x, activerecord, active_record, fail, mysql, patch, test, tested

    previously promised patch.

  • Erik Ostrom

    Erik Ostrom August 9th, 2009 @ 10:01 PM

    Verified on mysql Ver 14.12 Distrib 5.0.45, for apple-darwin8.5.1 (i686) using readline 5.0

    With the current patch, the test succeeds on MySQL, but now it fails on SQLite3.

  • Rohit Arondekar

    Rohit Arondekar October 6th, 2010 @ 06:47 AM

    • State changed from “new” to “stale”
    • Importance changed from “” to “”

    Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Pages