Skip to content

Commit f55cdaf

Browse files
authored
Merge pull request rails#43397 from composerinteralia/replace-more-ableist-language
Replace more ableist language
2 parents ab3c1c6 + 2635106 commit f55cdaf

File tree

17 files changed

+34
-37
lines changed

17 files changed

+34
-37
lines changed

actionpack/lib/action_controller/test_case.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ def document_root_element
627627
end
628628

629629
def check_required_ivars
630-
# Sanity check for required instance variables so we can give an
630+
# Check for required instance variables so we can give an
631631
# understandable error message.
632632
[:@routes, :@controller, :@request, :@response].each do |iv_name|
633633
if !instance_variable_defined?(iv_name) || instance_variable_get(iv_name).nil?

actionpack/test/dispatch/system_testing/driver_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class DriverTest < ActiveSupport::TestCase
160160
end
161161

162162
test "does not configure browser if driver is not :selenium" do
163-
# sanity check
163+
# Check that it does configure browser if the driver is :selenium
164164
assert ActionDispatch::SystemTesting::Driver.new(:selenium).instance_variable_get(:@browser)
165165

166166
assert_nil ActionDispatch::SystemTesting::Driver.new(:rack_test).instance_variable_get(:@browser)

actionpack/test/dispatch/test_request_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require "abstract_unit"
44

55
class TestRequestTest < ActiveSupport::TestCase
6-
test "sane defaults" do
6+
test "reasonable defaults" do
77
env = ActionDispatch::TestRequest.create.env
88

99
assert_equal "GET", env.delete("REQUEST_METHOD")

activemodel/test/cases/attribute_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def assert_valid_value(*)
225225
changed = attribute.with_value_from_user("foo")
226226
forgotten = changed.forgetting_assignment
227227

228-
assert changed.changed? # sanity check
228+
assert changed.changed? # Check to avoid a false positive
229229
assert_not_predicate forgotten, :changed?
230230
end
231231

activerecord/lib/active_record/associations/association.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def foreign_key_present?
295295

296296
# Raises ActiveRecord::AssociationTypeMismatch unless +record+ is of
297297
# the kind of the class of the associated objects. Meant to be used as
298-
# a sanity check when you are about to assign an associated record.
298+
# a safety check when you are about to assign an associated record.
299299
def raise_on_type_mismatch!(record)
300300
unless record.is_a?(reflection.klass)
301301
fresh_class = reflection.class_name.safe_constantize

activerecord/test/cases/adapters/postgresql/connection_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def test_statement_key_is_logged
141141
def test_reconnection_after_actual_disconnection_with_verify
142142
original_connection_pid = @connection.query("select pg_backend_pid()")
143143

144-
# Sanity check.
144+
# Double check we are connected to begin with
145145
assert_predicate @connection, :active?
146146

147147
secondary_connection = ActiveRecord::Base.connection_pool.checkout

activerecord/test/cases/adapters/postgresql/rename_table_test.rb

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@ def teardown
1414
end
1515

1616
test "renaming a table also renames the primary key index" do
17-
# sanity check
18-
assert_equal 1, num_indices_named("before_rename_pkey")
19-
assert_equal 0, num_indices_named("after_rename_pkey")
20-
21-
@connection.rename_table :before_rename, :after_rename
22-
23-
assert_equal 0, num_indices_named("before_rename_pkey")
24-
assert_equal 1, num_indices_named("after_rename_pkey")
17+
assert_changes(-> { num_indices_named("before_rename_pkey") }, from: 1, to: 0) do
18+
assert_changes(-> { num_indices_named("after_rename_pkey") }, from: 0, to: 1) do
19+
@connection.rename_table :before_rename, :after_rename
20+
end
21+
end
2522
end
2623

2724
private

activerecord/test/cases/associations/has_many_associations_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,9 +768,9 @@ def test_update_all_on_association_accessed_before_save_with_explicit_foreign_ke
768768
assert_equal firm.clients.count, firm.clients.update_all(description: "Great!")
769769
end
770770

771-
def test_belongs_to_sanity
771+
def test_belongs_to_with_new_object
772772
c = Client.new
773-
assert_nil c.firm, "belongs_to failed sanity check on new object"
773+
assert_nil c.firm, "belongs_to failed on new object"
774774
end
775775

776776
def test_find_ids

activerecord/test/cases/attribute_methods_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ def some_method_that_is_not_on_super
10851085
model = @target.select("id").last!
10861086

