diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-03-05 11:31:18 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-03-05 11:39:29 +0100 |
commit | dea2aafbfa5f63bf99f21244309a6fe75e5de906 (patch) | |
tree | 855e7f81b53b2e7ae0e6dfcf163068880ef36d41 /activerecord/test/cases | |
parent | 72b3b2c9d6cc93fa06f818b3cd8632b3fce6a75e (diff) | |
download | rails-dea2aafbfa5f63bf99f21244309a6fe75e5de906.tar.gz rails-dea2aafbfa5f63bf99f21244309a6fe75e5de906.tar.bz2 rails-dea2aafbfa5f63bf99f21244309a6fe75e5de906.zip |
add regression test. Closes #18400.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/persistence_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/persistence_test.rb b/activerecord/test/cases/persistence_test.rb index 2803ad2de0..7c281a95b7 100644 --- a/activerecord/test/cases/persistence_test.rb +++ b/activerecord/test/cases/persistence_test.rb @@ -366,6 +366,12 @@ class PersistenceTest < ActiveRecord::TestCase end end + def test_update_does_not_run_sql_if_record_has_not_changed + topic = Topic.create(title: 'Another New Topic') + assert_queries(0) { topic.update(title: 'Another New Topic') } + assert_queries(0) { topic.update_attributes(title: 'Another New Topic') } + end + def test_delete topic = Topic.find(1) assert_equal topic, topic.delete, 'topic.delete did not return self' |