Sha256: a24811cb966ece8e35ecba03b2535968ae842a02eca2f48cd0a8a243235a3b9d

Contents?: true

Size: 771 Bytes

Versions: 9

Compression:

Stored size: 771 Bytes

Contents

require 'spec_helper'

describe 'INET migrations' do
  let!(:connection) { ActiveRecord::Base.connection }
  after { connection.drop_table :data_types }
  it 'creates an inet column' do
    lambda do
      connection.create_table :data_types do |t|
        t.inet :ip_1
        t.inet :ip_2, :ip_3
        t.column :ip_4, :inet
      end
    end.should_not raise_exception

    columns = connection.columns(:data_types)
    ip_1 = columns.detect { |c| c.name == 'ip_1'}
    ip_2 = columns.detect { |c| c.name == 'ip_2'}
    ip_3 = columns.detect { |c| c.name == 'ip_3'}
    ip_4 = columns.detect { |c| c.name == 'ip_4'}

    ip_1.sql_type.should eq 'inet'
    ip_2.sql_type.should eq 'inet'
    ip_3.sql_type.should eq 'inet'
    ip_4.sql_type.should eq 'inet'
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
postgres_ext-1.0.0 spec/migrations/inet_spec.rb
postgres_ext-0.4.0 spec/migrations/inet_spec.rb
postgres_ext-0.3.1 spec/migrations/inet_spec.rb
postgres_ext-0.3.0 spec/migrations/inet_spec.rb
postgres_ext-0.2.2 spec/migrations/inet_spec.rb
postgres_ext-0.2.1 spec/migrations/inet_spec.rb
postgres_ext-0.2.0 spec/migrations/inet_spec.rb
postgres_ext-0.1.0 spec/migrations/inet_spec.rb
postgres_ext-0.0.10 spec/migrations/inet_spec.rb