Sha256: 674220944107ce48b474fe925003c930ed661a0ef7861af1e74365141825af1c

Contents?: true

Size: 927 Bytes

Versions: 13

Compression:

Stored size: 927 Bytes

Contents

require 'spec_helper'
require 'timeout'

describe "fedora_solr_sync_issues" do
  before :all do
    class ParentThing < ActiveFedora::Base
      has_many :things, class_name: 'ChildThing', predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf
    end

    class ChildThing < ActiveFedora::Base
      belongs_to :parent, class_name: 'ParentThing', predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf
    end
  end

  after :all do
    Object.send(:remove_const, :ChildThing)
    Object.send(:remove_const, :ParentThing)
  end

  let(:parent) { ParentThing.create }
  subject(:child) { ChildThing.create parent: parent }

  before { Ldp::Resource::RdfSource.new(ActiveFedora.fedora.connection, child.uri).delete }

  it "does not go into an infinite loop" do
    parent.reload
    expect(ActiveFedora::Base.logger).to receive(:error).with("Solr and Fedora may be out of sync:\n")
    expect(parent.things).to eq []
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
active-fedora-11.1.4 spec/integration/fedora_solr_sync_spec.rb
active-fedora-11.1.3 spec/integration/fedora_solr_sync_spec.rb
active-fedora-11.1.2 spec/integration/fedora_solr_sync_spec.rb
active-fedora-11.1.1 spec/integration/fedora_solr_sync_spec.rb
active-fedora-11.1.0 spec/integration/fedora_solr_sync_spec.rb
active-fedora-11.0.1 spec/integration/fedora_solr_sync_spec.rb
active-fedora-11.0.0 spec/integration/fedora_solr_sync_spec.rb
active-fedora-11.0.0.rc7 spec/integration/fedora_solr_sync_spec.rb
active-fedora-11.0.0.rc6 spec/integration/fedora_solr_sync_spec.rb
active-fedora-11.0.0.rc5 spec/integration/fedora_solr_sync_spec.rb
active-fedora-11.0.0.rc4 spec/integration/fedora_solr_sync_spec.rb
active-fedora-11.0.0.rc3 spec/integration/fedora_solr_sync_spec.rb
active-fedora-11.0.0.rc2 spec/integration/fedora_solr_sync_spec.rb