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:
parent
e4cbf4ed92
commit
334450bdb0
1 changed files with 7 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue