mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix railties tests
SchemaMigration model is loaded on rails initialization, which means that it will not be cleaned on each request.
This commit is contained in:
parent
b164e81c11
commit
f9f0f03822
1 changed files with 4 additions and 4 deletions
|
@ -63,7 +63,7 @@ class LoadingTest < ActiveSupport::TestCase
|
|||
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 LoadingTest < ActiveSupport::TestCase
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue