Sha256: 96600f812ed329facb34542c9ce5e4a1c511b2eb0a5a3f6c5a60da85f8182448
Contents?: true
Size: 844 Bytes
Versions: 39
Compression:
Stored size: 844 Bytes
Contents
require 'cases/sqlserver_helper' require 'models/topic' class AttributeMethodsTestSqlserver < ActiveRecord::TestCase end class AttributeMethodsTest < ActiveRecord::TestCase COERCED_TESTS = [ :test_typecast_attribute_from_select_to_false, :test_typecast_attribute_from_select_to_true ] include SqlserverCoercedTest fixtures :topics def test_coerced_typecast_attribute_from_select_to_false topic = Topic.create(:title => 'Budget') topic = Topic.find(:first, :select => "topics.*, CASE WHEN 1=2 THEN 1 ELSE 0 END as is_test") assert !topic.is_test? end def test_coerced_typecast_attribute_from_select_to_true topic = Topic.create(:title => 'Budget') topic = Topic.find(:first, :select => "topics.*, CASE WHEN 2=2 THEN 1 ELSE 0 END as is_test") assert topic.is_test? end end
Version data entries
39 entries across 39 versions & 5 rubygems