test env. differs from development env, tests breaking

I just got a new PC at work. My project files were copied from my old
drive. Just to be sure, though, I have erased them and pulled them back
down from source control.

My development database server is MySQL
My test database server is sqlite3

I am having a confusing issue: tests are failing and errors are
happening that weren't happening before. Furthermore, they aren't
happening on other developer's boxes.

Most of the failing tests seem to involve verifying that validations
are working. Take the example of check details:

    create_table( :check_details ) do |t|
      t.column( :check_id, :integer )
      t.column( :description, :string )
      t.column( :amount_in_cents, :integer )
      #t.column( :account_to_credit_id, :integer )
      #t.column( :account_to_debit_id, :integer )

    add_index( :check_details, :check_id )

Now from test/unit/check_detail_test.rb,

    # validates_presence_of :check_id

    cd = CheckDetail.new(
      :amount => 21.21,
      :description => "Services Rendered"

    assert(!cd.save, "Shouldn't be able to save this like this here

This fails when I run tests, but when I do it in development, I get the
correct result.


Take a look at config/environment.rb and look at the following lines:

   # Use SQL instead of Active Record's schema dumper when creating the test database.
   # This is necessary if your schema can't be completely dumped by the schema dumper,
   # like if you have constraints or database-specific column types
   # config.active_record.schema_format = :sql

If you overrode this to be "config.active_record.schema_format = :ruby" then change it back to :sql. The ability to use ruby as an database-independent description language can lead to the type of problem you are experiencing.

If you are using sql (i.e. accepted the default) then I'm stumped.