aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test/subscription_adapter/postgresql_test.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2016-01-24 22:30:48 +1030
committerMatthew Draper <matthew@trebex.net>2016-01-24 22:30:48 +1030
commitdcdadd5e82eed2e64d21399599b14501c3e16cc3 (patch)
tree1ec70f6e5357ee6ac58c0913ad67bf046ded7e17 /actioncable/test/subscription_adapter/postgresql_test.rb
parente3a0ad83da16f5fb063ce7d254b4e466baf7199d (diff)
parent9ff28c10ebad0d4781603499a3e3b1d7fd5fbd2c (diff)
downloadrails-dcdadd5e82eed2e64d21399599b14501c3e16cc3.tar.gz
rails-dcdadd5e82eed2e64d21399599b14501c3e16cc3.tar.bz2
rails-dcdadd5e82eed2e64d21399599b14501c3e16cc3.zip
Merge pull request #23217 from matthewd/adapter-tests
ActionCable Adapter tests
Diffstat (limited to 'actioncable/test/subscription_adapter/postgresql_test.rb')
-rw-r--r--actioncable/test/subscription_adapter/postgresql_test.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/actioncable/test/subscription_adapter/postgresql_test.rb b/actioncable/test/subscription_adapter/postgresql_test.rb
new file mode 100644
index 0000000000..64c632b0cd
--- /dev/null
+++ b/actioncable/test/subscription_adapter/postgresql_test.rb
@@ -0,0 +1,32 @@
+require 'test_helper'
+require_relative './common'
+
+require 'active_record'
+
+class PostgresqlAdapterTest < ActionCable::TestCase
+ include CommonSubscriptionAdapterTest
+
+ def setup
+ database_config = { 'adapter' => 'postgresql', 'database' => 'activerecord_unittest' }
+ ar_tests = File.expand_path('../../../activerecord/test', __dir__)
+ if Dir.exist?(ar_tests)
+ require File.join(ar_tests, 'config')
+ require File.join(ar_tests, 'support/config')
+ local_config = ARTest.config['arunit']
+ database_config.update local_config if local_config
+ end
+ ActiveRecord::Base.establish_connection database_config
+
+ super
+ end
+
+ def teardown
+ super
+
+ ActiveRecord::Base.clear_all_connections!
+ end
+
+ def cable_config
+ { adapter: 'postgresql' }
+ end
+end