1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00

Added an additional test to test the passing in of a variable number of versions to keep.

This commit is contained in:
Sean Marcia 2013-07-16 20:55:39 -04:00
parent d6faa94c85
commit c480b5b709

View file

@ -49,4 +49,13 @@ class PaperTrailCleanerTest < ActiveSupport::TestCase
assert_equal 1, Version.all.count assert_equal 1, Version.all.count
assert_equal "Animal Muppet", @animal.name assert_equal "Animal Muppet", @animal.name
end 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 end