提交 8f8dfa48 编写于 作者: Y Yves Senn

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
上级 60bd2432
...@@ -14,6 +14,7 @@ def setup ...@@ -14,6 +14,7 @@ def setup
teardown do teardown do
connection.drop_table :testings rescue nil connection.drop_table :testings rescue nil
ActiveRecord::Base.primary_key_prefix_type = nil ActiveRecord::Base.primary_key_prefix_type = nil
ActiveRecord::Base.clear_cache!
end end
def test_create_table_without_id def test_create_table_without_id
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册