-
-
Save lest/6101aae3cb48b31e6c4a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/activerecord/test/cases/dirty_test.rb b/activerecord/test/cases/dirty_test.rb | |
index b1ce846..1b6fa95 100644 | |
--- a/activerecord/test/cases/dirty_test.rb | |
+++ b/activerecord/test/cases/dirty_test.rb | |
@@ -150,6 +150,13 @@ class DirtyTest < ActiveRecord::TestCase | |
assert_equal parrot.name_change, parrot.title_change | |
end | |
+ def test_change_attribute_using_gsub | |
+ parrot = Parrot.create(:name => 'test') | |
+ parrot.name.gsub(/te/, '') | |
+ assert_equal('st', parrot.name) | |
+ assert_equal({'name' => ['test', 'st']}, parrot.changes) | |
+ end | |
+ | |
def test_reset_attribute! | |
pirate = Pirate.create!(:catchphrase => 'Yar!') | |
pirate.catchphrase = 'Ahoy!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment