Sha256: 4e1f55ac52acab58a38661555539f77c3e8af2c4ae87b4f070af8a4d156a1d35

Contents?: true

Size: 1.02 KB

Versions: 20

Compression:

Stored size: 1.02 KB

Contents

describe 'Ridgepole::Client#diff -> migrate' do
  context 'when create table' do
    let(:expected_dsl) {
      <<-EOS
        create_table "employee_clubs", force: :cascade do |t|
          t.integer "emp_no", null: false, unsigned: true
          t.integer "club_id", null: false, unsigned: true
        end

        add_index "employee_clubs", ["emp_no", "club_id"], name: "idx_emp_no_club_id", using: :btree
      EOS
    }

    subject { client(table_options: 'ENGINE=MyISAM CHARSET=utf8') }

    it {
      delta = subject.diff(expected_dsl)
      expect(delta.differ?).to be_truthy

      expect(delta.script).to match_fuzzy <<-EOS
        create_table("employee_clubs", {:options=>"ENGINE=MyISAM CHARSET=utf8"}) do |t|
          t.column("emp_no", :"integer", {:null=>false, :unsigned=>true, :limit=>4})
          t.column("club_id", :"integer", {:null=>false, :unsigned=>true, :limit=>4})
        end
        add_index("employee_clubs", ["emp_no", "club_id"], {:name=>"idx_emp_no_club_id", :using=>:btree})
      EOS
    }
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ridgepole-0.7.0.beta18 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.beta17 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.beta16 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.beta15 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.beta14 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.beta13 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.beta12 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.beta11 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.beta10 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.beta9 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.beta8 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.beta7 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.beta6 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.beta5 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.beta4 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.beta3 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.beta2 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.beta spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.alpha3 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.7.0.alpha2 spec/mysql/migrate/migrate_create_table_with_options_spec.rb