Sha256: 6f64ecc82f3949154d5b880cde073c0192788f758afc3c52d30385abf1dacbf4

Contents?: true

Size: 633 Bytes

Versions: 1

Compression:

Stored size: 633 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 }
  let(:solr_hit) { described_class.new(doc) }

  describe "#reify" do
    subject { solr_hit.reify }

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active-fedora-11.0.0.rc1 spec/integration/solr_hit_spec.rb