提交 88201e41 编写于 作者: M Matthew Draper 提交者: GitHub

Merge pull request #29362 from kamipo/remove_redundant_assert_nothing_raised

Remove redundant `assert_nothing_raised` before another assertions
......@@ -93,8 +93,6 @@ def test_string_assignment
end
def test_empty_string_assignment
assert_nothing_raised { PostgresqlPoint.new(x: "") }
p = PostgresqlPoint.new(x: "")
assert_nil p.x
end
......
......@@ -34,18 +34,12 @@ def test_eager_association_loading_with_cascaded_two_levels_and_one_level
end
def test_eager_association_loading_with_hmt_does_not_table_name_collide_when_joining_associations
assert_nothing_raised do
Author.joins(:posts).eager_load(:comments).where(posts: { tags_count: 1 }).to_a
end
authors = Author.joins(:posts).eager_load(:comments).where(posts: { tags_count: 1 }).to_a
assert_equal 1, assert_no_queries { authors.size }
assert_equal 10, assert_no_queries { authors[0].comments.size }
end
def test_eager_association_loading_grafts_stashed_associations_to_correct_parent
assert_nothing_raised do
Person.eager_load(primary_contact: :primary_contact).where("primary_contacts_people_2.first_name = ?", "Susan").order("people.id").to_a
end
assert_equal people(:michael), Person.eager_load(primary_contact: :primary_contact).where("primary_contacts_people_2.first_name = ?", "Susan").order("people.id").first
end
......
......@@ -271,9 +271,6 @@ def test_loading_from_an_association
end
def test_loading_from_an_association_that_has_a_hash_of_conditions
assert_nothing_raised do
Author.all.merge!(includes: :hello_posts_with_hash_conditions).to_a
end
assert !Author.all.merge!(includes: :hello_posts_with_hash_conditions).find(authors(:david).id).hello_posts.empty?
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册