Sha256: d64a00a84d775c6f29530aca538d40d7b22163669081927ad556a6f6cc589d41

Contents?: true

Size: 925 Bytes

Versions: 22

Compression:

Stored size: 925 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 { ChildThing.create parent: parent }

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

  it "should 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

22 entries across 22 versions & 1 rubygems

Version Path
active-fedora-9.0.8 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.5.0 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.4.3 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.4.2 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.4.1 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.4.0 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.3.0 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.2.1 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.2.0 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.2.0.rc2 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.2.0.rc1 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.1.2 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.1.1 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.1.0 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.1.0.rc1 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.0.6 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.0.5 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.0.4 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.0.3 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.0.2 spec/integration/fedora_solr_sync_spec.rb