From 1485151e29b1d27b54562edd749cc9b89ebfc372 Mon Sep 17 00:00:00 2001 From: Ben Zittlau Date: Sun, 27 Mar 2011 15:19:51 -0600 Subject: [PATCH] Added a test for the inheritance problem with custom classes named scopes --- test/unit/model_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/unit/model_test.rb b/test/unit/model_test.rb index c73823e0..32580d40 100644 --- a/test/unit/model_test.rb +++ b/test/unit/model_test.rb @@ -723,6 +723,14 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase context 'An existing model instance which uses a custom Version class' do setup { @post = Post.create } + context 'on the first version' do + setup { @version = @post.versions.first } + + should 'have the correct index' do + assert_equal 0, @version.index + end + end + should 'should have versions of the custom class' do assert_equal "PostVersion", @post.versions.first.class.name end