Sha256: d6b0e976ccb3f8793c53e7428209e6f2f107a1b33f31a4864813e801fe18f07e

Contents?: true

Size: 1.11 KB

Versions: 33

Compression:

Stored size: 1.11 KB

Contents

describe 'Ridgepole::Client#diff -> migrate' do
  context 'when add bigint column' do
    let(:actual_dsl) { '' }

    let(:expected_dsl) {
      erbh(<<-EOS)
        create_table "bigint_test", id: false, force: :cascade do |t|
          t.bigint "b"
        end
      EOS
    }

    before { subject.diff(actual_dsl).migrate }
    subject { client }

    it {
      delta = subject.diff(expected_dsl)
      expect(delta.differ?).to be_truthy
      delta.migrate
      expect(subject.dump).to match_fuzzy expected_dsl
    }
  end

  context 'when no change' do
    let(:dsl) {
      erbh(<<-EOS)
        create_table "bigint_test", id: false, force: :cascade do |t|
          t.bigint "b"
        end
      EOS
    }

    let(:expected_dsl) {
      erbh(<<-EOS)
        create_table "bigint_test", id: false, force: :cascade do |t|
          t.bigint "b"
        end
      EOS
    }

    before { subject.diff(dsl).migrate }
    subject { client }

    it {
      delta = subject.diff(expected_dsl)
      expect(delta.differ?).to be_falsey
      delta.migrate
      expect(subject.dump).to match_fuzzy expected_dsl
    }
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
ridgepole-0.7.1 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.1.beta5 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.1.beta4 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.1.beta3 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.1.beta2 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.1.beta spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.0 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.0.rc1 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.0.beta22 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.0.beta21 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.0.beta20 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.0.beta19 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.0.beta18 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.0.beta17 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.0.beta16 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.0.beta15 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.0.beta14 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.0.beta13 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.0.beta12 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.0.beta11 spec/postgresql/migrate/migrate_bigint_spec.rb