Sha256: ac5f09617b985d0ff8d188f67b205fd830cba1ffecf7d53d2eb50555f096ec30

Contents?: true

Size: 757 Bytes

Versions: 6

Compression:

Stored size: 757 Bytes

Contents

require 'spec_helper'

describe 'UUID migrations' do
  let!(:connection) { ActiveRecord::Base.connection }
  it 'creates an uuid column' do
    lambda do
      connection.create_table :data_types do |t|
        t.uuid :cidr_1
        t.uuid :cidr_2, :cidr_3
        t.column :cidr_4, :uuid
      end
    end.should_not raise_exception

    columns = connection.columns(:data_types)
    cidr_1 = columns.detect { |c| c.name == 'cidr_1'}
    cidr_2 = columns.detect { |c| c.name == 'cidr_2'}
    cidr_3 = columns.detect { |c| c.name == 'cidr_3'}
    cidr_4 = columns.detect { |c| c.name == 'cidr_4'}

    cidr_1.sql_type.should eq 'uuid'
    cidr_2.sql_type.should eq 'uuid'
    cidr_3.sql_type.should eq 'uuid'
    cidr_4.sql_type.should eq 'uuid'
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
postgres_ext-0.0.7 spec/migrations/uuid_spec.rb
postgres_ext-0.0.6 spec/migrations/uuid_spec.rb
postgres_ext-0.0.5 spec/migrations/uuid_spec.rb
postgres_ext-0.0.4 spec/migrations/uuid_spec.rb
postgres_ext-0.0.3 spec/migrations/uuid_spec.rb
postgres_ext-0.0.2 spec/migrations/uuid_spec.rb