Sha256: 57decde98ec13d3531f646f875c3e461a87104257631798310d301b19f1762e4
Contents?: true
Size: 924 Bytes
Versions: 47
Compression:
Stored size: 924 Bytes
Contents
# frozen_string_literal: true require_relative '../../../../lib/declare_schema/schema_change/column_remove' RSpec.describe DeclareSchema::SchemaChange::ColumnRemove do before do load File.expand_path('../prepare_testapp.rb', __dir__) end 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
47 entries across 47 versions & 1 rubygems