aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/dup_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/dup_test.rb')
-rw-r--r--activerecord/test/cases/dup_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/test/cases/dup_test.rb b/activerecord/test/cases/dup_test.rb
index 768474e4ac..a1fc639290 100644
--- a/activerecord/test/cases/dup_test.rb
+++ b/activerecord/test/cases/dup_test.rb
@@ -9,6 +9,21 @@ module ActiveRecord
assert !Topic.new.freeze.dup.frozen?
end
+ def test_not_readonly
+ topic = Topic.first
+
+ duped = topic.dup
+ assert !topic.readonly?, 'should not be readonly'
+ end
+
+ def test_is_readonly
+ topic = Topic.first
+ topic.readonly!
+
+ duped = topic.dup
+ assert topic.readonly?, 'should be readonly'
+ end
+
def test_dup_not_persisted
topic = Topic.first
duped = topic.dup