Sha256: 238183af1057e4b8c6ed407f4ef46aec10f988c1a6ade67966e41f61c9005887

Contents?: true

Size: 944 Bytes

Versions: 1

Compression:

Stored size: 944 Bytes

Contents

require 'spec_helper'

describe 'ActiveRecord Migrations' do
  let!(:connection) { ActiveRecord::Base.connection }
  after { connection.drop_table :generic_data_types }
  it 'creates non-activerecord-postgis-array columns' do
    lambda do
      connection.create_table :generic_data_types do |t|
        t.integer :col_1
        t.string :col_2
        t.datetime :col_3
      end
      connection.add_column :generic_data_types, :col_4, :text
    end.should_not raise_exception

    columns = connection.columns(:generic_data_types)
    col_1 = columns.detect { |c| c.name == 'col_1'}
    col_2 = columns.detect { |c| c.name == 'col_2'}
    col_3 = columns.detect { |c| c.name == 'col_3'}
    col_4 = columns.detect { |c| c.name == 'col_4'}


    col_1.sql_type.should eq 'integer'
    col_2.sql_type.should eq 'character varying(255)'
    col_3.sql_type.should eq 'timestamp without time zone'
    col_4.sql_type.should eq 'text'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord-postgis-array-0.3.4 spec/migrations/active_record_migration_spec.rb