Sha256: e1abe073918df8b60f32e77940818bcfbfdd8e970e22d1932a27ce138c1c8756

Contents?: true

Size: 715 Bytes

Versions: 62

Compression:

Stored size: 715 Bytes

Contents

# frozen_string_literal: true

require_relative '../../../../lib/declare_schema/schema_change/table_rename'

RSpec.describe DeclareSchema::SchemaChange::TableRename do
  before do
    load File.expand_path('../prepare_testapp.rb', __dir__)
  end

  let(:old_name) { 'networks' }
  let(:new_name) { 'customers' }
  subject { described_class.new(old_name, new_name) }

  describe '#up/down' do
    describe '#up' do
      it 'responds with command' do
        expect(subject.up).to eq("rename_table :#{old_name}, :#{new_name}\n")
      end
    end

    describe '#down' do
      it 'responds with command' do
        expect(subject.down).to eq("rename_table :#{new_name}, :#{old_name}\n")
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
declare_schema-1.2.0 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-1.2.0.pre.1 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-1.1.0 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-1.0.2 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-1.0.1 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-1.0.0 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-0.14.3 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-0.14.2 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-0.14.1 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-0.14.0 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-0.13.2 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-0.13.1 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-0.13.0 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-0.13.0.pre.2 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-0.13.0.pre.1 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-0.12.1 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-0.12.0 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-0.12.0.pre.2 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-0.12.0.pre.1 spec/lib/declare_schema/schema_change/table_rename_spec.rb
declare_schema-0.11.1 spec/lib/declare_schema/schema_change/table_rename_spec.rb