Ticket #8713: test_for_edge.patch
| File test_for_edge.patch, 1.4 kB (added by shoe, 6 months ago) |
|---|
-
a/activerecord/test/cases/associations_test.rb
old new 813 813 def test_build_followed_by_save_does_not_load_target 814 814 new_client = companies(:first_firm).clients_of_firm.build("name" => "Another Client") 815 815 assert companies(:first_firm).save 816 assert !new_client.new_record? 816 817 assert !companies(:first_firm).clients_of_firm.loaded? 817 818 end 818 819 … … 830 831 assert_equal 2, first_topic.replies.to_ary.size 831 832 end 832 833 834 def test_save_without_validations_after_build_without_loading_association 835 first_topic = topics(:first) 836 Reply.column_names 837 838 assert_equal 1, first_topic.replies.size 839 new_reply = nil 840 841 assert_no_queries do 842 new_reply = first_topic.replies.build(:title => "Not saved", :content => "Superstars") 843 assert new_reply.new_record? 844 assert_equal 2, first_topic.replies.size 845 end 846 assert first_topic.save(false) 847 assert !new_reply.new_record? 848 849 assert_equal 2, first_topic.replies.to_ary.size 850 end 851 833 852 def test_create_without_loading_association 834 853 first_firm = companies(:first_firm) 835 854 Firm.column_names