Sha256: 7a06e5553760f70ed2977a3e581b2a6134249fcdc4df894a1a3bb83c4318afa6

Contents?: true

Size: 641 Bytes

Versions: 6

Compression:

Stored size: 641 Bytes

Contents

# frozen_string_literal: true

require "cases/helper"
require "active_support/core_ext/numeric/bytes"

class PostgresqlIntegerTest < ActiveRecord::PostgreSQLTestCase
  class PgInteger < ActiveRecord::Base
  end

  def setup
    @connection = ActiveRecord::Base.connection

    @connection.transaction do
      @connection.create_table "pg_integers", force: true do |t|
        t.integer :quota, limit: 8, default: 2.gigabytes
      end
    end
  end

  teardown do
    @connection.drop_table "pg_integers", if_exists: true
  end

  test "schema properly respects bigint ranges" do
    assert_equal 2.gigabytes, PgInteger.new.quota
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
ibm_db-5.5.0 test/cases/adapters/postgresql/integer_test.rb
ibm_db-5.4.1 test/cases/adapters/postgresql/integer_test.rb
ibm_db-5.4.0 test/cases/adapters/postgresql/integer_test.rb
ibm_db-5.3.2 test/cases/adapters/postgresql/integer_test.rb
ibm_db-5.3.1 test/cases/adapters/postgresql/integer_test.rb
ruby-on-quails-0.1.0 activerecord/test/cases/adapters/postgresql/integer_test.rb