Sha256: edfc85a2e347ed5b75546ef1572a998ca91680cb7d1a9f6367a2a2f37df3ad78

Contents?: true

Size: 1010 Bytes

Versions: 25

Compression:

Stored size: 1010 Bytes

Contents

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

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

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

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

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

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
ridgepole-0.4.12 spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.4.11.beta spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.4.10 spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.4.10.beta spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.4.9 spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.4.8 spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.4.8.rc2 spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.4.8.rc1 spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.4.7 spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.4.6 spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.4.5 spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.4.4 spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.4.3 spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.4.2 spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.4.1 spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.4.0 spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.3.9 spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.3.8 spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.3.7 spec/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.3.6 spec/migrate/migrate_create_table_with_options_spec.rb