Skip to content

Commit f5b548e

Browse files
committed
Fix nested tests in insert_all_test.rb
The subtle mistake was introduced in rails#51826
1 parent d3a689d commit f5b548e

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

activerecord/test/cases/relation/update_all_test.rb

+18-18
Original file line numberDiff line numberDiff line change
@@ -345,25 +345,25 @@ def test_update_all_doesnt_ignore_order
345345
test_update_with_order_succeeds.call("id DESC")
346346
end
347347
end
348+
end
348349

349-
def test_update_all_with_order_and_limit_updates_subset_only
350-
author = authors(:david)
351-
limited_posts = author.posts_sorted_by_id_limited
352-
assert_equal 1, limited_posts.size
353-
assert_equal 2, limited_posts.limit(2).size
354-
assert_equal 1, limited_posts.update_all([ "body = ?", "bulk update!" ])
355-
assert_equal "bulk update!", posts(:welcome).body
356-
assert_not_equal "bulk update!", posts(:thinking).body
357-
end
350+
def test_update_all_with_order_and_limit_updates_subset_only
351+
author = authors(:david)
352+
limited_posts = author.posts_sorted_by_id_limited
353+
assert_equal 1, limited_posts.size
354+
assert_equal 2, limited_posts.limit(2).size
355+
assert_equal 1, limited_posts.update_all([ "body = ?", "bulk update!" ])
356+
assert_equal "bulk update!", posts(:welcome).body
357+
assert_not_equal "bulk update!", posts(:thinking).body
358+
end
358359

359-
def test_update_all_with_order_and_limit_and_offset_updates_subset_only
360-
author = authors(:david)
361-
limited_posts = author.posts_sorted_by_id_limited.offset(1)
362-
assert_equal 1, limited_posts.size
363-
assert_equal 2, limited_posts.limit(2).size
364-
assert_equal 1, limited_posts.update_all([ "body = ?", "bulk update!" ])
365-
assert_equal "bulk update!", posts(:thinking).body
366-
assert_not_equal "bulk update!", posts(:welcome).body
367-
end
360+
def test_update_all_with_order_and_limit_and_offset_updates_subset_only
361+
author = authors(:david)
362+
limited_posts = author.posts_sorted_by_id_limited.offset(1)
363+
assert_equal 1, limited_posts.size
364+
assert_equal 2, limited_posts.limit(2).size
365+
assert_equal 1, limited_posts.update_all([ "body = ?", "bulk update!" ])
366+
assert_equal "bulk update!", posts(:thinking).body
367+
assert_not_equal "bulk update!", posts(:welcome).body
368368
end
369369
end

0 commit comments

Comments
 (0)