Sha256: be8f3872b626ab1b4ffe2c2615d6121378f5e4775720e5fca6aa691dbfa5a20a

Contents?: true

Size: 747 Bytes

Versions: 4

Compression:

Stored size: 747 Bytes

Contents

require 'test_helper'

class PaperTrailTest < ActiveSupport::TestCase
  test 'Sanity test' do
    assert_kind_of Module, PaperTrail::Version
  end

  test 'create with plain model class' do
    widget = Widget.create
    assert_equal 1, widget.versions.length
  end

  test 'update with plain model class' do
    widget = Widget.create
    assert_equal 1, widget.versions.length
    widget.update_attributes(:name => 'Bugle')
    assert_equal 2, widget.versions.length
  end

  test 'destroy with plain model class' do
    widget = Widget.create
    assert_equal 1, widget.versions.length
    widget.destroy
    versions_for_widget = PaperTrail::Version.with_item_keys('Widget', widget.id)
    assert_equal 2, versions_for_widget.length
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
paper_trail-3.0.0.rc2 test/paper_trail_test.rb
paper_trail-3.0.0.rc1 test/paper_trail_test.rb
paper_trail_without_deprecated-3.0.0.beta1 test/paper_trail_test.rb
paper_trail-3.0.0.beta1 test/paper_trail_test.rb