Animal (class with has_types :pony) - should load subclasses on #new has_types - should load subclasses when any descendent loaded, and have correct SQL on #find class Mansion < FixedDwelling; end (where :mansion is not in Dwelling.has_types) - should raise NameError class Pony < Animal; has_types :my_little; end - should raise error (can only specify has_types on STI base class) class Dwelling (with :type_factory => true) - should return a FixedDwelling with new(:type => :fixed_dwelling) - should return a FixedDwelling with new(:type => "FixedDwelling") - should raise argument error with new(:type => "Object") - should return Dwelling with new(:type => "Dwelling") class FixedDwelling < Dwelling - should return a House with new(:type => :house) - should return a House with new(:type => "House") - should raise argument error with new(:type => "Dwelling") - should return FixedDwelling with new(:type => "FixedDwelling") - should be fine with FixedDwelling.new Finished in 0.121784 seconds 13 examples, 0 failures