Sha256: b3ba2bb679c5f311cd9c5a03416fad964e6f7c4959a887b5955f1a7be34a585c

Contents?: true

Size: 1.1 KB

Versions: 3

Compression:

Stored size: 1.1 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_ruby 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_ruby expected_dsl
    }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ridgepole-0.7.3.beta spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.2 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.2.beta spec/postgresql/migrate/migrate_bigint_spec.rb