aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-05-19 01:35:19 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-05-19 01:35:19 +0000
commita995b9cde074bec46ab4befc53f16ff91ec952f2 (patch)
treea42ff09357c6d3cb7b31661ffcd03e3211786d10 /activerecord/test
parent81ee044fdaf7b0ea15b4c646fa46947f71da00fe (diff)
downloadrails-a995b9cde074bec46ab4befc53f16ff91ec952f2.tar.gz
rails-a995b9cde074bec46ab4befc53f16ff91ec952f2.tar.bz2
rails-a995b9cde074bec46ab4befc53f16ff91ec952f2.zip
Fix #inspect for new records. Closes #8405.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6782 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rwxr-xr-xactiverecord/test/base_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb
index 60e48c763b..02ca84e782 100755
--- a/activerecord/test/base_test.rb
+++ b/activerecord/test/base_test.rb
@@ -1651,6 +1651,10 @@ class BasicsTest < Test::Unit::TestCase
assert_equal topic.inspect, %(#<Topic id: 1, title: "The First Topic", author_name: "David", author_email_address: "david@loudthinking.com", written_on: "#{topic.written_on.to_s(:db)}", bonus_time: "#{topic.bonus_time.to_s(:db)}", last_read: "#{topic.last_read.to_s(:db)}", content: "Have a nice day", approved: false, replies_count: 1, parent_id: nil, type: nil>)
end
+ def test_inspect_new
+ assert_match /Topic id: nil/, Topic.new.inspect
+ end
+
def test_attribute_for_inspect
t = topics(:first)
t.content = %(This is some really long content, longer than 50 characters, so I can test that text is truncated correctly by the new ActiveRecord::Base#inspect method! Yay! BOOM!)