@@ -672,17 +672,35 @@ def test_merge_options_coerced
672672
673673
674674
675-
675+ require 'models/topic'
676676class PersistenceTest < ActiveRecord ::TestCase
677- # We can not UPDATE identity columns .
677+ # Rails test required updating a identity column .
678678 coerce_tests! :test_update_columns_changing_id
679+
680+ # Rails test required updating a identity column.
681+ coerce_tests! :test_update
682+ def test_update_coerced
683+ topic = Topic . find ( 1 )
684+ assert_not_predicate topic , :approved?
685+ assert_equal "The First Topic" , topic . title
686+
687+ topic . update ( "approved" => true , "title" => "The First Topic Updated" )
688+ topic . reload
689+ assert_predicate topic , :approved?
690+ assert_equal "The First Topic Updated" , topic . title
691+
692+ topic . update ( approved : false , title : "The First Topic" )
693+ topic . reload
694+ assert_not_predicate topic , :approved?
695+ assert_equal "The First Topic" , topic . title
696+ end
679697end
680698
681699
682700
683701require 'models/author'
684702class UpdateAllTest < ActiveRecord ::TestCase
685- # Previous test required updating a identity column.
703+ # Rails test required updating a identity column.
686704 coerce_tests! :test_update_all_doesnt_ignore_order
687705 def test_update_all_doesnt_ignore_order_coerced
688706 david , mary = authors ( :david ) , authors ( :mary )
0 commit comments