Sha256: ce249d12b6b8b3418f091d3fc65015b60c0c286cff033f7cfd0b046ddd6b1550

Contents?: true

Size: 796 Bytes

Versions: 41

Compression:

Stored size: 796 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(:solr_doc) { indexer.generate_solr_document }
      it "produces a document" do
        expect(solr_doc['has_model_ssim']).to eq ['ActiveFedora::Base']
      end
    end

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

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

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
active-fedora-12.2.4 spec/unit/indexing_service_spec.rb
active-fedora-12.2.3 spec/unit/indexing_service_spec.rb
active-fedora-11.5.6 spec/unit/indexing_service_spec.rb
active-fedora-12.2.2 spec/unit/indexing_service_spec.rb
active-fedora-11.2.1 spec/unit/indexing_service_spec.rb
active-fedora-12.2.1 spec/unit/indexing_service_spec.rb
active-fedora-12.0.3 spec/unit/indexing_service_spec.rb
active-fedora-11.5.5 spec/unit/indexing_service_spec.rb
active-fedora-13.1.2 spec/unit/indexing_service_spec.rb
active-fedora-13.1.1 spec/unit/indexing_service_spec.rb
active-fedora-13.1.0 spec/unit/indexing_service_spec.rb
active-fedora-13.0.0 spec/unit/indexing_service_spec.rb
active-fedora-12.1.1 spec/unit/indexing_service_spec.rb
active-fedora-12.1.0 spec/unit/indexing_service_spec.rb
active-fedora-11.5.4 spec/unit/indexing_service_spec.rb
active-fedora-11.5.3 spec/unit/indexing_service_spec.rb
active-fedora-12.0.2 spec/unit/indexing_service_spec.rb
active-fedora-12.0.1 spec/unit/indexing_service_spec.rb
active-fedora-11.5.2 spec/unit/indexing_service_spec.rb
active-fedora-12.0.0 spec/unit/indexing_service_spec.rb