Permalink
Browse files

fix `rake test_sqlite3_mem`.

While running Sqlite3 memory tests I encountered the following error:

```
Finished in 69.416366s, 58.0267 runs/s, 162.3681 assertions/s.

  1) Error:
ActiveRecord::Migration::ChangeSchemaTest#test_add_column_with_timestamp_type:
NoMethodError: undefined method `type' for nil:NilClass
    /Users/senny/Projects/rails/activerecord/test/cases/migration/change_schema_test.rb:244:in `test_add_column_with_timestamp_type'

4028 runs, 11271 assertions, 0 failures, 1 errors, 1 skips
```

This was because the table `testings` was used in multiple test-cases.
This resulted in a wrongly cached schema on `ActiveRecord::Base.schema_chae`.

/cc @zuhao
  • Loading branch information...
1 parent 60bd243 commit 8f8dfa488a7c20196d597cab6b9eb4ddaaa597c2 @senny senny committed May 20, 2014
Showing with 1 addition and 0 deletions.
  1. +1 −0 activerecord/test/cases/migration/change_schema_test.rb
@@ -14,6 +14,7 @@ def setup
teardown do
connection.drop_table :testings rescue nil
ActiveRecord::Base.primary_key_prefix_type = nil
+ ActiveRecord::Base.clear_cache!
end
def test_create_table_without_id

0 comments on commit 8f8dfa4

Please sign in to comment.