Sha256: 8ff931b036e72d88d7de977b0152d7e11b09d63acf43fb67691944cdbd969603
Contents?: true
Size: 880 Bytes
Versions: 31
Compression:
Stored size: 880 Bytes
Contents
require 'spec_helper' describe CurationConcerns::PresenterFactory do describe "#build_presenters" do let(:presenter_class) { CurationConcerns::FileSetPresenter } before do allow(ActiveFedora::SolrService.instance.conn).to receive(:post) .with('select', data: { q: "{!terms f=id}12,13", rows: 1000, qt: 'standard' }) .and_return('response' => { 'docs' => results }) end subject { described_class.build_presenters(['12', '13'], presenter_class, nil) } context "when some ids are found in solr" do let(:results) { [{ "id" => "12" }, { "id" => "13" }] } it "has two results" do expect(subject.size).to eq 2 end end context "when some ids are not found in solr" do let(:results) { [{ "id" => "13" }] } it "has one result" do expect(subject.size).to eq 1 end end end end
Version data entries
31 entries across 31 versions & 1 rubygems