Sha256: 2d79f06d37e78d96a76d6e701541a0ec2d1f38c81064938126878105321f7903
Contents?: true
Size: 883 Bytes
Versions: 8
Compression:
Stored size: 883 Bytes
Contents
# frozen_string_literal: true require_relative '../../../../lib/declare_schema/schema_change/column_remove' RSpec.describe DeclareSchema::SchemaChange::ColumnRemove do include_context 'prepare test app' let(:table_name) { 'networks' } let(:column_name) { 'title' } let(:column_type) { :integer } let(:column_options) { { limit: 8 } } let(:column_options_string) { "limit: 8" } subject { described_class.new(table_name, column_name, column_type, **column_options) } describe '#up/down' do describe '#up' do it 'responds with command' do expect(subject.up).to eq("remove_column :#{table_name}, :#{column_name}\n") end end describe '#down' do it 'responds with command' do expect(subject.down).to eq("add_column :#{table_name}, :#{column_name}, :#{column_type}, #{column_options_string}\n") end end end end
Version data entries
8 entries across 8 versions & 1 rubygems