Sha256: 4cb78b78a32ee34b714910b45feb789f4c35822b42ede1dd6c7baaeaed08d6a3

Contents?: true

Size: 771 Bytes

Versions: 34

Compression:

Stored size: 771 Bytes

Contents

require 'spec_helper'

describe ActiveFedora::IndexingService do
  let(:indexer) { described_class.new(object) }
  let(:object) { ActiveFedora::Base.new }

  describe "#generate_solr_document" do
    context "when no block is passed" do
      subject { indexer.generate_solr_document }
      it "produces a document" do
        expect(subject['has_model_ssim']).to eq ['ActiveFedora::Base']
      end
    end

    context "when a block is passed" do
      subject do
        indexer.generate_solr_document do |solr_doc|
          solr_doc['noid'] = '12345'
        end
      end

      it "produces and yield the document" do
        expect(subject['has_model_ssim']).to eq ['ActiveFedora::Base']
        expect(subject['noid']).to eq '12345'
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

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