Sha256: 1feafb45445d093ba494cb38b392e1baa684a4c6e2717a8ca3ce694c99baae67

Contents?: true

Size: 909 Bytes

Versions: 11

Compression:

Stored size: 909 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::RelsExt.isPartOf
    end

    class ChildThing < ActiveFedora::Base
      belongs_to :parent, :class_name=>'ParentThing', predicate: ActiveFedora::RDF::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

11 entries across 11 versions & 1 rubygems

Version Path
active-fedora-9.0.0.rc3 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.0.0.rc2 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.0.0.rc1 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.0.0.beta8 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.0.0.beta7 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.0.0.beta6 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.0.0.beta5 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.0.0.beta4 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.0.0.beta3 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.0.0.beta2 spec/integration/fedora_solr_sync_spec.rb
active-fedora-9.0.0.beta1 spec/integration/fedora_solr_sync_spec.rb