Sha256: 62779eb787396b009ab462791472f809385d343a3227493e3dbdfea58005cdba

Contents?: true

Size: 828 Bytes

Versions: 11

Compression:

Stored size: 828 Bytes

Contents

require 'test_helper'

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

  test 'Version Number' do
    assert PaperTrail.const_defined?(: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

11 entries across 11 versions & 1 rubygems

Version Path
paper_trail-3.0.9 test/paper_trail_test.rb
paper_trail-4.0.0.rc1 test/paper_trail_test.rb
paper_trail-3.0.8 test/paper_trail_test.rb
paper_trail-3.0.7 test/paper_trail_test.rb
paper_trail-4.0.0.beta2 test/paper_trail_test.rb
paper_trail-4.0.0.beta1 test/paper_trail_test.rb
paper_trail-3.0.6 test/paper_trail_test.rb
paper_trail-3.0.5 test/paper_trail_test.rb
paper_trail-3.0.2 test/paper_trail_test.rb
paper_trail-3.0.1 test/paper_trail_test.rb
paper_trail-3.0.0 test/paper_trail_test.rb