Sha256: afbf49a01831d268cecee77d3617552ae49193d0dfacbd69ffab0972534c546d

Contents?: true

Size: 725 Bytes

Versions: 9

Compression:

Stored size: 725 Bytes

Contents

require 'spec_helper'

describe 'INET migrations' do
  let!(:connection) { ActiveRecord::Base.connection }
  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-0.0.9 spec/migrations/inet_spec.rb
postgres_ext-0.0.8 spec/migrations/inet_spec.rb
postgres_ext-0.0.7 spec/migrations/inet_spec.rb
postgres_ext-0.0.6 spec/migrations/inet_spec.rb
postgres_ext-0.0.5 spec/migrations/inet_spec.rb
postgres_ext-0.0.4 spec/migrations/inet_spec.rb
postgres_ext-0.0.3 spec/migrations/inet_spec.rb
postgres_ext-0.0.2 spec/migrations/inet_spec.rb
postgres_ext-0.0.1 spec/migrations/inet_spec.rb