10871087
assert_equal ["id"], model.attribute_names
1088-
# Sanity check, make sure other columns exist.
1088+
# Ensure other columns exist.
10891089
assert_not_equal ["id"], @target.column_names
10901090
end
10911091

activerecord/test/cases/autosave_association_test.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,9 +1290,9 @@ def test_should_still_work_without_an_associated_model
12901290
end
12911291

12921292
def test_should_automatically_save_the_associated_model
1293-
@pirate.ship.name = "The Vile Insanity"
1293+
@pirate.ship.name = "The Vile Serpent"
12941294
@pirate.save
1295-
assert_equal "The Vile Insanity", @pirate.reload.ship.name
1295+
assert_equal "The Vile Serpent", @pirate.reload.ship.name
12961296
end
12971297

12981298
def test_changed_for_autosave_should_handle_cycles
@@ -1306,9 +1306,9 @@ def test_changed_for_autosave_should_handle_cycles
13061306
end
13071307

13081308
def test_should_automatically_save_bang_the_associated_model
1309-
@pirate.ship.name = "The Vile Insanity"
1309+
@pirate.ship.name = "The Vile Serpent"
13101310
@pirate.save!
1311-
assert_equal "The Vile Insanity", @pirate.reload.ship.name
1311+
assert_equal "The Vile Serpent", @pirate.reload.ship.name
13121312
end
13131313

13141314
def test_should_automatically_validate_the_associated_model
@@ -1376,7 +1376,7 @@ def test_should_still_raise_an_ActiveRecordRecord_Invalid_exception_if_we_want_t
13761376

13771377
def test_should_not_save_and_return_false_if_a_callback_cancelled_saving
13781378
pirate = Pirate.new(catchphrase: "Arr")
1379-
ship = pirate.build_ship(name: "The Vile Insanity")
1379+
ship = pirate.build_ship(name: "The Vile Serpent")
13801380
ship.cancel_save_from_callback = true
13811381

13821382
assert_no_difference "Pirate.count" do
@@ -1390,7 +1390,7 @@ def test_should_rollback_any_changes_if_an_exception_occurred_while_saving
13901390
before = [@pirate.catchphrase, @pirate.ship.name]
13911391

13921392
@pirate.catchphrase = "Arr"
1393-
@pirate.ship.name = "The Vile Insanity"
1393+
@pirate.ship.name = "The Vile Serpent"
13941394

13951395
# Stub the save method of the @pirate.ship instance to raise an exception
13961396
class << @pirate.ship
@@ -1472,9 +1472,9 @@ def setup
14721472

14731473
def test_should_still_work_without_an_associated_model
14741474
@pirate.destroy
1475-
@ship.reload.name = "The Vile Insanity"
1475+
@ship.reload.name = "The Vile Serpent"
14761476
@ship.save
1477-
assert_equal "The Vile Insanity", @ship.reload.name
1477+
assert_equal "The Vile Serpent", @ship.reload.name
14781478
end
14791479

14801480
def test_should_automatically_save_the_associated_model
@@ -1523,7 +1523,7 @@ def test_should_still_raise_an_ActiveRecordRecord_Invalid_exception_if_we_want_t
15231523
end
15241524

15251525
def test_should_not_save_and_return_false_if_a_callback_cancelled_saving
1526-
ship = Ship.new(name: "The Vile Insanity")
1526+
ship = Ship.new(name: "The Vile Serpent")
15271527
pirate = ship.build_pirate(catchphrase: "Arr")
15281528
pirate.cancel_save_from_callback = true
15291529

@@ -1538,7 +1538,7 @@ def test_should_rollback_any_changes_if_an_exception_occurred_while_saving
15381538
before = [@ship.pirate.catchphrase, @ship.name]
15391539

15401540
@ship.pirate.catchphrase = "Arr"
1541-
@ship.name = "The Vile Insanity"
1541+
@ship.name = "The Vile Serpent"
15421542

15431543
# Stub the save method of the @ship.pirate instance to raise an exception
15441544
class << @ship.pirate
@@ -1553,7 +1553,7 @@ def save(**)
15531553
end
15541554

15551555
def test_should_not_load_the_associated_model
1556-
assert_queries(1) { @ship.name = "The Vile Insanity"; @ship.save! }
1556+
assert_queries(1) { @ship.name = "The Vile Serpent"; @ship.save! }
15571557
end
15581558

15591559
def test_should_save_with_non_nullable_foreign_keys

0 commit comments

Comments
 (0)