1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Update tests to assert something

These tests weren't calling assert, so if the execute didn't raise but
also didn't return anything it would be a broken test that never fails.
We need to always add an assertion so we know what the expected behavior
is.
This commit is contained in:
eileencodes 2019-12-18 10:45:36 -05:00
parent e4cbf4ed92
commit 334450bdb0

View file

@ -219,8 +219,13 @@ class Mysql2AdapterTest < ActiveRecord::Mysql2TestCase
def test_doesnt_error_when_a_describe_query_is_called_while_preventing_writes
@connection_handler.while_preventing_writes do
@conn.execute("DESCRIBE engines")
@conn.execute("DESC engines") # DESC is an alias for DESCRIBE
assert_equal 2, @conn.execute("DESCRIBE engines").entries.count
end
end
def test_doesnt_error_when_a_desc_query_is_called_while_preventing_writes
@connection_handler.while_preventing_writes do
assert_equal 2, @conn.execute("DESC engines").entries.count
end
end