class PostgresqlBigSerialTest

Public Instance Methods

test_bigserial_column() click to toggle source
# File activerecord/test/cases/adapters/postgresql/serial_test.rb, line 65
def test_bigserial_column
  column = PostgresqlBigSerial.columns_hash["seq"]
  assert_equal :integer, column.type
  assert_equal "bigint", column.sql_type
  assert column.serial?
end
test_not_bigserial_column() click to toggle source
# File activerecord/test/cases/adapters/postgresql/serial_test.rb, line 72
def test_not_bigserial_column
  column = PostgresqlBigSerial.columns_hash["serials_id"]
  assert_equal :integer, column.type
  assert_equal "bigint", column.sql_type
  assert_not column.serial?
end
test_schema_dump_with_not_bigserial() click to toggle source
# File activerecord/test/cases/adapters/postgresql/serial_test.rb, line 84
def test_schema_dump_with_not_bigserial
  output = dump_table_schema "postgresql_big_serials"
  assert_match %r{t\.bigint\s+"serials_id",\s+default: -> \{ "nextval\('postgresql_big_serials_id_seq'::regclass\)" \}$}, output
end
test_schema_dump_with_shorthand() click to toggle source
# File activerecord/test/cases/adapters/postgresql/serial_test.rb, line 79
def test_schema_dump_with_shorthand
  output = dump_table_schema "postgresql_big_serials"
  assert_match %r{t\.bigserial\s+"seq",\s+null: false$}, output
end