Sha256: 759da7784dddae7a96e3a14e743d17db5fd0ce35a945583df6ba2ef7cd946020

Contents?: true

Size: 761 Bytes

Versions: 17

Compression:

Stored size: 761 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", <%= i cond(5.0, using: :btree) %>
      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

17 entries across 17 versions & 1 rubygems

Version Path
ridgepole-0.8.13 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.9.0.beta spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.8.12 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.8.11 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.8.10 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.8.9 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.8.8 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.8.7 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.8.6 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.8.5 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.8.4 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.8.3 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.8.2 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.8.1 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.8.0 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.8.0.rc2 spec/postgresql/migrate/migrate_add_expression_index_spec.rb
ridgepole-0.7.8 spec/postgresql/migrate/migrate_add_expression_index_spec.rb