From 43168bd1a107692fb27cb7d3f99c0049e979ed80 Mon Sep 17 00:00:00 2001 From: Takehiro Adachi Date: Wed, 22 May 2013 02:32:37 +0900 Subject: Extract AR::AttributeMethods#attribute_for_inspect's test code out from base_test.rb The method itself got extracted out from ActiveRecored::Base in commit ceb33f84933639d3b61aac62e5e71fd087ab65ed, but the test code never did. --- activerecord/test/cases/attribute_methods_test.rb | 8 ++++++++ activerecord/test/cases/base_test.rb | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index f10732ddda..ee0150558d 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -27,6 +27,14 @@ class AttributeMethodsTest < ActiveRecord::TestCase ActiveRecord::Base.send(:attribute_method_matchers).concat(@old_matchers) end + def test_attribute_for_inspect + t = topics(:first) + t.title = "The First Topic Now Has A Title With\nNewlines And More Than 50 Characters" + + assert_equal %("#{t.written_on.to_s(:db)}"), t.attribute_for_inspect(:written_on) + assert_equal '"The First Topic Now Has A Title With\nNewlines And M..."', t.attribute_for_inspect(:title) + end + def test_attribute_present t = Topic.new t.title = "hello there!" diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index b8ade90aa2..86528e2100 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1228,14 +1228,6 @@ class BasicsTest < ActiveRecord::TestCase assert_no_queries { assert true } end - def test_attribute_for_inspect - t = topics(:first) - t.title = "The First Topic Now Has A Title With\nNewlines And More Than 50 Characters" - - assert_equal %("#{t.written_on.to_s(:db)}"), t.attribute_for_inspect(:written_on) - assert_equal '"The First Topic Now Has A Title With\nNewlines And M..."', t.attribute_for_inspect(:title) - end - def test_becomes assert_kind_of Reply, topics(:first).becomes(Reply) assert_equal "The First Topic", topics(:first).becomes(Reply).title -- cgit v1.2.3