Sha256: f94cacef9ebd57cb2150ab96c6cc62ce08f626171cb690a5a4f9720ae2678637

Contents?: true

Size: 601 Bytes

Versions: 2

Compression:

Stored size: 601 Bytes

Contents

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

class PostgresqlIntegerTest < ActiveRecord::TestCase
  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.execute "drop table if exists pg_integers"
  end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activejob-lock-0.0.2 rails/activerecord/test/cases/adapters/postgresql/integer_test.rb
activejob-lock-0.0.1 rails/activerecord/test/cases/adapters/postgresql/integer_test.rb