Sha256: fde1c5bd0e23e478a989e82fa0b46c492a9d961f330b3d590fb05080b1d7eaa2

Contents?: true

Size: 808 Bytes

Versions: 9

Compression:

Stored size: 808 Bytes

Contents

require_relative "test_helper"

class ThroughAssociationTest < ActiveSupport::TestCase

  test "archive a through associated object whose 'bridge' is archival" do
    archival = Archival.create!
    bridge   = archival.archival_kids.create!
    through  = bridge.archival_grandkids.create!
    archival.archive!

    assert archival.reload.archived?
    assert bridge.reload.archived?
    assert through.reload.archived?
  end

  # TODO: Make something like this pass
  # test "archive a through associated object whose 'bridge' is not archival" do
  #   archival = Archival.create!
  #   bridge   = archival.independent_archival_kids.create!
  #   through  = bridge.archival_grandkids.create!
  #   archival.archive

  #   assert archival.reload.archived?
  #   assert through.reload.archived?
  # end

end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
archival_record-3.0.1 test/through_association_test.rb
archival_record-3.0.0 test/through_association_test.rb
acts_as_archival-2.1.0 test/through_association_test.rb
acts_as_archival-2.0.0 test/through_association_test.rb
archival_record-2.0.2 test/through_association_test.rb
archival_record-2.0.1 test/through_association_test.rb
archival_record-2.0.0 test/through_association_test.rb
acts_as_archival-1.4.0 test/through_association_test.rb
acts_as_archival-1.3.0 test/through_association_test.rb