New object bug in unit tests?

Hi all,

Can anyone tell me why when I do an Organization.new in the console all
string objects are nil whereas when I do an Organization.new in my unit
test all the strings are ‘’ which is a string of length 2?

Needless to say this is royally screwing up my validations.

Thanks,

Brent

Check that your test database is in sync with the development one.

rake db:test:prepare

-Jonathan.

Hi Jonathan,

Thanks for the tip. I tried your suggestion and still had the problem.
After much head scratching, etc I discovered that Sqlite 3.3.8 on
Windows is not playing nice with Rails. I went back to Sqlite 3.3.6 and
it worked fine. So for some reason, Sqlite 3.3.8/Rails is setting
default values for EVERY field and the string default values are
incorrectly set as ‘’ (two single quotes - string length 2).

I guess that’s why we have unit tests!

Thanks again,

Brent

Jonathan V. wrote:

Check that your test database is in sync with the development one.

rake db:test:prepare

-Jonathan.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs