diff --git a/spec/plsql/schema_spec.rb b/spec/plsql/schema_spec.rb index 0662882..e8523f0 100644 --- a/spec/plsql/schema_spec.rb +++ b/spec/plsql/schema_spec.rb @@ -218,6 +218,24 @@ class TestModel < TestBaseModel expect(plsql.default_timezone).to eq(:utc) end + it "should not emit ActiveRecord::Base.default_timezone deprecation warning (#234)" do + skip "ActiveRecord.default_timezone is not available" unless ActiveRecord.respond_to?(:default_timezone=) + + ActiveRecord.default_timezone = :utc + + deprecator = ActiveRecord.respond_to?(:deprecator) ? ActiveRecord.deprecator : ActiveSupport::Deprecation + original_behavior = deprecator.behavior + warnings = [] + begin + deprecator.behavior = ->(message, *) { warnings << message } + expect(plsql.default_timezone).to eq(:utc) + ensure + deprecator.behavior = original_behavior + end + + expect(warnings.grep(/default_timezone/)).to be_empty + end + it "should have the same connection as default schema" do expect(plsql.hr.connection).to eq(plsql.connection) end