diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-21 11:26:16 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-26 13:44:11 -0700 |
commit | 9d9aed433bd29eefb14807c02050cb8b88f15f0e (patch) | |
tree | f437803fdac6f0e11075ee77208655e9304e3da9 /activerecord/test/cases/adapters/postgresql/schema_authorization_test.rb | |
parent | 1741bbe2d5cb58af76fb2ca31a25c05eadfadb71 (diff) | |
download | rails-9d9aed433bd29eefb14807c02050cb8b88f15f0e.tar.gz rails-9d9aed433bd29eefb14807c02050cb8b88f15f0e.tar.bz2 rails-9d9aed433bd29eefb14807c02050cb8b88f15f0e.zip |
add a session authorization setter to the pg connection
Diffstat (limited to 'activerecord/test/cases/adapters/postgresql/schema_authorization_test.rb')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/schema_authorization_test.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/schema_authorization_test.rb b/activerecord/test/cases/adapters/postgresql/schema_authorization_test.rb index 8fdda20f77..dc4f8fb955 100644 --- a/activerecord/test/cases/adapters/postgresql/schema_authorization_test.rb +++ b/activerecord/test/cases/adapters/postgresql/schema_authorization_test.rb @@ -43,6 +43,13 @@ class SchemaAuthorizationTest < ActiveRecord::TestCase end end + def test_session_auth= + assert_raise(ActiveRecord::StatementInvalid) do + @connection.session_auth = 'DEFAULT' + @connection.execute "SELECT * FROM #{TABLE_NAME}" + end + end + def test_auth_with_bind assert_nothing_raised do set_session_auth @@ -90,7 +97,7 @@ class SchemaAuthorizationTest < ActiveRecord::TestCase private def set_session_auth auth = nil - @connection.execute "SET SESSION AUTHORIZATION #{auth || 'default'}" + @connection.session_auth = auth || 'default' end end |