Sha256: c0ef6ebcfaf9b18c39fb96834fa69d5e3c0176fa0612e1c989d15833e3565d93

Contents?: true

Size: 726 Bytes

Versions: 7

Compression:

Stored size: 726 Bytes

Contents

# frozen_string_literal: true

describe 'Ridgepole::Client#diff -> migrate' do
  subject { client }

  context 'when add_index contains expression' do
    let(:actual_dsl) { '' }
    let(:expected_dsl) { erbh(<<-ERB) }
      create_table "users", force: :cascade do |t|
        t.string "name", null: false
        t.datetime "created_at", null: false
        t.datetime "updated_at", null: false
        t.index "lower((name)::text)", name: "index_users_on_lower_name"
      end
    ERB

    specify do
      delta = subject.diff(expected_dsl)
      expect(delta).to be_differ
      expect(subject.dump).to match_fuzzy(actual_dsl)
      delta.migrate
      expect(subject.dump).to match_fuzzy(expected_dsl)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ridgepole-0.9.5 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.9.4 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.9.3 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.9.2 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.9.1 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.9.0 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.9.0.rc1 spec/postgresql/migrate/migrate_add_expression_index_spec.rb