"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "activerecord/test/cases/insert_all_test.rb" between
rails-6.1.3.2.tar.gz and rails-6.1.4.tar.gz

About: Ruby on Rails is a web application development framework (written in Ruby).

insert_all_test.rb  (rails-6.1.3.2):insert_all_test.rb  (rails-6.1.4)
skipping to change at line 469 skipping to change at line 469
assert_difference "Book.where(format: 'X').count", +2 do assert_difference "Book.where(format: 'X').count", +2 do
Book.create_with(format: "X").upsert_all([ { name: "A" }, { name: "B" } ]) Book.create_with(format: "X").upsert_all([ { name: "A" }, { name: "B" } ])
end end
end end
def test_upsert_all_has_many_through def test_upsert_all_has_many_through
book = Book.first book = Book.first
assert_raise(ArgumentError) { book.subscribers.upsert_all([ { nick: "Jimmy" } ]) } assert_raise(ArgumentError) { book.subscribers.upsert_all([ { nick: "Jimmy" } ]) }
end end
def test_upsert_all_with_unique_by_fails_cleanly_for_adapters_not_supporting_i
nsert_conflict_target
skip if supports_insert_conflict_target?
error = assert_raises ArgumentError do
Book.upsert_all [{ name: "Rework", author_id: 1 }], unique_by: :isbn
end
assert_match "#{ActiveRecord::Base.connection.class} does not support :uniqu
e_by", error.message
end
private private
def capture_log_output def capture_log_output
output = StringIO.new output = StringIO.new
old_logger, ActiveRecord::Base.logger = ActiveRecord::Base.logger, ActiveS upport::Logger.new(output) old_logger, ActiveRecord::Base.logger = ActiveRecord::Base.logger, ActiveS upport::Logger.new(output)
begin begin
yield output yield output
ensure ensure
ActiveRecord::Base.logger = old_logger ActiveRecord::Base.logger = old_logger
end end
 End of changes. 1 change blocks. 
0 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)