Sha256: 24f63f8f16522875db300c4f2128ba5d4dd09a93e11b33149a5366461ef9b536
Contents?: true
Size: 1.06 KB
Versions: 41
Compression:
Stored size: 1.06 KB
Contents
# frozen_string_literal: true require_relative '../../../../lib/declare_schema/schema_change/table_change' RSpec.describe DeclareSchema::SchemaChange::TableChange do before do load File.expand_path('../prepare_testapp.rb', __dir__) end let(:table_name) { 'networks' } let(:old_options) { { charset: 'utf8', collation: 'utf8_ci' } } let(:new_options) { { charset: 'utf8mb4', collation: 'utf8mb4_bin' } } subject { described_class.new(table_name, old_options, new_options) } describe '#up/down' do describe '#up' do it 'responds with command' do statement = "ALTER TABLE #{ActiveRecord::Base.connection.quote_table_name(table_name)} CHARACTER SET utf8mb4 COLLATE utf8mb4_bin" expect(subject.up).to eq("execute #{statement.inspect}\n") end end describe '#down' do it 'responds with command' do statement = "ALTER TABLE #{ActiveRecord::Base.connection.quote_table_name(table_name)} CHARACTER SET utf8 COLLATE utf8_ci" expect(subject.down).to eq("execute #{statement.inspect}\n") end end end end
Version data entries
41 entries across 41 versions & 1 rubygems