Sha256: 229e719ced668d807110878b4081fccf29f75516ef63d18df9ac5224df1d254c

Contents?: true

Size: 746 Bytes

Versions: 57

Compression:

Stored size: 746 Bytes

Contents

require 'cases/sqlserver_helper'
require 'models/company'

class InheritanceTestSqlserver < ActiveRecord::TestCase
end

class InheritanceTest < ActiveRecord::TestCase
  
  COERCED_TESTS = [
    :test_eager_load_belongs_to_primary_key_quoting,
    :test_a_bad_type_column
  ]
  
  include SqlserverCoercedTest
  
  def test_coerced_test_eager_load_belongs_to_primary_key_quoting
    assert_sql(/\(\[companies\].\[id\] = 1\)/) do
      Account.find(1, :include => :firm)
    end
  end
  
  def test_coerced_test_a_bad_type_column
    Company.connection.insert "INSERT INTO [companies] ([id], #{QUOTED_TYPE}, [name]) VALUES(100, 'bad_class!', 'Not happening')"
    assert_raises(ActiveRecord::SubclassNotFound) { Company.find(100) }
  end
  
  
end

Version data entries

57 entries across 57 versions & 7 rubygems

Version Path
aq1018-2000-2008-adapter-0.0.1 test/cases/inheritance_test_sqlserver.rb
aq1018-sqlserver-2000-2008-adpater-0.0.2 test/cases/inheritance_test_sqlserver.rb
artpop-2000-2005-adapter-2.2.15 test/cases/inheritance_test_sqlserver.rb
rails-sqlserver-2000-2005-adapter-1.0.0 test/cases/inheritance_test_sqlserver.rb
rails-sqlserver-2000-2005-adapter-1.0.1 test/cases/inheritance_test_sqlserver.rb
rails-sqlserver-2000-2005-adapter-2.2.0 test/cases/inheritance_test_sqlserver.rb
rails-sqlserver-2000-2005-adapter-2.2.1 test/cases/inheritance_test_sqlserver.rb
rails-sqlserver-2000-2005-adapter-2.2.10 test/cases/inheritance_test_sqlserver.rb
rails-sqlserver-2000-2005-adapter-2.2.11 test/cases/inheritance_test_sqlserver.rb
rails-sqlserver-2000-2005-adapter-2.2.12 test/cases/inheritance_test_sqlserver.rb
rails-sqlserver-2000-2005-adapter-2.2.13 test/cases/inheritance_test_sqlserver.rb
rails-sqlserver-2000-2005-adapter-2.2.14 test/cases/inheritance_test_sqlserver.rb
rails-sqlserver-2000-2005-adapter-2.2.15 test/cases/inheritance_test_sqlserver.rb
rails-sqlserver-2000-2005-adapter-2.2.16 test/cases/inheritance_test_sqlserver.rb
rails-sqlserver-2000-2005-adapter-2.2.17 test/cases/inheritance_test_sqlserver.rb
rails-sqlserver-2000-2005-adapter-2.2.18 test/cases/inheritance_test_sqlserver.rb
rails-sqlserver-2000-2005-adapter-2.2.19 test/cases/inheritance_test_sqlserver.rb
rails-sqlserver-2000-2005-adapter-2.2.2 test/cases/inheritance_test_sqlserver.rb
rails-sqlserver-2000-2005-adapter-2.2.21 test/cases/inheritance_test_sqlserver.rb
rails-sqlserver-2000-2005-adapter-2.2.3 test/cases/inheritance_test_sqlserver.rb