Sha256: 6d7efbd5e42b4d505e3494688e8e6a4ffbc58a4108f067ccebdf758bf51ee56c

Contents?: true

Size: 705 Bytes

Versions: 35

Compression:

Stored size: 705 Bytes

Contents

require 'spec_helper'

RSpec.describe 'Quoting', type: :helper do
  let(:connection) { ActiveRecord::Base.connection }

  context 'on type names' do
    it 'accepts type name only' do
      expect(connection.quote_type_name('sample')).to eql('"public"."sample"')
    end

    it 'accepts schema and type name' do
      expect(connection.quote_type_name('other.sample')).to eql('"other"."sample"')
    end

    it 'accepts schema as a parameter' do
      expect(connection.quote_type_name('sample', 'test')).to eql('"test"."sample"')
    end

    it 'always prefer the schema from parameter' do
      expect(connection.quote_type_name('nothis.sample', 'this')).to eql('"this"."sample"')
    end
  end

end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
torque-postgresql-3.4.1 spec/tests/quoting_spec.rb
torque-postgresql-2.4.5 spec/tests/quoting_spec.rb
torque-postgresql-3.4.0 spec/tests/quoting_spec.rb
torque-postgresql-3.3.3 spec/tests/quoting_spec.rb
torque-postgresql-2.4.4 spec/tests/quoting_spec.rb
torque-postgresql-3.3.2 spec/tests/quoting_spec.rb
torque-postgresql-2.4.3 spec/tests/quoting_spec.rb
torque-postgresql-3.3.1 spec/tests/quoting_spec.rb
torque-postgresql-3.3.0 spec/tests/quoting_spec.rb
torque-postgresql-3.2.2 spec/tests/quoting_spec.rb
torque-postgresql-2.4.2 spec/tests/quoting_spec.rb
torque-postgresql-2.4.1 spec/tests/quoting_spec.rb
torque-postgresql-3.2.1 spec/tests/quoting_spec.rb
torque-postgresql-2.4.0 spec/tests/quoting_spec.rb
torque-postgresql-3.2.0 spec/tests/quoting_spec.rb
torque-postgresql-3.1.0 spec/tests/quoting_spec.rb
torque-postgresql-2.3.0 spec/tests/quoting_spec.rb
torque-postgresql-3.0.1 spec/tests/quoting_spec.rb
torque-postgresql-2.2.4 spec/tests/quoting_spec.rb
torque-postgresql-3.0.0 spec/tests/quoting_spec.rb