Permalink
Browse files

add failing test case for #5953

  • Loading branch information...
dleavitt committed Apr 24, 2012
1 parent 82c3aca commit 2ab179ae479812edfd51c1b82c9414afb6eaedb0
Showing with 9 additions and 0 deletions.
  1. +9 −0 activerecord/test/cases/dup_test.rb
@@ -98,6 +98,15 @@ def test_dup_timestamps_are_cleared
assert_not_nil new_topic.updated_at
assert_not_nil new_topic.created_at
end
+
+ def test_dup_validity_is_independent
+ Topic.validates_presence_of(:title)
+ t1 = Topic.new("title" => "Literature")
+ t1.save!
+ t2 = t1.dup
+ t2.title = nil
+ assert t2.invalid?, 'topic should be invalid'
+ end
def test_dup_after_initialize_callbacks
topic = Topic.new

0 comments on commit 2ab179a

Please sign in to comment.