Sha256: 5d0e9f7d4296306f4a6563a8e0a1aa6980e9fb282520a36be4854519d1cbf280

Contents?: true

Size: 1.58 KB

Versions: 28

Compression:

Stored size: 1.58 KB

Contents

require 'jdbc_common'
require 'db/mssql'

class MsSQLSimpleTest < Test::Unit::TestCase

  include SimpleTestMethods

  # MS SQL 2005 doesn't have a DATE class, only TIMESTAMP.
  undef_method :test_save_date

  # String comparisons are insensitive by default
  undef_method :test_validates_uniqueness_of_strings_case_sensitive

  def test_does_not_munge_quoted_strings
    example_quoted_values = [%{'quoted'}, %{D\'oh!}]
    example_quoted_values.each do |value|
      entry = Entry.create!(:title => value)
      entry.reload
      assert_equal(value, entry.title)
    end
  end

  def test_change_column_default

    Entry.connection.change_column "entries", "title", :string, :default => "new default"
    Entry.reset_column_information
    assert_equal("new default", Entry.new.title)

    Entry.connection.change_column "entries", "title", :string, :default => nil
    Entry.reset_column_information
    assert_equal(nil, Entry.new.title)

  end

  def test_change_column_nullability
    
    Entry.connection.change_column "entries", "title", :string, :null => true
    Entry.reset_column_information
    title_column = Entry.columns.find { |c| c.name == "title" }
    assert(title_column.null)

    Entry.connection.change_column "entries", "title", :string, :null => false
    Entry.reset_column_information
    title_column = Entry.columns.find { |c| c.name == "title" }
    assert(!title_column.null)

  end

  # ACTIVERECORD_JDBC-124
  def test_model_does_not_have_row_num_column
    entry = Entry.first
    assert !entry.attributes.keys.include?("_row_num")
    assert !entry.respond_to?(:_row_num)
  end
end

Version data entries

28 entries across 28 versions & 7 rubygems

Version Path
cmoran92-activerecord-jdbc-adapter-1.2.1.2 test/mssql_simple_test.rb
activerecord-jdbc-adapter-1.2.8 test/mssql_simple_test.rb
activerecord-jdbc-adapter-1.2.5 test/mssql_simple_test.rb
tgbyte-activerecord-jdbc-adapter-1.2.2.5 test/mssql_simple_test.rb
tgbyte-activerecord-jdbc-adapter-1.2.2.4 test/mssql_simple_test.rb
tgbyte-activerecord-jdbc-adapter-1.2.2.3 test/mssql_simple_test.rb
tgbyte-activerecord-jdbc-adapter-1.2.2.2 test/mssql_simple_test.rb
activerecord-jdbc-adapter-1.2.2.1 test/mssql_simple_test.rb
activerecord-jdbc-adapter-onsite-1.2.2 test/mssql_simple_test.rb
cmoran92-activerecord-jdbc-adapter-1.2.1.1 test/mssql_simple_test.rb
intentmedia-activerecord-jdbc-adapter-1.1.1.1 test/mssql_simple_test.rb
activerecord-jdbc-adapter-1.2.2 test/mssql_simple_test.rb
cmoran92-activerecord-jdbc-adapter-1.2.1 test/mssql_simple_test.rb
activerecord-jdbc-adapter-1.2.1 test/mssql_simple_test.rb
c3-activerecord-jdbc-adapter-1.1.3.1 test/mssql_simple_test.rb
activerecord-jdbc-adapter-1.2.0 test/mssql_simple_test.rb
c3-activerecord-jdbc-adapter-1.1.3 test/mssql_simple_test.rb
jashmenn-activerecord-jdbc-adapter-1.2.0.0 test/mssql_simple_test.rb
jashmenn-activerecord-jdbc-adapter-1.2.0 test/mssql_simple_test.rb
activerecord-jdbc-adapter-1.1.3 test/mssql_simple_test.rb