diff --git a/spec/helpers/index_helper_spec.rb b/spec/helpers/index_helper_spec.rb index 2d31f1de..f4110451 100644 --- a/spec/helpers/index_helper_spec.rb +++ b/spec/helpers/index_helper_spec.rb @@ -22,6 +22,8 @@ class TestingHelper end describe '#index_masonry_document_label' do + subject(:output) { helper.index_masonry_document_label(document) } + let(:label) { 'title' } before do @@ -30,6 +32,17 @@ class TestingHelper allow(index_presenter).to receive(:label).and_return(label) end + it 'retrieves the label using the title' do + expect(output).to eq 'title' + end + + context 'when multiple titles exist' do + let(:label) { ['title1', 'title2'] } + + it 'retrieves the label using only the first title' do + expect(output).to eq 'title1' + end + end end describe '#render_index_document' do