Sha256: 62ad0312b6b8e7ad2f5448766486e335e2f2aaad69cc19675b6da78572897b6a

Contents?: true

Size: 658 Bytes

Versions: 13

Compression:

Stored size: 658 Bytes

Contents

require 'spec_helper'

describe ActiveFedora::SolrHit do
  before do
    class Foo < ActiveFedora::Base
      property :title, predicate: ::RDF::Vocab::DC.title, multiple: false
    end
  end

  after do
    Object.send(:remove_const, :Foo)
  end

  let(:another) { Foo.create }

  let!(:obj) { Foo.create!(
    id: 'test-123',
    title: 'My Title'
  ) }

  let(:doc) { obj.to_solr }
  subject(:solr_hit) { described_class.new(doc) }

  describe "#reify" do
    let(:solr_reified) { solr_hit.reify }

    it "finds the document in solr" do
      expect(solr_reified).to be_instance_of Foo
      expect(solr_reified.title).to eq 'My Title'
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
active-fedora-11.1.4 spec/integration/solr_hit_spec.rb
active-fedora-11.1.3 spec/integration/solr_hit_spec.rb
active-fedora-11.1.2 spec/integration/solr_hit_spec.rb
active-fedora-11.1.1 spec/integration/solr_hit_spec.rb
active-fedora-11.1.0 spec/integration/solr_hit_spec.rb
active-fedora-11.0.1 spec/integration/solr_hit_spec.rb
active-fedora-11.0.0 spec/integration/solr_hit_spec.rb
active-fedora-11.0.0.rc7 spec/integration/solr_hit_spec.rb
active-fedora-11.0.0.rc6 spec/integration/solr_hit_spec.rb
active-fedora-11.0.0.rc5 spec/integration/solr_hit_spec.rb
active-fedora-11.0.0.rc4 spec/integration/solr_hit_spec.rb
active-fedora-11.0.0.rc3 spec/integration/solr_hit_spec.rb
active-fedora-11.0.0.rc2 spec/integration/solr_hit_spec.rb