Sha256: 4a077cdbbb518979e4cc793f5c71b2346abfd85db12a99f364af502983599ab8

Contents?: true

Size: 999 Bytes

Versions: 33

Compression:

Stored size: 999 Bytes

Contents

# frozen_string_literal: true

require "cases/helper_sqlserver"
require "migrations/create_clients_and_change_column_collation"

class ChangeColumnCollationTestSqlServer < ActiveRecord::TestCase
  before do
    @old_verbose = ActiveRecord::Migration.verbose
    ActiveRecord::Migration.verbose = false
    CreateClientsAndChangeColumnCollation.new.up
  end

  after do
    CreateClientsAndChangeColumnCollation.new.down
    ActiveRecord::Migration.verbose = @old_verbose
  end

  def find_column(table, name)
    table.find { |column| column.name == name }
  end

  let(:clients_table) { connection.columns("clients") }
  let(:name_column) { find_column(clients_table, "name") }
  let(:code_column) { find_column(clients_table, "code") }

  it "change column collation to other than default" do
    _(name_column.collation).must_equal "SQL_Latin1_General_CP1_CS_AS"
  end

  it "change column collation to default" do
    _(code_column.collation).must_equal "SQL_Latin1_General_CP1_CI_AS"
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
activerecord-sqlserver-adapter-8.0.0 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.2.2 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.1.9 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.1.8 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.2.1 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.2.0 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.1.7 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.1.6 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.1.5 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.1.4 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.0.7 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.1.3 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.1.2 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.1.1 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.1.0 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.0.6 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.1.0.rc2 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.1.0.rc1 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.0.5.1 test/cases/change_column_collation_test_sqlserver.rb
activerecord-sqlserver-adapter-7.1.0.beta1 test/cases/change_column_collation_test_sqlserver.rb