Sha256: 04d8fd8dbd0534f12fe8db4b2e1f092e2abd555b841d789e06fada56933d7f12

Contents?: true

Size: 1.27 KB

Versions: 9

Compression:

Stored size: 1.27 KB

Contents

require File.dirname(__FILE__) + '/sample_migration'
require File.dirname(__FILE__) + '/../lib/spec/example/migration_example_group'

describe :create_people_table, :type => :migration do

  before do
    run_migration
  end

  it 'should create a people table' do
    repository(:default).should have_table(:people)
  end

  it 'should have an id column as the primary key' do
    table(:people).should have_column(:id)
    table(:people).column(:id).type.should == 'integer'
    #table(:people).column(:id).should be_primary_key
  end

  it 'should have a name column as a string' do
    table(:people).should have_column(:name)
    table(:people).column(:name).type.should == 'character varying'
    table(:people).column(:name).should permit_null
  end

  it 'should have a nullable age column as a int' do
    table(:people).should have_column(:age)
    table(:people).column(:age).type.should == 'integer'
    table(:people).column(:age).should permit_null
  end

end

describe :add_dob_to_people, :type => :migration do

  before do
    run_migration
  end

  it 'should add a dob column as a timestamp' do
    table(:people).should have_column(:dob)
    table(:people).column(:dob).type.should == 'timestamp without time zone'
    table(:people).column(:dob).should permit_null
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
dm-migrations-0.9.10 examples/sample_migration_spec.rb
dm-migrations-0.9.11 examples/sample_migration_spec.rb
dm-migrations-0.9.5 examples/sample_migration_spec.rb
dm-migrations-0.9.6 examples/sample_migration_spec.rb
dm-migrations-0.9.3 examples/sample_migration_spec.rb
dm-migrations-0.9.4 examples/sample_migration_spec.rb
dm-migrations-0.9.9 examples/sample_migration_spec.rb
dm-migrations-0.9.8 examples/sample_migration_spec.rb
dm-migrations-0.9.7 examples/sample_migration_spec.rb