Sha256: 347802de7eaae0b240098a9bb689d6844558ea2148271ec22a12be808e66d1a3

Contents?: true

Size: 673 Bytes

Versions: 12

Compression:

Stored size: 673 Bytes

Contents

require_relative "test_helper"

class PolymorphicTest < ActiveSupport::TestCase
  test "archive item with polymorphic association" do
    archival = Archival.create!
    poly = archival.polys.create!
    archival.archive

    assert archival.reload.archived?
    assert poly.reload.archived?
  end

  test "unarchive item with polymorphic association" do
    archive_attributes = {
      :archive_number => "test",
      :archived_at    => Time.now
    }
    archival = Archival.create!(archive_attributes)
    poly = archival.polys.create!(archive_attributes)
    archival.unarchive

    assert_not archival.reload.archived?
    assert_not poly.reload.archived?
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
acts_as_archival-1.1.1 test/polymorphic_test.rb
acts_as_archival-1.1.0 test/polymorphic_test.rb
acts_as_archival-1.0.0 test/polymorphic_test.rb
acts_as_archival-0.6.1 test/polymorphic_test.rb
acts_as_archival-0.6.0 test/polymorphic_test.rb
acts_as_archival-0.5.3 test/polymorphic_test.rb
acts_as_archival-0.5.2 test/polymorphic_test.rb
acts_as_archival-0.5.1 test/polymorphic_test.rb
acts_as_archival-0.5.0 test/polymorphic_test.rb
acts_as_archival-0.4.2 test/polymorphic_test.rb
acts_as_archival-0.4.1 test/polymorphic_test.rb
acts_as_archival-0.4.0 test/polymorphic_test.rb