Sha256: 02ae6f0b6fd95414ea661de81304c60dfa95260f4102dafcab5f3f963ea04831

Contents?: true

Size: 726 Bytes

Versions: 26

Compression:

Stored size: 726 Bytes

Contents

require 'test_helper'

class PaperTrailTest < ActiveSupport::TestCase
  test 'Sanity test' do
    assert_kind_of Module, PaperTrail
  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 = Version.with_item_keys('Widget', widget.id)
    assert_equal 2, versions_for_widget.length
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
paper_trail-2.7.2 test/paper_trail_test.rb
paper_trail-2.7.1 test/paper_trail_test.rb
paper_trail-2.7.0 test/paper_trail_test.rb
paper_trail-2.6.4 test/paper_trail_test.rb
paper_trail-2.6.3 test/paper_trail_test.rb
paper_trail-2.6.2 test/paper_trail_test.rb
paper_trail-2.6.1 test/paper_trail_test.rb
paper_trail-2.6.0 test/paper_trail_test.rb
paper_trail-2.5.2 test/paper_trail_test.rb
paper_trail-2.5.0 test/paper_trail_test.rb
paper_trail-2.4.1 test/paper_trail_test.rb
paper_trail-2.4.0 test/paper_trail_test.rb
bkwld-paper_trail-2.3.3 test/paper_trail_test.rb
paper_trail-2.3.3 test/paper_trail_test.rb
bkwld-paper_trail-2.3.2 test/paper_trail_test.rb
paper_trail-2.3.2 test/paper_trail_test.rb
paper_trail-2.3.1 test/paper_trail_test.rb
paper_trail-2.3.0 test/paper_trail_test.rb
paper_trail-2.2.9 test/paper_trail_test.rb
paper_trail-2.2.8 test/paper_trail_test.rb