Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add test for inheritance from a non-AR superclass

  • Loading branch information...
commit 8c67e709d0b2946473af84959deaac0ced962d5e 1 parent 7293cac
@jonleighton jonleighton authored
View
8 activerecord/test/cases/inclusion_test.rb
@@ -6,6 +6,14 @@ def test_basic_model
Teapot.create!(:name => "Ronnie Kemper")
assert_equal "Ronnie Kemper", Teapot.find(1).name
end
+
+ def test_inherited_model
+ teapot = CoolTeapot.create!(:name => "Bob")
+ teapot.reload
+
+ assert_equal "Bob", teapot.name
+ assert_equal "mmm", teapot.aaahhh
+ end
end
class InclusionUnitTest < ActiveRecord::TestCase
View
11 activerecord/test/models/teapot.rb
@@ -11,3 +11,14 @@ class Teapot
include ActiveRecord::Model
end
+
+class OMFGIMATEAPOT
+ def aaahhh
+ "mmm"
+ end
+end
+
+class CoolTeapot < OMFGIMATEAPOT
+ include ActiveRecord::Model
+ self.table_name = "teapots"
+end
Please sign in to comment.
Something went wrong with that request. Please try again.