Sha256: 9f0910f7cd569f9950a1d30112ab8be47bf59e2dbb1508849ef3b535c641160a
Contents?: true
Size: 1.4 KB
Versions: 13
Compression:
Stored size: 1.4 KB
Contents
describe 'Ridgepole::Client#diff -> migrate' do context 'when change fk' do let(:actual_dsl) { erbh(<<-EOS) create_table "parent", force: :cascade do |t| end create_table "child", force: :cascade do |t| t.integer "parent_id" end <%= add_index "child", ["parent_id"], name: "par_id", using: :btree %> add_foreign_key "child", "parent", name: "fk_rails_e74ce85cbc", on_delete: :cascade EOS } let(:sorted_actual_dsl) { erbh(<<-EOS) create_table "child", force: :cascade do |t| t.integer "parent_id" end <%= add_index "child", ["parent_id"], name: "par_id", using: :btree %> create_table "parent", force: :cascade do |t| end add_foreign_key "child", "parent", name: "fk_rails_e74ce85cbc", on_delete: :cascade EOS } let(:expected_dsl) { erbh(<<-EOS) create_table "child", force: :cascade do |t| t.integer "parent_id" end <%= add_index "child", ["parent_id"], name: "par_id", using: :btree %> create_table "parent", force: :cascade do |t| end add_foreign_key "child", "parent", name: "fk_rails_e74ce85cbc" EOS } before { subject.diff(actual_dsl).migrate } subject { client(dumb_with_default_fk_name: true) } it { delta = subject.diff(expected_dsl) expect(delta.differ?).to be_truthy expect(subject.dump).to match_fuzzy sorted_actual_dsl delta.migrate expect(subject.dump).to match_fuzzy expected_dsl } end end
Version data entries
13 entries across 13 versions & 1 rubygems