Added a test for the inheritance problem with custom classes named scopes

This commit is contained in:
Ben Zittlau 2011-03-27 15:19:51 -06:00
parent 1c34da50c9
commit 1485151e29
1 changed files with 8 additions and 0 deletions

View File

@ -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