diff options
author | Takehiro Adachi <takehiro0740@gmail.com> | 2013-05-22 12:30:35 +0900 |
---|---|---|
committer | Takehiro Adachi <takehiro0740@gmail.com> | 2013-05-22 12:30:35 +0900 |
commit | 5e3de2f50d328f596c5a674e856ba217406c424e (patch) | |
tree | 513ae1474f67c2c087b4d609aa2563774dbf5c0a /activerecord | |
parent | 43168bd1a107692fb27cb7d3f99c0049e979ed80 (diff) | |
download | rails-5e3de2f50d328f596c5a674e856ba217406c424e.tar.gz rails-5e3de2f50d328f596c5a674e856ba217406c424e.tar.bz2 rails-5e3de2f50d328f596c5a674e856ba217406c424e.zip |
Extract AR::Persistence#becomes's test code out from base_test.rb
The method got extracted out from AR::Base in commit
d916c62cfc7c59ab6411407a05b946d3dd7535e9, but the tests never did.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 13 | ||||
-rw-r--r-- | activerecord/test/cases/persistence_test.rb | 13 |
2 files changed, 13 insertions, 13 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 86528e2100..56b417562b 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1228,19 +1228,6 @@ class BasicsTest < ActiveRecord::TestCase assert_no_queries { assert true } end - def test_becomes - assert_kind_of Reply, topics(:first).becomes(Reply) - 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 diff --git a/activerecord/test/cases/persistence_test.rb b/activerecord/test/cases/persistence_test.rb index c4a72ed3bc..30dc2a34c6 100644 --- a/activerecord/test/cases/persistence_test.rb +++ b/activerecord/test/cases/persistence_test.rb @@ -139,6 +139,19 @@ class PersistenceTest < ActiveRecord::TestCase end end + def test_becomes + assert_kind_of Reply, topics(:first).becomes(Reply) + 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_delete_many original_count = Topic.count Topic.delete(deleting = [1, 2]) |