diff options
author | Matthew Draper <matthew@trebex.net> | 2017-06-06 23:46:17 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-06 23:46:17 +0930 |
commit | 88201e41ea408c3def3eab703d68fabdba9a4146 (patch) | |
tree | 028ff8e24d3393c9eab9bab54a23af0dbc8331ba /activerecord | |
parent | 86be4bfe37f8adc576b6895093656b63c2438d30 (diff) | |
parent | 669758fb6183f7fc9b13a44143f6b07ef0fd230b (diff) | |
download | rails-88201e41ea408c3def3eab703d68fabdba9a4146.tar.gz rails-88201e41ea408c3def3eab703d68fabdba9a4146.tar.bz2 rails-88201e41ea408c3def3eab703d68fabdba9a4146.zip |
Merge pull request #29362 from kamipo/remove_redundant_assert_nothing_raised
Remove redundant `assert_nothing_raised` before another assertions
Diffstat (limited to 'activerecord')
3 files changed, 0 insertions, 11 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/geometric_test.rb b/activerecord/test/cases/adapters/postgresql/geometric_test.rb index c1f3a4ae2c..3b6840a1c9 100644 --- a/activerecord/test/cases/adapters/postgresql/geometric_test.rb +++ b/activerecord/test/cases/adapters/postgresql/geometric_test.rb @@ -93,8 +93,6 @@ class PostgresqlPointTest < ActiveRecord::PostgreSQLTestCase end def test_empty_string_assignment - assert_nothing_raised { PostgresqlPoint.new(x: "") } - p = PostgresqlPoint.new(x: "") assert_nil p.x end diff --git a/activerecord/test/cases/associations/cascaded_eager_loading_test.rb b/activerecord/test/cases/associations/cascaded_eager_loading_test.rb index 3638c87968..7b0445025c 100644 --- a/activerecord/test/cases/associations/cascaded_eager_loading_test.rb +++ b/activerecord/test/cases/associations/cascaded_eager_loading_test.rb @@ -34,18 +34,12 @@ class CascadedEagerLoadingTest < ActiveRecord::TestCase 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 diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index 4271a09c9b..55b294cfaa 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -271,9 +271,6 @@ class EagerAssociationTest < ActiveRecord::TestCase 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 |