Skip to content

Commit

Permalink
Implementing a test for the new helper
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgriffiniii committed Jun 21, 2018
1 parent 9580c46 commit 2bce22f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/helpers/index_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2bce22f

Please sign in to comment.