Skip to content

Commit 5467618

Browse files
committed
1 parent ade572f commit 5467618

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

activerecord/test/cases/dirty_test.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -945,13 +945,11 @@ def check_around
945945
aircraft = Aircraft.new(name: "Boeing")
946946
assert_equal "Boeing", aircraft.name
947947

948-
time_before_saving = Time.now
949948
aircraft.save!
950-
time_after_saving = Time.now
951949
aircraft.reload
952950

953951
assert_equal "Boeing", aircraft.name
954-
assert_includes time_before_saving - 1..time_after_saving + 1, aircraft.manufactured_at
952+
assert_in_delta Time.now, aircraft.manufactured_at, 1
955953
end
956954
end
957955

activerecord/test/cases/fixtures_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ def test_insert_with_default_function
481481
create_fixtures("aircrafts")
482482

483483
aircraft = Aircraft.find_by(name: "boeing-with-no-manufactured-at")
484-
assert_equal Time.now.utc.strftime("%Y-%m-%d %H:%M:%S"), aircraft.manufactured_at.strftime("%Y-%m-%d %H:%M:%S")
484+
assert_in_delta Time.now, aircraft.manufactured_at, 1
485485
end
486486

487487
def test_insert_with_default_value

0 commit comments

Comments
 (0)