提交 f9f0f038 编写于 作者: P Piotr Sarnacki

Fix railties tests

SchemaMigration model is loaded on rails initialization,
which means that it will not be cleaned on each request.
上级 b164e81c
......@@ -63,7 +63,7 @@ class User < ActiveRecord::Base
assert ::AppTemplate::Application.config.loaded
end
test "descendants are cleaned on each request without cache classes" do
test "descendants loaded after framework initialization are cleaned on each request without cache classes" do
add_to_config <<-RUBY
config.cache_classes = false
config.reload_classes_only_on_change = false
......@@ -87,11 +87,11 @@ class Post < ActiveRecord::Base
require "#{rails_root}/config/environment"
setup_ar!
assert_equal [], ActiveRecord::Base.descendants
assert_equal [ActiveRecord::SchemaMigration], ActiveRecord::Base.descendants
get "/load"
assert_equal [Post], ActiveRecord::Base.descendants
assert_equal [ActiveRecord::SchemaMigration, Post], ActiveRecord::Base.descendants
get "/unload"
assert_equal [], ActiveRecord::Base.descendants
assert_equal [ActiveRecord::SchemaMigration], ActiveRecord::Base.descendants
end
test "initialize_cant_be_called_twice" do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册