summaryrefslogtreecommitdiff
path: root/spec/initializers/00_connection_logger_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/initializers/00_connection_logger_spec.rb')
-rw-r--r--spec/initializers/00_connection_logger_spec.rb39
1 files changed, 0 insertions, 39 deletions
diff --git a/spec/initializers/00_connection_logger_spec.rb b/spec/initializers/00_connection_logger_spec.rb
deleted file mode 100644
index 8b288b463c4..00000000000
--- a/spec/initializers/00_connection_logger_spec.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe ActiveRecord::ConnectionAdapters::PostgreSQLAdapter do # rubocop:disable RSpec/FilePath
- before do
- allow(PG).to receive(:connect)
- end
-
- let(:conn_params) { PG::Connection.conndefaults_hash }
-
- context 'when warn_on_new_connection is enabled' do
- before do
- described_class.warn_on_new_connection = true
- end
-
- it 'warns on new connection' do
- expect(ActiveSupport::Deprecation)
- .to receive(:warn).with(/Database connection should not be called during initializers/, anything)
-
- expect(PG).to receive(:connect).with(conn_params)
-
- described_class.new_client(conn_params)
- end
- end
-
- context 'when warn_on_new_connection is disabled' do
- before do
- described_class.warn_on_new_connection = false
- end
-
- it 'does not warn on new connection' do
- expect(ActiveSupport::Deprecation).not_to receive(:warn)
- expect(PG).to receive(:connect).with(conn_params)
-
- described_class.new_client(conn_params)
- end
- end
-end