Sha256: e57d192c523adf3867439f7f5b51ff789dd50812da6e847e2814672088944236

Contents?: true

Size: 577 Bytes

Versions: 4

Compression:

Stored size: 577 Bytes

Contents

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 version number to the most recent version' do
      assert_not_equal @last_version, @user.version
      @user.reload
      assert_equal @last_version, @user.version
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
nickjones-vestal_versions-1.0.3 test/reload_test.rb
vestal_versions-1.0.2 test/reload_test.rb
vestal_versions-1.0.1 test/reload_test.rb
vestal_versions-1.0.0 test/reload_test.rb