Sha256: 0039f82f63c38d7fe3d025aeaab64ba07a4e8564bb428b9b4fe5d180012bb313

Contents?: true

Size: 921 Bytes

Versions: 34

Compression:

Stored size: 921 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 "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

34 entries across 34 versions & 1 rubygems

Version Path
active-fedora-10.3.0 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.7.3 spec/integration/fedora_solr_sync_spec.rb
active-fedora-10.3.0.rc2 spec/integration/fedora_solr_sync_spec.rb
active-fedora-10.3.0.rc1 spec/integration/fedora_solr_sync_spec.rb
active-fedora-10.2.1 spec/integration/fedora_solr_sync_spec.rb
active-fedora-10.2.0 spec/integration/fedora_solr_sync_spec.rb
active-fedora-11.0.0.rc1 spec/integration/fedora_solr_sync_spec.rb
active-fedora-10.1.0 spec/integration/fedora_solr_sync_spec.rb
active-fedora-10.1.0.rc1 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.7.2 spec/integration/fedora_solr_sync_spec.rb
active-fedora-10.0.0 spec/integration/fedora_solr_sync_spec.rb
active-fedora-10.0.0.beta4 spec/integration/fedora_solr_sync_spec.rb
active-fedora-10.0.0.beta3 spec/integration/fedora_solr_sync_spec.rb
active-fedora-10.0.0.beta2 spec/integration/fedora_solr_sync_spec.rb
active-fedora-10.0.0.beta1 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.13.0 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.12.0 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.11.0 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.10.4 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.10.3 spec/integration/fedora_solr_sync_spec.rb