aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/dirty_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/test/cases/dirty_test.rb')
-rw-r--r--activemodel/test/cases/dirty_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activemodel/test/cases/dirty_test.rb b/activemodel/test/cases/dirty_test.rb
index 54427a1513..8b55901a65 100644
--- a/activemodel/test/cases/dirty_test.rb
+++ b/activemodel/test/cases/dirty_test.rb
@@ -83,6 +83,14 @@ class DirtyTest < ActiveModel::TestCase
assert_not_nil @model.changes['name']
end
+ test "be consistent with symbols arguments after the changes are applied" do
+ @model.name = "David"
+ assert @model.attribute_changed?(:name)
+ @model.save
+ @model.name = 'Rafael'
+ assert @model.attribute_changed?(:name)
+ end
+
test "attribute mutation" do
@model.instance_variable_set("@name", "Yam")
assert !@model.name_changed?