From 9ef62b83b4fc297555c5643cd82707c0cd4a9432 Mon Sep 17 00:00:00 2001
From: Chris Beer
<%= link_to(document_presenter(@original_doc).heading, solr_document_path(@original_doc)) %>
diff --git a/spec/views/browse/index.html.erb_spec.rb b/spec/views/browse/index.html.erb_spec.rb index cc9484f4b..213c6c284 100644 --- a/spec/views/browse/index.html.erb_spec.rb +++ b/spec/views/browse/index.html.erb_spec.rb @@ -3,17 +3,21 @@ require 'rails_helper' RSpec.describe "browse/index" do - let(:original_doc) { + let(:original_doc) do SolrDocument.new( id: 'doc-id', - item_display_struct: [ - { barcode: '123', library: 'library', effective_permanent_location_code: 'location_code', temporary_location_code: 'temporary_location_code', type: 'type', - truncated_callnumber: 'truncated_callnumber', callnumber: 'callnumber123' }, - { barcode: '321', library: 'library', effective_permanent_location_code: 'location_code', temporary_location_code: 'temporary_location_code', type: 'type', - truncated_callnumber: 'truncated_callnumber', callnumber: 'callnumber321' } - ] + browse_nearby_struct: browse_nearby_struct, + item_display_struct: item_display_struct ) - } + end + + let(:browse_nearby_struct) do + [ + { item_id: '123', callnumber: 'callnumber123', shelfkey: 'A', scheme: 'LC' } + ] + end + + let(:item_display_struct) { [] } let(:presenter) { OpenStruct.new(heading: "Title") } before do @@ -35,6 +39,15 @@ end describe "with barcode" do + let(:item_display_struct) do + [ + { barcode: '123', library: 'library', effective_permanent_location_code: 'location_code', temporary_location_code: 'temporary_location_code', type: 'type', + truncated_callnumber: 'truncated_callnumber', callnumber: 'callnumber123' }, + { barcode: '321', library: 'library', effective_permanent_location_code: 'location_code', temporary_location_code: 'temporary_location_code', type: 'type', + truncated_callnumber: 'truncated_callnumber', callnumber: 'callnumber321' } + ] + end + before do allow(view).to receive(:params).and_return(start: '123', barcode: '321') end