@@ -673,12 +673,15 @@ def test_merge_options_coerced
673673
674674
675675
676- require 'models/parrot'
677- require 'models/topic'
678676class PersistenceTest < ActiveRecord ::TestCase
679677 # We can not UPDATE identity columns.
680678 coerce_tests! :test_update_columns_changing_id
679+ end
680+
681+
681682
683+ require 'models/author'
684+ class UpdateAllTest < ActiveRecord ::TestCase
682685 # Previous test required updating a identity column.
683686 coerce_tests! :test_update_all_doesnt_ignore_order
684687 def test_update_all_doesnt_ignore_order_coerced
@@ -692,30 +695,6 @@ def test_update_all_doesnt_ignore_order_coerced
692695 _ ( david . reload . name ) . must_equal 'David'
693696 _ ( mary . reload . name ) . must_equal 'Test'
694697 end
695-
696- # We can not UPDATE identity columns.
697- coerce_tests! :test_update_attributes
698- def test_update_attributes_coerced
699- topic = Topic . find ( 1 )
700- assert !topic . approved?
701- assert_equal "The First Topic" , topic . title
702- topic . update_attributes ( "approved" => true , "title" => "The First Topic Updated" )
703- topic . reload
704- assert topic . approved?
705- assert_equal "The First Topic Updated" , topic . title
706- topic . update_attributes ( approved : false , title : "The First Topic" )
707- topic . reload
708- assert !topic . approved?
709- assert_equal "The First Topic" , topic . title
710- # SQLServer: Here is where it breaks down. No exceptions.
711- # assert_raise(ActiveRecord::RecordNotUnique, ActiveRecord::StatementInvalid) do
712- # topic.update_attributes(id: 3, title: "Hm is it possible?")
713- # end
714- # assert_not_equal "Hm is it possible?", Topic.find(3).title
715- # topic.update_attributes(id: 1234)
716- # assert_nothing_raised { topic.reload }
717- # assert_equal topic.title, Topic.find(1234).title
718- end
719698end
720699
721700
0 commit comments