Sha256: a139732fffb84da5ad9a6ae6e85e890d89d47bc8b982b7056fe92387e46ee5ff

Contents?: true

Size: 903 Bytes

Versions: 12

Compression:

Stored size: 903 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

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

    it { is_expected.to be_persisted }

    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

12 entries across 12 versions & 1 rubygems

Version Path
active-fedora-10.3.0 spec/integration/solr_hit_spec.rb
active-fedora-10.3.0.rc2 spec/integration/solr_hit_spec.rb
active-fedora-10.3.0.rc1 spec/integration/solr_hit_spec.rb
active-fedora-10.2.1 spec/integration/solr_hit_spec.rb
active-fedora-10.2.0 spec/integration/solr_hit_spec.rb
active-fedora-10.1.0 spec/integration/solr_hit_spec.rb
active-fedora-10.1.0.rc1 spec/integration/solr_hit_spec.rb
active-fedora-10.0.0 spec/integration/solr_hit_spec.rb
active-fedora-10.0.0.beta4 spec/integration/solr_hit_spec.rb
active-fedora-10.0.0.beta3 spec/integration/solr_hit_spec.rb
active-fedora-10.0.0.beta2 spec/integration/solr_hit_spec.rb
active-fedora-10.0.0.beta1 spec/integration/solr_hit_spec.rb