Sha256: cdeddf6b58fcda48f45f7a0aa72f3df76b71caf14fe7f326501978d001a999ab

Contents?: true

Size: 911 Bytes

Versions: 4

Compression:

Stored size: 911 Bytes

Contents

require 'test_helper'

class VersionTest < ActiveSupport::TestCase
  setup {
    change_schema
    @article = Animal.create
    assert Version.creates.present?
  }

  context "Version.creates" do
    should "return only create events" do
      Version.creates.each do |version|
        assert_equal "create", version.event
      end
    end
  end

  context "Version.updates" do
    setup {
      @article.update_attributes(:name => 'Animal')
      assert Version.updates.present?
    }

    should "return only update events" do
      Version.updates.each do |version|
        assert_equal "update", version.event
      end
    end
  end

  context "Version.destroys" do
    setup {
      @article.destroy
      assert Version.destroys.present?
    }

    should "return only destroy events" do
      Version.destroys.each do |version|
        assert_equal "destroy", version.event
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
paper_trail-2.7.1 test/unit/version_test.rb
paper_trail-2.7.0 test/unit/version_test.rb
paper_trail-2.6.4 test/unit/version_test.rb
paper_trail-2.6.3 test/unit/version_test.rb