提交 e6c808e3 编写于 作者: K Kasper Timm Hansen 提交者: GitHub

Merge pull request #27118 from prathamesh-sonpatki/correct-prepared-statements-test

Fix prepared statements disabled test again
......@@ -2,7 +2,7 @@
require "models/computer"
require "models/developer"
class PreparedStatementsTest < ActiveRecord::PostgreSQLTestCase
class PreparedStatementsDisabledTest < ActiveRecord::PostgreSQLTestCase
fixtures :developers
def setup
......@@ -14,9 +14,12 @@ def teardown
ActiveRecord::Base.establish_connection :arunit
end
def test_nothing_raised_with_falsy_prepared_statements
assert_nothing_raised do
Developer.where(id: 1).to_a
end
def test_select_query_works_even_when_prepared_statements_are_disabled
assert_not Developer.connection.prepared_statements
david = developers(:david)
assert_equal david, Developer.where(name: "David").last # With Binds
assert_operator Developer.count, :>, 0 # Without Binds
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册