diff options
author | José Valim <jose.valim@gmail.com> | 2010-06-29 19:47:04 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-29 19:50:09 +0200 |
commit | 67582f08bf86ec71a27363554bc550e929a007f7 (patch) | |
tree | 08d32373ddb44f7033779ca0b60ccefed3f3cfb0 /railties/test | |
parent | 7ea85ff516df142b60126e2dcc1174fd0b8f85a9 (diff) | |
download | rails-67582f08bf86ec71a27363554bc550e929a007f7.tar.gz rails-67582f08bf86ec71a27363554bc550e929a007f7.tar.bz2 rails-67582f08bf86ec71a27363554bc550e929a007f7.zip |
Push a failing test for issues [#4994] and [#5003].
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/loading_test.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/railties/test/application/loading_test.rb b/railties/test/application/loading_test.rb index b337d3fc6e..340ce67511 100644 --- a/railties/test/application/loading_test.rb +++ b/railties/test/application/loading_test.rb @@ -12,7 +12,7 @@ class LoadingTest < Test::Unit::TestCase @app ||= Rails.application end - def test_load_should_load_constants + def test_constants_in_app_are_autoloaded app_file "app/models/post.rb", <<-MODEL class Post < ActiveRecord::Base validates_acceptance_of :title, :accept => "omg" @@ -29,6 +29,19 @@ class LoadingTest < Test::Unit::TestCase assert_equal 'omg', p.title end + def test_models_without_table_do_not_panic_on_scope_definitions_when_loaded + app_file "app/models/user.rb", <<-MODEL + class User < ActiveRecord::Base + default_scope where(:published => true) + end + MODEL + + require "#{rails_root}/config/environment" + setup_ar! + + User + end + def test_descendants_are_cleaned_on_each_request_without_cache_classes add_to_config <<-RUBY config.cache_classes = false |