aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql/prepared_statements_test.rb
blob: 181c1a097ce81b9090980bb2a2772668d163e69f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require "cases/helper"
require "models/computer"
require "models/developer"

class PreparedStatementsTest < ActiveRecord::PostgreSQLTestCase
  fixtures :developers

  def setup
    @default_prepared_statements = ActiveRecord::Base.connection.instance_variable_get("@prepared_statements")
    ActiveRecord::Base.connection.instance_variable_set("@prepared_statements", false)
  end

  def teardown
    ActiveRecord::Base.connection.instance_variable_set("@prepared_statements", @default_prepared_statements)
  end

  def test_nothing_raised_with_falsy_prepared_statements
    assert_nothing_raised do
      Developer.where(id: 1)
    end
  end
end