Permalink
Browse files

Extract AR::Persistence#becomes's test code out from base_test.rb

The method got extracted out from AR::Base in commit
d916c62, but the tests never did.
  • Loading branch information...
1 parent 43168bd commit 5e3de2f50d328f596c5a674e856ba217406c424e @take take committed May 22, 2013
Showing with 13 additions and 13 deletions.
  1. +0 −13 activerecord/test/cases/base_test.rb
  2. +13 −0 activerecord/test/cases/persistence_test.rb
@@ -1228,19 +1228,6 @@ def test_assert_queries
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
@@ -139,6 +139,19 @@ def test_destroy_many
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])

0 comments on commit 5e3de2f

Please sign in to comment.