Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOP-52 Test that Ursus renders a mostly blank Solr document #1188

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions spec/controllers/catalog_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,21 @@
it { expect(search_fields).to contain_exactly(*expected_search_fields) }
end

xdescribe "show action" do
describe "show action" do
render_views

before do
# allow(controller).to receive(:search_service).and_return(search_service)
# expect(search_service).to receive(:fetch).and_return([mock_response, mock_document])
allow(controller).to receive(:enforce_show_permissions).and_return(true)
allow(controller).to receive(:search_service).and_return(search_service)
allow(search_service).to receive(:fetch).and_return([mock_response, mock_document])
end
# let(:doc_id) { '2007020969' }
# let(:mock_response) { instance_double(Blacklight::Solr::Response) }
# let(:mock_document) { instance_double(SolrDocument, export_formats: {}) }
# let(:search_service) { instance_double(Blacklight::SearchService) }

it "has collection count on Collection Item record page" do
# get :show, params: { id: doc_id }
# expect(assigns[:document]).not_to be_nil
let(:doc_id) { 'ark:/123/abc' }
let(:mock_response) { instance_double(Blacklight::Solr::Response) }
let(:mock_document) { instance_double(SolrDocument, export_formats: {}) }
let(:search_service) { instance_double(Blacklight::SearchService) }

it "Renders a blank SolrDocument (meaning missing fields don\'t cause errors)" do
get :show, params: { id: doc_id }
end
end

Expand Down
Loading