diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-11-16 15:23:44 -0800 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-11-16 15:23:44 -0800 |
commit | 540e929d75616feab3dc456b7a6bd616909d9684 (patch) | |
tree | 0100820aa72a8bc5e80bd3f0cb6c2a9826ac04a7 /activerecord/test/cases/base_test.rb | |
parent | a152fd34d3eb0e4980c4a44dd1f71510890c5417 (diff) | |
parent | 73cb0f98289923c8fa0287bf1cc8857664078d43 (diff) | |
download | rails-540e929d75616feab3dc456b7a6bd616909d9684.tar.gz rails-540e929d75616feab3dc456b7a6bd616909d9684.tar.bz2 rails-540e929d75616feab3dc456b7a6bd616909d9684.zip |
Merge pull request #3438 from lazyatom/becomes-includes-errors
Becomes includes errors
Diffstat (limited to 'activerecord/test/cases/base_test.rb')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index fdb656fe13..997c9e7e9d 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1761,6 +1761,14 @@ class BasicsTest < ActiveRecord::TestCase assert_equal "The First Topic", topics(:first).becomes(Reply).title end + def test_becomes_includes_errors + company = Company.new(:name => nil) + assert !company.valid? + original_errors = company.errors + client = company.becomes(Client) + assert_equal original_errors, client.errors + end + def test_silence_sets_log_level_to_error_in_block original_logger = ActiveRecord::Base.logger log = StringIO.new |