OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/lib/plugins/acts_as_journalized/test/reload_test.rb

21 lines
597 B

#-- encoding: UTF-8
require File.join(File.dirname(__FILE__), 'test_helper')
class ReloadTest < Test::Unit::TestCase
context 'Reloading a reverted model' do
setup do
@user = User.create(:name => 'Steve Richert')
first_version = @user.version
@user.update_attribute(:last_name, 'Jobs')
@last_version = @user.version
@user.revert_to(first_version)
end
should 'reset the journal number to the most recent journal' do
assert_not_equal @last_journal, @user.journal
@user.reload
assert_equal @last_journal, @user.journal
end
end
end