From c480b5b7099cb5c146e77fd6158e0f1da7fe15b7 Mon Sep 17 00:00:00 2001 From: Sean Marcia Date: Tue, 16 Jul 2013 20:55:39 -0400 Subject: [PATCH] Added an additional test to test the passing in of a variable number of versions to keep. --- test/unit/cleaner_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/unit/cleaner_test.rb b/test/unit/cleaner_test.rb index 3a68ee1d..91663c22 100644 --- a/test/unit/cleaner_test.rb +++ b/test/unit/cleaner_test.rb @@ -49,4 +49,13 @@ class PaperTrailCleanerTest < ActiveSupport::TestCase assert_equal 1, Version.all.count assert_equal "Animal Muppet", @animal.name end + + test 'cleaner accepts variable arguments' do + @animal = Animal.create :name => 'Animal' + @animal.update_attributes :name => 'Animal from the Muppets' + @animal.update_attributes :name => 'Animal Muppet' + PaperTrail.clean_paper_trail_versions(2) + assert_equal 2, Version.all.count + assert_equal "Animal Muppet", @animal.name + end end